]> git.proxmox.com Git - cargo.git/commit - tests/testsuite/out_dir.rs
Improve error messages on mkdir failure
authorAlex Crichton <alex@alexcrichton.com>
Tue, 27 Aug 2019 19:52:49 +0000 (12:52 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 27 Aug 2019 20:52:15 +0000 (13:52 -0700)
commit5102de2b7de997b03181063417f20874a06a67c0
tree77990932b59e509dabbd422708d7d7b6baf510ba
parent732cc52f440561d0ab22a85702e6eda8cf05c367
Improve error messages on mkdir failure

This commit ensures that `fs::create_dir*` isn't called throughout Cargo
and is instead routed through our own wrapper `paths::create_dir_all`
which brings with it a few benefits:

* Gracefully handles when the directory already exists (which is the
  behavior we always want anyway)
* Includes the path name in the error message of what failed
* Handles races of creating a directory by default

Closes #7304
14 files changed:
src/cargo/core/compiler/custom_build.rs
src/cargo/core/compiler/fingerprint.rs
src/cargo/core/compiler/layout.rs
src/cargo/core/compiler/mod.rs
src/cargo/ops/cargo_install.rs
src/cargo/ops/cargo_new.rs
src/cargo/ops/vendor.rs
src/cargo/sources/git/utils.rs
src/cargo/sources/registry/index.rs
src/cargo/sources/registry/remote.rs
src/cargo/util/flock.rs
src/cargo/util/paths.rs
src/cargo/util/vcs.rs
tests/testsuite/out_dir.rs