-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 publish --locked doesn't use the lock file #15264
Comments
#14815 changed it so Going to go ahead and close this. If there is a reason we should re-evaluate, let us know! |
I want to publish my crate using the versions in the lock file. Isn't that what https://doc.rust-lang.org/cargo/commands/cargo-publish.html states it's trying to do? |
Could you provide a reproducible example of what went wrong? Using |
Well if you specify you want version 1.1.2 of a crate in your cargo.lock file but 1.1.3 is available, cargo build will pull version 1.1.2. But cargo publish --locked will pull version 1.1.3. I think the intention of --locked is to pull the version in the lock file, in this instance, version 1.1.2 |
I noticed you're using 1.81. With Rust 1.84+ Cargo should respect your lockfile, as Ed has mentioned earlier. Hence it is kinda fixed. Here is the minimal reproducible steps: # Using Rust toolchain 1.84+
cargo new foo --lib
cd foo
cargo add serde@1
cargo update serde --precise 1.0.100
grep 1.0.100 Cargo.lock
cargo publish --locked --allow-dirty --dry-run
grep 1.0.100 target/package/foo-0.1.0/Cargo.lock
# expected to find `version = "1.0.100"` |
Problem
The "--locked" parameter for cargo publish doesn't seem to work. It still just pulls the latest versions of packages, seemingly ignoring the cargo.lock file
Steps
Possible Solution(s)
No response
Notes
No response
Version
The text was updated successfully, but these errors were encountered: