Skip to content

Ability to have per-workspace registry/git cache #9021

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

Open
devsnek opened this issue Dec 27, 2020 · 6 comments
Open

Ability to have per-workspace registry/git cache #9021

devsnek opened this issue Dec 27, 2020 · 6 comments
Labels
A-caching Area: caching of dependencies, repositories, and build artifacts C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage.

Comments

@devsnek
Copy link

devsnek commented Dec 27, 2020

Describe the problem you are trying to solve

An open source project I'm working on uses a number of tools for building the final artifacts. One of the many tools used is cargo. Cargo is the only tool among them which forces cached data to be stored in a single global location. Many of the contributors are not programmers, and we'd like to avoid cluttering their computers with files they don't even know about.

Describe the solution you'd like

Ideally, cargo could have an option to put all the relevant cached objects in target/.cargo or something like that. It is worth mentioning that this should not affect how configuration resolution works (this is why $CARGO_HOME is undesirable).

Notes

I'm happy to code this, just need the cargo gods to come to a decision on whether the feature is wanted in the first place.

@devsnek devsnek added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Dec 27, 2020
@devsnek devsnek changed the title Ability to have localized registry/git cache Ability to have per-target registry/git cache Dec 27, 2020
@devsnek devsnek changed the title Ability to have per-target registry/git cache Ability to have per-workspace registry/git cache Dec 27, 2020
@Eh2406
Copy link
Contributor

Eh2406 commented Dec 27, 2020

Would it make sense to use cargo vender for your use case?

@devsnek
Copy link
Author

devsnek commented Dec 27, 2020

@Eh2406 i don't think so. it would be undesirable to hold all those files in version control.

@joshtriplett
Copy link
Member

Would it suffice to have a separate environment variable to specify the cargo configuration file location? That way you could set CARGO_HOME without affecting configuration file resolution.

Another option: you could detect if the user already has a cargo directory, and only set CARGO_HOME if they don't.

@devsnek
Copy link
Author

devsnek commented Dec 28, 2020

Maybe a separate env variable to set the git/crates cache location?

@joshtriplett
Copy link
Member

@devsnek Well, hopefully one day those will go in XDG_CACHE_HOME, which you could set arbitrarily, but that's going to take a while.

@ehuss ehuss added the A-caching Area: caching of dependencies, repositories, and build artifacts label Jan 7, 2021
@jonhoo
Copy link
Contributor

jonhoo commented Feb 8, 2021

As a quick note, this seems very related to #6452.

@epage epage added the S-triage Status: This issue is waiting on initial triage. label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-caching Area: caching of dependencies, repositories, and build artifacts C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

No branches or pull requests

6 participants