Skip to content

Conversation

@weihanglo
Copy link
Member

What does this PR try to resolve?

In #15514, Cargo starts direct-extraction from .crate
tarball in $CARGO_HOME/registry/cache when vendoring. This is fine with
remote registrires but not for local registries, as local registries'
tarball are stored along with index.

This fix abstracts cache_path to RegistryData trait, so every
registry source type can define its own locationa of tarball cache.

Note that for local-registry when accessing either index or cache, the
assumption is that file lock of the index and cache directory need to
be externally synchronized. Cargo doesn't take care of it.

Fixes #16412

How to test and review this PR?

@rustbot rustbot added A-local-registry-source Area: local registry sources (vendoring) A-registries Area: registries A-sparse-registry Area: http sparse registries S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 26, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 26, 2025

r? @ehuss

rustbot has assigned @ehuss.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

In rust-lang#15514, Cargo starts direct-extraction from `.crate`
tarball in `$CARGO_HOME/registry/cache` when vendoring. This is fine with
remote registrires but not for local registries, as local registries'
tarball are stored along with index.

This fix abstracts `cache_path` to `RegistryData` trait, so every
registry source type can define its own locationa of tarball cache.

Note that for local-registry when accessing either index or cache, the
assumption is that file lock of the index and cache directory need to
be externally synchronized. Cargo doesn't take care of it.
@epage epage added this pull request to the merge queue Dec 26, 2025
Merged via the queue into rust-lang:master with commit 94c368a Dec 26, 2025
29 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 26, 2025
bors added a commit to rust-lang/rust that referenced this pull request Dec 27, 2025
Update cargo submodule

17 commits in e91b2baa632c0c7e84216c91ecfe107c37d887c1..94c368ad2b9db0f0da5bdd8421cea13786ce4412
2025-12-13 16:29:21 +0000 to 2025-12-26 19:39:15 +0000
- fix(vendor): unpack from local-registry cache path (rust-lang/cargo#16435)
- feat(index): Stabilize pubtime (rust-lang/cargo#16372)
- Experiment: Render timing pipeline in SVG (rust-lang/cargo#15091)
- chore(triagebot): auto-label `Command-report` (rust-lang/cargo#16429)
- fix(sbom): Don't set CARGO_SBOM_PATH when empty (like stable)  (rust-lang/cargo#16419)
- chore(ci): report-timings to upload HTML report (rust-lang/cargo#16416)
- fix(report): get the same feature parity of `--timings` (rust-lang/cargo#16414)
- fix(docs): Document the only possible values for DEBUG in build scripts (rust-lang/cargo#16413)
- fix(log): emit fingeprint log also for no-rebuild unit (rust-lang/cargo#16408)
- Fix link to `doc_cfg` docs in cargo book (rust-lang/cargo#16404)
- Add best pratice for how to check in generated files (rust-lang/cargo#16405)
- test: Use a larger default term width (rust-lang/cargo#16403)
- Document more services and permissions of the cargo team (rust-lang/cargo#16402)
- fix(new): Improve quality of package name error messages (rust-lang/cargo#16398)
- feat(log): add more log events (rust-lang/cargo#16390)
- chore: bump to 0.95.0; update changelog (rust-lang/cargo#16395)
- Cache submodule into git db (rust-lang/cargo#16246)

r? ghost
@rustbot rustbot added this to the 1.94.0 milestone Dec 27, 2025
github-actions bot pushed a commit to rust-lang/compiler-builtins that referenced this pull request Dec 28, 2025
Update cargo submodule

17 commits in e91b2baa632c0c7e84216c91ecfe107c37d887c1..94c368ad2b9db0f0da5bdd8421cea13786ce4412
2025-12-13 16:29:21 +0000 to 2025-12-26 19:39:15 +0000
- fix(vendor): unpack from local-registry cache path (rust-lang/cargo#16435)
- feat(index): Stabilize pubtime (rust-lang/cargo#16372)
- Experiment: Render timing pipeline in SVG (rust-lang/cargo#15091)
- chore(triagebot): auto-label `Command-report` (rust-lang/cargo#16429)
- fix(sbom): Don't set CARGO_SBOM_PATH when empty (like stable)  (rust-lang/cargo#16419)
- chore(ci): report-timings to upload HTML report (rust-lang/cargo#16416)
- fix(report): get the same feature parity of `--timings` (rust-lang/cargo#16414)
- fix(docs): Document the only possible values for DEBUG in build scripts (rust-lang/cargo#16413)
- fix(log): emit fingeprint log also for no-rebuild unit (rust-lang/cargo#16408)
- Fix link to `doc_cfg` docs in cargo book (rust-lang/cargo#16404)
- Add best pratice for how to check in generated files (rust-lang/cargo#16405)
- test: Use a larger default term width (rust-lang/cargo#16403)
- Document more services and permissions of the cargo team (rust-lang/cargo#16402)
- fix(new): Improve quality of package name error messages (rust-lang/cargo#16398)
- feat(log): add more log events (rust-lang/cargo#16390)
- chore: bump to 0.95.0; update changelog (rust-lang/cargo#16395)
- Cache submodule into git db (rust-lang/cargo#16246)

r? ghost
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Dec 28, 2025
Update cargo submodule

17 commits in e91b2baa632c0c7e84216c91ecfe107c37d887c1..94c368ad2b9db0f0da5bdd8421cea13786ce4412
2025-12-13 16:29:21 +0000 to 2025-12-26 19:39:15 +0000
- fix(vendor): unpack from local-registry cache path (rust-lang/cargo#16435)
- feat(index): Stabilize pubtime (rust-lang/cargo#16372)
- Experiment: Render timing pipeline in SVG (rust-lang/cargo#15091)
- chore(triagebot): auto-label `Command-report` (rust-lang/cargo#16429)
- fix(sbom): Don't set CARGO_SBOM_PATH when empty (like stable)  (rust-lang/cargo#16419)
- chore(ci): report-timings to upload HTML report (rust-lang/cargo#16416)
- fix(report): get the same feature parity of `--timings` (rust-lang/cargo#16414)
- fix(docs): Document the only possible values for DEBUG in build scripts (rust-lang/cargo#16413)
- fix(log): emit fingeprint log also for no-rebuild unit (rust-lang/cargo#16408)
- Fix link to `doc_cfg` docs in cargo book (rust-lang/cargo#16404)
- Add best pratice for how to check in generated files (rust-lang/cargo#16405)
- test: Use a larger default term width (rust-lang/cargo#16403)
- Document more services and permissions of the cargo team (rust-lang/cargo#16402)
- fix(new): Improve quality of package name error messages (rust-lang/cargo#16398)
- feat(log): add more log events (rust-lang/cargo#16390)
- chore: bump to 0.95.0; update changelog (rust-lang/cargo#16395)
- Cache submodule into git db (rust-lang/cargo#16246)

r? ghost
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Dec 29, 2025
Update cargo submodule

17 commits in e91b2baa632c0c7e84216c91ecfe107c37d887c1..94c368ad2b9db0f0da5bdd8421cea13786ce4412
2025-12-13 16:29:21 +0000 to 2025-12-26 19:39:15 +0000
- fix(vendor): unpack from local-registry cache path (rust-lang/cargo#16435)
- feat(index): Stabilize pubtime (rust-lang/cargo#16372)
- Experiment: Render timing pipeline in SVG (rust-lang/cargo#15091)
- chore(triagebot): auto-label `Command-report` (rust-lang/cargo#16429)
- fix(sbom): Don't set CARGO_SBOM_PATH when empty (like stable)  (rust-lang/cargo#16419)
- chore(ci): report-timings to upload HTML report (rust-lang/cargo#16416)
- fix(report): get the same feature parity of `--timings` (rust-lang/cargo#16414)
- fix(docs): Document the only possible values for DEBUG in build scripts (rust-lang/cargo#16413)
- fix(log): emit fingeprint log also for no-rebuild unit (rust-lang/cargo#16408)
- Fix link to `doc_cfg` docs in cargo book (rust-lang/cargo#16404)
- Add best pratice for how to check in generated files (rust-lang/cargo#16405)
- test: Use a larger default term width (rust-lang/cargo#16403)
- Document more services and permissions of the cargo team (rust-lang/cargo#16402)
- fix(new): Improve quality of package name error messages (rust-lang/cargo#16398)
- feat(log): add more log events (rust-lang/cargo#16390)
- chore: bump to 0.95.0; update changelog (rust-lang/cargo#16395)
- Cache submodule into git db (rust-lang/cargo#16246)

r? ghost
Kobzol pushed a commit to Kobzol/rustc_codegen_cranelift that referenced this pull request Dec 29, 2025
Update cargo submodule

17 commits in e91b2baa632c0c7e84216c91ecfe107c37d887c1..94c368ad2b9db0f0da5bdd8421cea13786ce4412
2025-12-13 16:29:21 +0000 to 2025-12-26 19:39:15 +0000
- fix(vendor): unpack from local-registry cache path (rust-lang/cargo#16435)
- feat(index): Stabilize pubtime (rust-lang/cargo#16372)
- Experiment: Render timing pipeline in SVG (rust-lang/cargo#15091)
- chore(triagebot): auto-label `Command-report` (rust-lang/cargo#16429)
- fix(sbom): Don't set CARGO_SBOM_PATH when empty (like stable)  (rust-lang/cargo#16419)
- chore(ci): report-timings to upload HTML report (rust-lang/cargo#16416)
- fix(report): get the same feature parity of `--timings` (rust-lang/cargo#16414)
- fix(docs): Document the only possible values for DEBUG in build scripts (rust-lang/cargo#16413)
- fix(log): emit fingeprint log also for no-rebuild unit (rust-lang/cargo#16408)
- Fix link to `doc_cfg` docs in cargo book (rust-lang/cargo#16404)
- Add best pratice for how to check in generated files (rust-lang/cargo#16405)
- test: Use a larger default term width (rust-lang/cargo#16403)
- Document more services and permissions of the cargo team (rust-lang/cargo#16402)
- fix(new): Improve quality of package name error messages (rust-lang/cargo#16398)
- feat(log): add more log events (rust-lang/cargo#16390)
- chore: bump to 0.95.0; update changelog (rust-lang/cargo#16395)
- Cache submodule into git db (rust-lang/cargo#16246)

r? ghost
@weihanglo weihanglo deleted the issue-16412 branch December 29, 2025 21:22
github-actions bot pushed a commit to rust-lang/stdarch that referenced this pull request Jan 1, 2026
Update cargo submodule

17 commits in e91b2baa632c0c7e84216c91ecfe107c37d887c1..94c368ad2b9db0f0da5bdd8421cea13786ce4412
2025-12-13 16:29:21 +0000 to 2025-12-26 19:39:15 +0000
- fix(vendor): unpack from local-registry cache path (rust-lang/cargo#16435)
- feat(index): Stabilize pubtime (rust-lang/cargo#16372)
- Experiment: Render timing pipeline in SVG (rust-lang/cargo#15091)
- chore(triagebot): auto-label `Command-report` (rust-lang/cargo#16429)
- fix(sbom): Don't set CARGO_SBOM_PATH when empty (like stable)  (rust-lang/cargo#16419)
- chore(ci): report-timings to upload HTML report (rust-lang/cargo#16416)
- fix(report): get the same feature parity of `--timings` (rust-lang/cargo#16414)
- fix(docs): Document the only possible values for DEBUG in build scripts (rust-lang/cargo#16413)
- fix(log): emit fingeprint log also for no-rebuild unit (rust-lang/cargo#16408)
- Fix link to `doc_cfg` docs in cargo book (rust-lang/cargo#16404)
- Add best pratice for how to check in generated files (rust-lang/cargo#16405)
- test: Use a larger default term width (rust-lang/cargo#16403)
- Document more services and permissions of the cargo team (rust-lang/cargo#16402)
- fix(new): Improve quality of package name error messages (rust-lang/cargo#16398)
- feat(log): add more log events (rust-lang/cargo#16390)
- chore: bump to 0.95.0; update changelog (rust-lang/cargo#16395)
- Cache submodule into git db (rust-lang/cargo#16246)

r? ghost
github-actions bot pushed a commit to rust-lang/rust-analyzer that referenced this pull request Jan 8, 2026
Update cargo submodule

17 commits in e91b2baa632c0c7e84216c91ecfe107c37d887c1..94c368ad2b9db0f0da5bdd8421cea13786ce4412
2025-12-13 16:29:21 +0000 to 2025-12-26 19:39:15 +0000
- fix(vendor): unpack from local-registry cache path (rust-lang/cargo#16435)
- feat(index): Stabilize pubtime (rust-lang/cargo#16372)
- Experiment: Render timing pipeline in SVG (rust-lang/cargo#15091)
- chore(triagebot): auto-label `Command-report` (rust-lang/cargo#16429)
- fix(sbom): Don't set CARGO_SBOM_PATH when empty (like stable)  (rust-lang/cargo#16419)
- chore(ci): report-timings to upload HTML report (rust-lang/cargo#16416)
- fix(report): get the same feature parity of `--timings` (rust-lang/cargo#16414)
- fix(docs): Document the only possible values for DEBUG in build scripts (rust-lang/cargo#16413)
- fix(log): emit fingeprint log also for no-rebuild unit (rust-lang/cargo#16408)
- Fix link to `doc_cfg` docs in cargo book (rust-lang/cargo#16404)
- Add best pratice for how to check in generated files (rust-lang/cargo#16405)
- test: Use a larger default term width (rust-lang/cargo#16403)
- Document more services and permissions of the cargo team (rust-lang/cargo#16402)
- fix(new): Improve quality of package name error messages (rust-lang/cargo#16398)
- feat(log): add more log events (rust-lang/cargo#16390)
- chore: bump to 0.95.0; update changelog (rust-lang/cargo#16395)
- Cache submodule into git db (rust-lang/cargo#16246)

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

Labels

A-local-registry-source Area: local registry sources (vendoring) A-registries Area: registries A-sparse-registry Area: http sparse registries Command-vendor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cargo vendor --respect-source-config failed with local registry source since 1.89

4 participants