Skip to content

rustdoc: Use create_dir_all to create directories #33227

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

Closed
wants to merge 1 commit into from

Conversation

mbrubeck
Copy link
Contributor

This fixes a race condition where a directory is created in between the Path::exists check and the fs::create_dir call. This race condition is triggered sometimes by running a command like cargo doc -p foo -p bar, which can run multiple rustdoc commands in parallel.

This fixes a race condition where a directory is created in between the
Path::exists check and the fs::create_dir call.  This race condition is
triggered sometimes by running a command like `cargo doc -p foo -p bar`,
which can run multiple rustdoc commands in parallel.
@rust-highfive
Copy link
Contributor

r? @steveklabnik

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member

Thanks for the PR! I think this was actually just addressed by #33191, so I'm going to close in favor of that.

@alexcrichton
Copy link
Member

Also, just FYI, but create_dir_all isn't safe to call concurrently unfortunately, it doesn't handle the case that #33191 takes into account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants