-
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
Explain how version
works for git
dependencies
#12270
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @epage (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. Just wonder if Multiple locations section has already covered this, no?
@weihanglo It actually does make things a lot clearer; I'll take another look and revise my suggestion. I didn't actually look at that section before because I didn't realize that the |
@weihanglo Sorry for not getting back to this sooner. How does it look now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
path
dependencies also have the exact behavior. Is it possible to merge this into the notice below, and update for both path
and git
dependencies to share the similar text?
cargo/src/doc/src/reference/specifying-dependencies.md
Lines 168 to 170 in 5b377ce
> **Note**: [crates.io] does not allow packages to be published with `git` | |
> dependencies (`git` [dev-dependencies] are ignored). See the [Multiple | |
> locations](#multiple-locations) section for a fallback alternative. |
So maybe something like:
> **Note**: A dependency can have both a `git` and `version` keys, these are
> considered separate locations for resolving the dependency, as [crates.io]
> does not allow packages to be published with `git` dependencies (`git`
> [dev-dependencies] are ignored). See the [Multiple locations](#multiple-locations)
> section for a fallback alternative.
What do you think?
(I tried to make it concise but I believe you could do this better that me)
@rustbot author |
let me take over the review r? @weihanglo |
I think the note about I've made some more extensive changes to reflect that; please let me know what you think. (The introduction of the "requirements syntax" header, and demoting of the different version-requirement syntax headers to go under that header, is technically unrelated, so let me know if I need to undo that change.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Thanks!
@bors r+ |
Explain how `version` works for `git` dependencies
Hmm… I guess bors was stuck, so it was never merged successfully. @BatmanAoD, could you reopen so that we can merge it again? |
@weihanglo Oops, for some reason I thought it was safe to delete the branch. Restored and re-opened. |
No worries! @bors r+ |
💡 This pull request was already approved, no need to approve it again.
|
☀️ Test successful - checks-actions |
Update cargo 18 commits in 925280f028db3a322935e040719a0754703947cf..96fe1c9e1aecd8f57063e3753969bb6418fd2fd5 2023-08-25 21:16:44 +0000 to 2023-08-29 20:10:34 +0000 - fix(lints): Fail when overriding inherited lints (rust-lang/cargo#12584) - cargo install: suggest --git when package name is url (rust-lang/cargo#12575) - chore: remove unstable-options for logout (rust-lang/cargo#12588) - Improve logout message for asymmetric tokens (rust-lang/cargo#12587) - fix(update): Remove references to -p in help (rust-lang/cargo#12586) - fix(update): Make `-p` more convenient by being positional (rust-lang/cargo#12545) - Set tracing target for networking messages. (rust-lang/cargo#12582) - Retry docs (rust-lang/cargo#12583) - feat(resolver): **Very** preliminary MSRV resolver support (rust-lang/cargo#12560) - Update git2 (rust-lang/cargo#12580) - Explain how `version` works for `git` dependencies (rust-lang/cargo#12270) - Improve deserialization errors of untagged enums (rust-lang/cargo#12574) - Add support for `target.'cfg(..)'.linker` (rust-lang/cargo#12535) - Improve resolver version mismatch warning (rust-lang/cargo#12573) - Stabilize `--keep-going` (rust-lang/cargo#12568) - Define {{command}} for use in src/doc/man/includes (rust-lang/cargo#12570) - Update serde (rust-lang/cargo#12569) - chore: add missing `windows-sys` features back (rust-lang/cargo#12563) r? ghost
What does this PR try to resolve?
Explains how
version
works forgit
dependencies. This confused me, and I couldn't find any mention of it e.g. on the user forums.How should we test and review this PR?
Documentation-only change