-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
C-bugCategory: bugCategory: bugCommand-packageS-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.regression-from-stable-to-stableRegression in stable that worked in a previous stable release.Regression in stable that worked in a previous stable release.
Description
Problem
#13447 dd698ff has some unintentional consequences:
cargo package
after that generates a lockfile also when packaging libraries.
However, if the crate being packaged depends on some unpublished dependencies. When generating the lockfile Cargo then can't find unpublished deps on registry index, so it bailed out.
Steps
This could be simplly reproduced in rust-lang/cargo as of today (2025-01-13)
- Checkout to 54df3c7
- Bump cargo-test-support to an unpublished version such as
99.99.99
cargo +1.83.0 package -p cargo-test-support --no-verify
— succeededcargo +1.84.0 package -p cargo-test-support --no-verify
— failed
Possible Solution(s)
Assume if we have passed the local registry unconditionally, we shouldn't have the issue today.
cargo/src/cargo/ops/cargo_package/mod.rs
Lines 219 to 225 in f15df8f
let mut local_reg = if ws.gctx().cli_unstable().package_workspace { | |
let reg_dir = ws.target_dir().join("package").join("tmp-registry"); | |
sid.map(|sid| TmpRegistry::new(ws.gctx(), reg_dir, sid)) | |
.transpose()? | |
} else { | |
None | |
}; |
Version
cargo 1.84.0 (66221abde 2024-11-19)
cargo 1.86.0-nightly (088d49608 2025-01-10)
Metadata
Metadata
Assignees
Labels
C-bugCategory: bugCategory: bugCommand-packageS-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.regression-from-stable-to-stableRegression in stable that worked in a previous stable release.Regression in stable that worked in a previous stable release.