You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use OS-native config, cache home directories #1734
For Linux-like systems, we should be using XDG. See arch's wiki for a non-exhaustive list of software with varying degrees of compliance.
For Windows, everything should go in ~/appdata/locallow or ~/appdata/local,since ~/.cargo is just a cache, AFAICT. This is FOLDERID_LocalAppData for SHGetKnownFolderPath, CSIDL_LOCAL_APPDATA for SHGetFolderPath, and %LOCALAPPDATA% in the environment.
Reacted by Alex Kladov, Patrick Horlebein, Vitaly Shukela, Lee Jenkins, Jan Niklas Hasse, fmdkdd, Screwtapello, Andrew Conrad, Benjamin Herr, Martin Carton and 366 more
Have been stumped by this as well. Looked for Cargo's config in ~/.config/cargo only to find nothing. Don't really understand why Cargo places its config in ~/.cargo and the environment variable CARGO_HOME, while nice is entirely useless. If the user's XDG is not set then it would be fine to place in ~/.cargo.
Reacted by Hugo, Mr Beedell, Roke Julian Lockhart, Tobias Menzi, Joseph Dalrymple, WieeRd, rempas and Nikolas Kilian
@0X1A If the respective XDG_* variables are not set, they should fallback
to the appropriate defaults as defined by the specification. The unfortunate
legacy behaviour cargo needlessly introduced will likely just add the code
bloat.
Reacted by Jan Niklas Hasse, Andrew Conrad, Benjamin Herr, Yohaï-Eliel Berreby, Victorien Elvinger, Mihai Capotă, soc, Shmerl, Amelorate, QasimK and 65 more
... and it really should use ~/.local/bin; there's precedent already in the behavior pip install --user, at least.
Reacted by Jan Niklas Hasse, Lee Jenkins, Daniel Brodie, Yohaï-Eliel Berreby, Alexandre Bury, Jonas Schievink, Victorien Elvinger, Sander Maijers, 依云, soc and 84 more
FWIW for people interested in trying to figure out this problem, Josh Triplett wrote a pretty good summary of the concerns here. It does not drill into the specifics of the various challenges; it talks about the non-obvious sources of the challenges, but it also alludes to current efforts to work on this. If people are interested in knowing more, I would suggest engaging with Josh in that thread.
AIUI even writing something up about "what has been tried already, what work needs to be done, what are good areas of research" requires a fair amount of work but it might be valuable for people in the know to do that and potentially list it in the header of this issue so that there is food for collaboration.
Since I'm gonna mark some more things as off-topic now, here's some information about how discussions/issues are supposed to be performed/used and how and why we're moderating things as we are:
issues are places for tracking the development of things. long discussions make them particularly unusable, partly because github linear threads are not very good for looking up information later, partly because you then end up with lots of text to go through to figure something out. We encourage most discussion to happen on zulip and internals and rarely posting on issues.
on top of that, meta discussions (moderation, prioritization, +1 comments), just hide the technical discussions and posts, which is why we mark them as off topic. They don't disappear, but they don't distract from the posts containing technical information.
as I stated before, we are aware of this issue and the importance to folk. There are people actively doing design work to avoid breaking even more people, which is higher priority than resolving annoyances (which can be really annoying, yes). There are people doing preliminary cleanup work and implementation work to experiment and test and give feedback to the design work. All of that is happening. Drowning those folk in discussions about them not being fast or good enough is not going to make them more motivated to solve this problem.
personal note: I really want this solved, so consider how frustrating it feels for mods to have to moderate folk (who make a good technical point that you agree with) because of their behavior.
if you have any concerns about moderation, it is not helpful to bring this up in the thread where it's not on topic and just results in more meta discussion. Bring it up to us in an email or DMs on zulip.
Reacted by Faïz Hernawan, Ygg01, Bennet Bleßmann, Robin Moussu, Lu, Wangshan, Jérôme, Utkarsh Gupta, Fabian, Daiki Mizukami, YOSHIOKA Takuma and 13 more
Reacted by Nemo157, Brian Ealdwine, Aapo Alasuutari and Ricardo Fernández Serrata
The biggest questions right now are around rustup. This will involve both understanding what rustup does and why, exploring options, and bouncing those options off of the two teams. I was planning to have that talk with them in-person at the All Hands in May
Reacted by oli, Alexej Kowalew, Ygg01, Esteban Kuber, Jiahao XU, QIngyao Lin, Jakub Beránek, James, Crystal Durham, Thomas Johansen and 4 more
Activity
0X1A commentedon Jun 25, 2015
Have been stumped by this as well. Looked for Cargo's config in
~/.config/cargoonly to find nothing. Don't really understand why Cargo places its config in~/.cargoand the environment variableCARGO_HOME, while nice is entirely useless. If the user'sXDGis not set then it would be fine to place in~/.cargo.Earnestly commentedon Jun 25, 2015
@0X1A If the respective
XDG_*variables are not set, they should fallbackto the appropriate defaults as defined by the specification. The unfortunate
legacy behaviour cargo needlessly introduced will likely just add the code
bloat.
Yamakaky commentedon Sep 6, 2015
Is someone working on this ? The more we wait, the more difficult it will be to change the default.
0X1A commentedon Sep 6, 2015
@Yamakaky AFAIK there isn't anything being done about it
whitequark commentedon Sep 21, 2015
You can use my xdg crate to implement this.
nagisa commentedon Dec 11, 2015
cargo install now installs into
~/.cargo/bin.whitequark commentedon Dec 11, 2015
... and it really should use
~/.local/bin; there's precedent already in the behaviorpip install --user, at least.Stebalien commentedon Jul 31, 2016
tbu- commentedon Jul 31, 2016
@Stebalien Waiting for rust-lang/rfcs#1615.
85 remaining items
ddevault commentedon Jan 21, 2025
soc commentedon Jan 21, 2025
utkarshgupta137 commentedon Jan 21, 2025
Manishearth commentedon Jan 21, 2025
FWIW for people interested in trying to figure out this problem, Josh Triplett wrote a pretty good summary of the concerns here. It does not drill into the specifics of the various challenges; it talks about the non-obvious sources of the challenges, but it also alludes to current efforts to work on this. If people are interested in knowing more, I would suggest engaging with Josh in that thread.
AIUI even writing something up about "what has been tried already, what work needs to be done, what are good areas of research" requires a fair amount of work but it might be valuable for people in the know to do that and potentially list it in the header of this issue so that there is food for collaboration.
Manishearth commentedon Jan 22, 2025
Ygg01 commentedon Jan 22, 2025
Ygg01 commentedon Jan 22, 2025
oli-obk commentedon Jan 22, 2025
Since I'm gonna mark some more things as off-topic now, here's some information about how discussions/issues are supposed to be performed/used and how and why we're moderating things as we are:
Ygg01 commentedon Jan 22, 2025
Question for mods, if someone wants to help with this issue, how can one help? I saw the https://internals.rust-lang.org/t/pre-rfc-split-cargo-home/19747/62 thread and assuming I'm assuming it's related.
What are steps new contributors can help with?
epage commentedon Jan 22, 2025
Less mods and more Cargo team.
The biggest questions right now are around rustup. This will involve both understanding what rustup does and why, exploring options, and bouncing those options off of the two teams. I was planning to have that talk with them in-person at the All Hands in May
.cargodirectory in the user's home directory #15669 as a duplicate of this issueepage commentedon Nov 21, 2025
A summary of the All Hands discussions is at https://blog.rust-lang.org/inside-rust/2025/10/01/this-development-cycle-in-cargo-1.90/#all-hands-xdg-paths which includes what the next steps are.