-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustc: Handle concurrent create_dir
requests
#33332
Conversation
r? @Aatch (rust_highfive has picked a reviewer for you, use r? to override) |
match fs::create_dir(path) { | ||
Ok(()) => return, | ||
Err(ref e) if e.kind() == io::ErrorKind::AlreadyExists => return Ok(()), | ||
Err(ref e) if e.kind() == io::ErrorKind::NotFound => {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When do you get ErrorKind::NotFound
? If the parent doesn't exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's the case where this is emulating create_dir_all
instead of just create_dir
, and if you create /foo/bar/baz
but /foo/bar
doesn't exist you'll get EEXIST
(not found)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
lgtm, r=me when it's compile clean. |
The compiler created a directory as part of `-Z incremental` but that may be hierarchically used concurrently so we need to protect ourselves against that.
b0be4d4
to
71e6329
Compare
…ichaelwoerister rustc: Handle concurrent `create_dir` requests The compiler created a directory as part of `-Z incremental` but that may be hierarchically used concurrently so we need to protect ourselves against that.
…ichaelwoerister rustc: Handle concurrent `create_dir` requests The compiler created a directory as part of `-Z incremental` but that may be hierarchically used concurrently so we need to protect ourselves against that.
The compiler created a directory as part of
-Z incremental
but that may behierarchically used concurrently so we need to protect ourselves against that.