-
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
Failed to cargo package --allow-dirty
for repo with no commit
#14354
Comments
@rustbot claim |
Here are some possible solutions:
Any other solutions? Mind that this is a bit time-bound as it breaks the stable usage of Cargo. |
I lean towards this seems the least controversial starting point, especially if this is time bound.
While this is a stable-to-beta regression, I'm assuming the end-user impact is pretty minimal. I can't see it being terribly common (and most likely a mistake) to publish from an empty repo. |
Agree on least controversial and minimal impact parts. I'll go ahead and merge #14359. |
Fix: `cargo package` failed on bare commit git repo. ### What does this PR try to resolve? Fixes rust-lang#14354 This approach chose to not generate a `.cargo_vcs_info.json` for bare commit git repo. ### How should we test and review this PR? Compare the test changes before and after the two commits ### Additional information
…ublish` This is a workaround for a cargo bug (rust-lang/cargo#14354).
Problem
#13960 unconditionally checks VCS status when doing
cargo package
.However, a VCS (Git specifically) repository could have no commit history, and then it fails
cargo package
with such an error:Steps
cargo new foo
cargo package --allow-dirty
Possible Solution(s)
The current
.cargo_vcs_info.json
format looks like:If the
HEAD
hash cannot be determined, should we instead emit a JSON likeor just don't generate
.cargo_vcs_info.json
at all?Notes
No response
Version
The text was updated successfully, but these errors were encountered: