$CARGO_HOME/.cargo/config.toml does not respect XDG specifications #13928
Labels
A-caching
Area: caching of dependencies, repositories, and build artifacts
A-configuration
Area: cargo config files and env vars
C-bug
Category: bug
S-triage
Status: This issue is waiting on initial triage.
Problem
Title.
Cargo should not clutter my home directory. Data should go into $XDG_STATE_HOME and config files should be (read-only!) from $XDG_CONFIG_HOME
Steps
Possible Solution(s)
Solution: changing the default paths and adding another path to this priority queue
I'd suggest we insert the XDG compliant paths above the current $CARGO_HOME/config.toml
The more difficult part about this is probably splitting the CARGO_HOME into 2 different paths.
There's 2 rust libraries implementing the XDG specifications:
directories-rs (cross-platform)
rust-xdg (linux-only)
This would not be a breaking change as you can still use the old location if there's already data there.
I assume this should only require changing a few paths. I could PR this myself if someone could pinpoint me to the code where the configs are read. I already did a repo-wide search but couldn't find anything referencing the path.
Notes
Read the full XDG specifications here:
https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
This would also resolve #11267
Version
The text was updated successfully, but these errors were encountered: