-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Failed to cargo package --allow-dirty
for repo with no commit
#14354
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
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).
And even though the respective test is succeeding, I still seem to be able to reproduce (something like?) it:
And the same is happening with a more recent version of
I noticed this while researching for #15534, and I am wondering why the respective test succeeds. |
I can't reproduce it on either latest nightly, beta, or 1.87.0 stable. Unless the
|
Ah, right, I have set my default branch to |
With the current version there are results immediately and it takes a little less than 12m to compile everything. The greatest expense seems to be the fetching of latest packages now.
|
Yeah duplicate index update is definitely a thing we could avoid (in a separate PR though). BTW we're commenting on the wrong issue 😆 |
Uh oh!
There was an error while loading. Please reload this page.
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: