-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 OS-native config, cache home directories #1734
Comments
Have been stumped by this as well. Looked for Cargo's config in |
@0X1A If the respective |
Is someone working on this ? The more we wait, the more difficult it will be to change the default. |
@Yamakaky AFAIK there isn't anything being done about it |
You can use my xdg crate to implement this. |
http://standards.freedesktop.org/basedir-spec/basedir-spec-0.8.html http://www.freedesktop.org/software/systemd/man/file-hierarchy.html Strategy for backward-compatiblity: When checking for the relevant cargo directories, check in the following order of preference: 1) Use the environment variable `CARGO_HOME`. 2) Use the XDG directories if they exist. 3) Use the legacy location (~/.cargo) if it exists. 4) Fall back the XDG directories if everything else fails. Fixes rust-lang#1734.
cargo install now installs into |
... and it really should use |
Strategy for backward-compatiblity: When checking for the relevant Cargo directories, check in the following order of preference: 1) Use the environment variable `CARGO_HOME`. 2) Use the platform-specific directories if they exist. 3) Use the legacy location (~/.cargo) if it exists. 4) Fall back to the platform-specific directories if everything else fails. The new platform-specific directories are as follows: On Windows, use `AppData\Local\Temp\Cargo` for cache files (obtained via `GetTempPath`), `AppData\Roaming\Cargo` for the config files (`FOLDERID_RoamingAppData`) and `AppData\Local\Programs\Cargo` for installed binaries (`FOLDERID_UserProgramFiles`). On Unixy systems, use the XDG spec: `~/.cache/cargo` for cache files, `~/.config/cargo` for config, `~/.local/bin` for installed binaries. http://standards.freedesktop.org/basedir-spec/basedir-spec-0.8.html http://www.freedesktop.org/software/systemd/man/file-hierarchy.html On OS X, use `~/Library/Caches/Cargo` for cache files, `~/Library/Cargo` for config files and `~/Library/Cargo/bin` for binary files. Fixes rust-lang#1734. Fixes rust-lang#1976.
@tbu- any progress? |
@Stebalien Waiting for rust-lang/rfcs#1615. |
It's the only thing I missed in rust ecosystem! Or to separate the patch into three platform so that it will be available on partial inclusion. |
I'll rebase the patch or the partial patch if this gets accepted. This won't be the problem. |
I don’t know where this came from, but on Linux I apparently have both
|
@sanmai-NL Where does your |
I have no idea, probably just some leftover from messing around when there was no Arch Linux package for Cargo yet. Note that my |
Another issue with not respecting XDG: backups. My current backup profiles knows that it should avoid |
I'm unlocking this and hiding the most of the recent posts. I would ask that people be respectful to others and that includes not assigning intent to others I think a general assumption we can make is that we all want what is best for the users of cargo. A summary of the conversation from some of the hidden posts:
|
I think, that I know a hacky solution for locating build directory (
alias cargo = 'CARGO_TARGET_DIR=$XDG_CACHE_DIR/rust-builds/$(cargo metadata --no-deps --offline | extract_name_magic) cargo' Where By using this alias, you'll get all the cargo commands working as expected with separate XDG-compliant build directories for each project. Tomorrow I'll implement |
FYI this is about everything in the home directory today. There is a separate issue (and an open RFC!) about centralizing target dirs. On mobile or I'd get you the linksd |
See rust-lang/rfcs#3371 and #11156 (if I got it correctly). |
I believe this was from the Pre RFC thread https://internals.rust-lang.org/t/pre-rfc-split-cargo-home/19747/26 |
FWIW |
I would at absolute minimum like to see ability to use I keep |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
If anyone wants to help, the already-mentioned pre-RFC is the first step toward a solution, though it is still under discussion and hasn't reached a consensus yet. The original author of that post (epage) doesn't seem to have time to work on it, so it probably needs some other folks to take care of it. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
To make it more discoverable, I've added a link to my Pre-RFC to the issue. I've also updated the Pre-RFC Motivation section with additional constraints XDG support is operating under that make this non-trivial. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Moderator note: It's ok to be angry and frustrated. So are the maintainers at the sheer number of things that need doing and fixing and that they don't get to. Priorities and maintainers change, things fall under the bus. That's life. It's not as easy as just deciding to fix this issue, even if it may seems so from the outside. Please stay on topic, this meta discussion serves no point other than venting, use your private spaces for that. I'm aware a multi hundred comment issue with a linked RFC with lots of comments is not enjoyable to read to get the full picture. So a contribution that needs no rust knowledge would be to write a summary of the RFC discussion and open discussion items on the RFC. |
@epage Thank you for commenting. I see how meta discussions like this don't necessarily contribute to solve this, I would much rather have a private word with you. My intention is not to be rough, hurt or harm you and most of all I really don't want to be create trouble. English is not my native language. It's also not my culture. I'm German, and we have our reputation for a reason (the one about rudeness, the other one even more so). My intention is not to be rude, but to be understood. Look at it from my side. You're stepping on my toes. I don't believe you do that to hurt or annoy me, but it hurts, even if only a little. Every time I come here commenting, it's because I spend between 10-30m of - as I see it - clean up after you. I think it would actually be better if you would close this issue refusing to implement it. That would not prevent you from eventually doing something about it. It would not provoke me or others to try to accelerate the process. But keeping a ticket open for 10 years is really offensive. Not to you, but to me and people like me. @oli-obk You make a good point. I feel a bit guilty making myself part of the problem. At the same time, I think this particular issue is a special case, because of it's age. I feel strongly about ethics. This is a complicated case, because I'm not a paying customer, you have no obligations to me in regard of what you do in this project. For the most part. But you are not completely free from responsibility to people whom your decisions impact. The extreme example would be if you added virus to your product. You don't, but you could and if you did, that would be trouble. This case is a grey area, where you clearly have no malicious intend, but you create an impact that is felt by some as damaging. I keep having to spend time to clean up after you, even though I'm not even directly using your software. If I interpret epage correctly, he saw that argument as a valid point or at least one deserving of some consideration. If it's a valid point, it deserves a consequence, and "be patient" on a ticket that's up for 10 years is not really something that makes me feel any better while I'm cleaning up. We all live in an era that is defined by divisions and unnecessary conflicts. I am old enough to remember a time when there was a whole lot more of respect and cooperation. Even at that time, people were rough. But that didn't necessarily mean disrespect, Sometimes people are angry for a reason and it's not always the only option to call "language", sometimes considering a dissonant contribution might be valuable. I miss the time when controversy triggered a desire to start a discussion and work towards a common understanding. If we can only talk if we first agree, what's the purpose of talking? I reread this post before sending. Nothing I wrote here is intended to inflame conflict or even be rough. I actually respect you. I am just plainly writing exactly what I'm thinking. If this is rough, then I should better be banned from github, because I just can't be smoother than this without pretending to be something I'm not. |
Maintainer's notes:
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
forSHGetKnownFolderPath
,CSIDL_LOCAL_APPDATA
forSHGetFolderPath
, and%LOCALAPPDATA%
in the environment.The text was updated successfully, but these errors were encountered: