Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

cargo-install: prefer building artifacts in the system temporary directory #2610

Merged
merged 2 commits into from
Apr 24, 2016

Conversation

japaric
Copy link
Member

@japaric japaric commented Apr 22, 2016

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 cargo-install: build directory should be in $TEMPDIR #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?

…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") {
Copy link
Member Author

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah this is fine

@alexcrichton
Copy link
Member

Yeah probably can't hurt to add tests. You can check out some tests in tests/test_cargo_concurrent.rs and perhaps do something similar?

@japaric
Copy link
Member Author

japaric commented Apr 23, 2016

Pushed a commit adding tests. Checked that both tests don't pass without this PR.

@alexcrichton
Copy link
Member

@bors: r+ b484cd3

@bors
Copy link
Contributor

bors commented Apr 24, 2016

⌛ Testing commit b484cd3 with merge 191f65f...

bors added a commit that referenced this pull request Apr 24, 2016
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?
@bors
Copy link
Contributor

bors commented Apr 24, 2016

@bors bors merged commit b484cd3 into rust-lang:master Apr 24, 2016
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cargo-install: build directory should be in $TEMPDIR
3 participants