-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
cargo-install: prefer building artifacts in the system temporary directory #2610
Conversation
…ctory and each cargo-install instance creates and uses its own build directory. This allows running several cargo-install instances in parallel. If we fail to create a temporary directory for whatever reason fallback to creating and using a target-install directory in the current directory. closes rust-lang#2606
let target_dir = if source_id.is_path() { | ||
config.target_dir(&pkg) | ||
} else { | ||
Filesystem::new(config.cwd().join("target-install")) | ||
if let Ok(td) = TempDir::new("cargo-install") { |
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.
Should this be target-install
instead of cargo-install
for consistency with the current/fallback behavior?
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.
Nah this is fine
Yeah probably can't hurt to add tests. You can check out some tests in |
Pushed a commit adding tests. Checked that both tests don't pass without this PR. |
cargo-install: prefer building artifacts in the system temporary directory and each cargo-install instance creates and uses its own build directory. This allows running several cargo-install instances in parallel. If we fail to create a temporary directory for whatever reason fallback to creating and using a target-install directory in the current directory. closes #2606 --- r? @alexcrichton Qs: - Should we preserve the current behavior (`target-install` in `cwd`) as a fallback or remove it and error if we can't create a `TempDir` in `env::temp_dir()`? (we currently error if we can't create `target-install` directory in `cwd`) - Should I add tests for the issues I raised at #2606? If yes, how can I test `cargo-install` parallelism? Lack of "Blocking waiting for file lock on build directory" in the output of the `cargo` commands? or something else?
☀️ Test successful - cargo-cross-linux, cargo-linux-32, cargo-linux-64, cargo-mac-32, cargo-mac-64, cargo-win-gnu-32, cargo-win-gnu-64, cargo-win-msvc-32, cargo-win-msvc-64 |
and each cargo-install instance creates and uses its own build directory. This
allows running several cargo-install instances in parallel.
If we fail to create a temporary directory for whatever reason fallback to
creating and using a target-install directory in the current directory.
closes #2606
r? @alexcrichton
Qs:
target-install
incwd
) as a fallback or remove it and error if we can't create aTempDir
inenv::temp_dir()
? (we currently error if we can't createtarget-install
directory incwd
)cargo-install
parallelism? Lack of "Blocking waiting for file lock on build directory" in the output of thecargo
commands? or something else?