Error when packaging with git dependencies without version#9612
Merged
Conversation
If `cargo package` is run on a package that specifies a git dependency without a version, cargo will error. This should help with clarifying that git dependencies will be stripped when packaging, and that the dependency has to be fetched from a registry.
|
r? @Eh2406 (rust-highfive has picked a reviewer for you, use r? to override) |
Contributor
Author
|
Essentially what I've done is perform the same checks that are performed when publishing, when packaging (as seen here). This wont fix all of the potential confusion arising from the dependency stripping when publishing/packaging, but hopefully it catches a few more. |
Member
|
@bors: r+ Looks reasonable to me, thanks! |
Contributor
|
📌 Commit 4e1910d has been approved by |
Contributor
Contributor
|
☀️ Test successful - checks-actions |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 1, 2021
Update cargo 9 commits in 9233aa06c801801cff75df65df718d70905a235e..4952979031e2cf1d901c817a32e25a156a19db4c 2021-06-22 21:32:55 +0000 to 2021-07-01 01:14:50 +0000 - Fix `BorrowMutError` when calling `cargo doc --open` (rust-lang/cargo#9531) - Exclude `target` from content-indexing on Windows (rust-lang/cargo#9635) - Temporarily ignore 2021 edition fix. (rust-lang/cargo#9642) - Temporarily disable future_incompat tests. (rust-lang/cargo#9638) - Include toolchain specification in error message (rust-lang/cargo#9625) - Error when packaging with git dependencies without version (rust-lang/cargo#9612) - simply 'if' block (rust-lang/cargo#9615) - tidy some closures and iterators (rust-lang/cargo#9614) - use 'writeln' instead of appending newline character (rust-lang/cargo#9620)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If
cargo packageis run on a package that specifies a git dependencywithout a version, cargo will error. This should help with clarifying
that git dependencies will be stripped when packaging, and that the
dependency has to be fetched from a registry.
Closes #9442