Don't consider $HOME when finding the home dir on Windows#2604
Closed
brson wants to merge 1 commit into
Closed
Conversation
Same as rustup. HOME is not a windows thing so allowing it to control the cargo directory means that the directory can change depending on whether you are working under mingw or not. This change makes Cargo always use the windows AppData path. This is a breaking change but if anybody is actually impacted Cargo should just silently start using a different directory. There may be surprises related to `cargo install`. Users of rustup and multirust won't be affected because both override CARGO_HOME.
|
r? @huonw (rust_highfive has picked a reviewer for you, use r? to override) |
Member
|
I wonder if a simpler implementation may be to just remove
|
Contributor
Author
|
Sure. I'll make those changes. |
alexcrichton
added a commit
to alexcrichton/cargo
that referenced
this pull request
May 13, 2016
This commit ensures that we always return the same fallback value on Windows regardless of whichever shell we happen to be run from. We do this by removing the `$HOME` environment variable which `std::env::home_dir` will inspect to force it to fall back to the system APIs. If the old directory exists then we favor that one, but otherwise we favor locations like `C:\Users\$user` Supercedes and closes rust-lang#2604
bors
added a commit
that referenced
this pull request
May 13, 2016
Canonicalize CARGO_HOME fallback on Windows This commit ensures that we always return the same fallback value on Windows regardless of whichever shell we happen to be run from. We do this by removing the `$HOME` environment variable which `std::env::home_dir` will inspect to force it to fall back to the system APIs. If the old directory exists then we favor that one, but otherwise we favor locations like `C:\Users\$user` Supercedes and closes #2604
Contributor
|
☔ The latest upstream changes (presumably #2681) made this pull request unmergeable. Please resolve the merge conflicts. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Same as rustup. HOME is not a windows thing so allowing it
to control the cargo directory means that the directory can
change depending on whether you are working under mingw or not.
This change makes Cargo always use the windows AppData path.
This is a breaking change but if anybody is actually impacted
Cargo should just silently start using a different directory. There
may be surprises related to
cargo install.Users of rustup and multirust won't be affected because both
override CARGO_HOME.