Skip to content

Conversation

cdmistman
Copy link
Contributor

Why

this has been bothering me, and i just ran into a scenario where cloning a repo resulted in ~13k untracked files in git

we can't fix that with gitignore since a project's .cargo directory may also be checked into git by convention (primarily for project-local configuration, but there's other reasons to do so)

What changed

moved the CARGO_HOME env var from $REPL_HOME/.cargo to $XDG_DATA_HOME/cargo

Test plan

before:

  1. clone https://github.com/tamasfe/taplo in replit
  2. notice several thousand untracked files

after:

  1. clone the same repo into a new repl
  2. notice no untracked files
  3. stat .local/share/cargo/registry has exit code 0

Rollout

Describe any procedures or requirements needed to roll this out safely (or check the box below)

  • This is fully backward and forward compatible

@cdmistman cdmistman requested a review from a team as a code owner August 29, 2024 21:33
@cdmistman cdmistman requested review from ryantm and removed request for a team August 29, 2024 21:33
@cdmistman
Copy link
Contributor Author

this will have the unfortunate side-effect of rust repls having increased disk usage, but the solution is simple enough (rm -rdf $REPL_HOME/.cargo) that idt it's an issue

@cdmistman cdmistman merged commit 9de0c76 into main Aug 30, 2024
@cdmistman cdmistman deleted the cad/cargo-home-in-xdg-data-home branch August 30, 2024 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants