-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
and cargo package
incorrectly complain about .gitignored Cargo.lock in library
#7319
Comments
CC @Eh2406 since you suggested on Discord that I should file this as you had some ideas about which parts of the relevant code might have changed recently. |
I have this same issue with my repo: boxcars. This was a bug introduced in Cargo 1.37.0. I've downgraded to Cargo 1.36.0 successfully. Deleting a .gitignored |
This bug still exist in
|
@elichai the fix is in 1.40, can you try that? |
Yep, fixed. sorry :) |
Recently (at some point since mid-July; but I don't know the exact version when it started) in my two library repos Cargo has started failing when attempting to
cargo publish
, with the error:However, this is incorrect because:
Cargo.lock
should not be committed or published.Cargo.lock
is in.gitignore
.Cargo.lock
has never been checked in to Git.For confirmation:
cargo publish
fails in the same way/with the same error.As a workaround, deleting Cargo.lock entirely allows publishing (and of course since it's a library it can just be safely recreated afterwards).
The two repositories where I have observed this happening are https://github.com/felixc/rexiv2 and https://github.com/felixc/gexiv2-sys. I tried to reproduce it by creating a minimal empty repo but was not immediately able to, so I'm not sure what part of the repo configuration is leading to this. Some discussion on Discord suggested it might have to do with the runnable
examples/
targets leading to some mis-detection as a binary crate rather than a library one?Notes
The text was updated successfully, but these errors were encountered: