-
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
Use platform-defined directories for cargo state #8063
Conversation
r? @Eh2406 (rust_highfive has picked a reviewer for you, use r? to override) |
32304c0
to
07f687b
Compare
This commit is a continuation and adaptation of rust-lang#5183, which aimed to make cargo no longer reliant on the `$HOME/.cargo` directory in user's home's, and instead uses the `directories` crate to get platform-defined standard directories for data, caches, and configs. The priority of paths cargo will check is as follows: 1. Use `$CARGO_HOME`, if it is set 2. Use `$CARGO_CACHE_DIR`, `$CARGO_CONFIG_DIR`, etc, if they are set 3. If no environment variables are set, and `$HOME/.cargo` is present, use that 4. Finally, use the platform-default directory paths
07f687b
to
442350b
Compare
Thanks for the PR! Unfortuantely the Cargo team is pretty strapped right now and we don't have a ton of spare cycles to help implement this feature. We can try to help out where we can, but we may not be super available :( I'm not entirely sure what's going on with that assertion, and I unfortunately don't have a ton of time right now to dig in. |
In addition to what Alex mentioned, I think it would be good to restart the RFC. It's not really clear to me (without reading hundreds of comments) where things stand. Per rust-lang/rfcs#1615 (comment), I think someone would need to review the feedback and possibly start an new RFC incorporating all the feedback. Like, one example, it looks like there is some disagreement on how macOS should behave. It's also not clear what the rollout story would be with rustup. It may be fine to work on a prototype in tandem. This will need to be gated on nightly somehow. |
That sounds like a reasonable idea. I'd be happy to take a look. Anyone able to co-author a new RFC with me? Especially because I don't have a lot of context on previous discussions. |
Sorry for the random remark, but the By the way, thank you @spacekookie and @soc for pushing for this. |
@spacekookie I think there's an issue in
and Regarding the assertion, I've seen it fire once, but I can't reproduce it, so I'm not sure if it's related or not. |
Okay, I got the assertion to fire -- it needs a project with an external crate. It looks like this:
So the assertion here is that
|
I guess one could easily consider a project like directories "done", but yea, I hadn't seen the archiving of the repo yet
No problem, one day I will be able to make my ~ read-only and all the tools will use xdg_paths instead. Until then, gotta keep patching 😉 Thanks for your investigation into some of the cache issues. I will try to take a look at them on the weekend. I guess the most pressing issue would be to figure out a way for legacy versions to be updated, and how to coordinate all the tools to keep working (what would break, how do we stop it from breaking) |
☔ The latest upstream changes (presumably #8287) made this pull request unmergeable. Please resolve the merge conflicts. |
I would still love to see this happen. Given the age of this PR, and the current conflicts, we felt that it makes sense to close this PR for now. We would still be happy to see a fresh PR implementing this (which may be based on this one) Please don't take this in any way as discouragement from working on it; quite the contrary. We're just trying to keep the list of open PRs manageable. |
Closing for now, since this has been inactive for a long while. As Josh mentioned, we're still interested in this, though we don't have a lot of bandwidth to provide much assistance on figuring out all the details. |
This commit is a partial continuation and adaptation of #5183, which
aimed to make cargo no longer reliant on the
$HOME/.cargo
directoryin user's home's, and instead uses the
directories
crate to getplatform-defined standard directories for data, caches, and configs.
The priority of paths cargo will check is as follows:
$CARGO_HOME
, if it is set$CARGO_CACHE_DIR
,$CARGO_CONFIG_DIR
, etc, if they are set$HOME/.cargo
is present,use that
Notes
This is a work-in-progress PR, and there's some stuff missing/ not
working. Also generally I think I'd like some review on the code
because it's touching on a lot of things that I don't really know/
understand.
Maybe a subcommand similar to what the original PR introduced?
Thanks! :)
cc for review: @joshtriplett, @alexcrichton