Skip to content

Use OS-native config, cache home directories #1734

Open

Description

@Earnestly

View all comments

Maintainer's notes:

  • A Pre-RFC has been started that splits out the first half of t his work (making the paths configurable) to have a smaller, more focused conversation

Related issues:


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.

Activity

  1. 0X1A commented on Jun 25, 2015

    @0X1A

    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.

  2. Earnestly commented on Jun 25, 2015

    @Earnestly
    Author

    @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.

  3. Yamakaky commented on Sep 6, 2015

    @Yamakaky

    Is someone working on this ? The more we wait, the more difficult it will be to change the default.

  4. 0X1A commented on Sep 6, 2015

    @0X1A

    @Yamakaky AFAIK there isn't anything being done about it

  5. whitequark commented on Sep 21, 2015

    @whitequark
    Contributor

    You can use my xdg crate to implement this.

  6. nagisa commented on Dec 11, 2015

    @nagisa
    Member

    cargo install now installs into ~/.cargo/bin.

  7. whitequark commented on Dec 11, 2015

    @whitequark
    Contributor

    ... and it really should use ~/.local/bin; there's precedent already in the behavior pip install --user, at least.

  8. Stebalien commented on Jul 31, 2016

    @Stebalien
  9. tbu- commented on Jul 31, 2016

    @tbu-
    Contributor
  10. 85 remaining items

  11. ddevault commented on Jan 21, 2025

    @ddevault
  12. soc commented on Jan 21, 2025

    @soc
  13. utkarshgupta137 commented on Jan 21, 2025

    @utkarshgupta137
  14. Manishearth commented on Jan 21, 2025

    @Manishearth
    Member

    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.

  15. Manishearth commented on Jan 22, 2025

    @Manishearth
  16. Ygg01 commented on Jan 22, 2025

    @Ygg01
  17. Ygg01 commented on Jan 22, 2025

    @Ygg01
  18. oli-obk commented on Jan 22, 2025

    @oli-obk
    Contributor

    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.
  19. Ygg01 commented on Jan 22, 2025

    @Ygg01

    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?

  20. epage commented on Jan 22, 2025

    @epage
    Contributor

    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

  21. added
    S-needs-mentorStatus: Issue or feature is accepted, but needs a team member to commit to helping and reviewing.
    and removed
    S-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
    on Nov 21, 2025
  22. epage commented on Nov 21, 2025

    @epage
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-configurationArea: cargo config files and env varsC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`E-hardExperience: HardS-needs-mentorStatus: Issue or feature is accepted, but needs a team member to commit to helping and reviewing.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions