Skip to content
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

Cargo updates registry index on every command #13712

Open
Mark-Simulacrum opened this issue Apr 5, 2024 · 0 comments
Open

Cargo updates registry index on every command #13712

Mark-Simulacrum opened this issue Apr 5, 2024 · 0 comments
Labels
A-caching Area: caching of dependencies, repositories, and build artifacts C-bug Category: bug S-needs-team-input Status: Needs input from team on whether/how to proceed.

Comments

@Mark-Simulacrum
Copy link
Member

For a while now I've seen "Updating crates.io index" before every build in the rust-lang/rust repository on one of my computers. I got a chance to investigate today and it looks like that's because of this error:

$ CARGO_LOG=info ./x.py build --stage 0 library/std
Building bootstrap
    Finished `dev` profile [unoptimized] target(s) in 0.03s
Building stage0 library artifacts {std} (x86_64-unknown-linux-gnu)
    Updating crates.io index
   0.424170519s  INFO main:exec:compile_ws:create_bcx:resolve_with_registry:resolve_with_previous:resolve: cargo::sources::registry::index::cache: failed to write cache: Permission denied (os error 13) cache_path="/home/mark/.cargo/registry/index/index.crates.io-6f17d22bba15001f/.cache/r-/ef/r-efi"
    Finished `release` profile [optimized + debuginfo] target(s) in 0.67s

That error is because a bunch of the files in the cache directory ended up owned by root rather than my user, probably as a result of a docker build of test-various (see lockfile which contains this crate).

I'm filing this because it seems like we ought to:

  • Not silently ignore this error if it's going to cause us to "Updating..." every build
  • Potentially delete/prune the cache (not sure if possible) rather than failing in this way

In my case r-/ef/r-efi where all owned by root.

@epage epage added A-caching Area: caching of dependencies, repositories, and build artifacts S-needs-team-input Status: Needs input from team on whether/how to proceed. C-bug Category: bug labels Apr 5, 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-bug Category: bug S-needs-team-input Status: Needs input from team on whether/how to proceed.
Projects
None yet
Development

No branches or pull requests

2 participants