-
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
Tracking Issue for update --precise
with pre-release
#13290
Comments
Tracking Issue: [rust-lang#13290](rust-lang/rust#13290) This change introduces the feature but does not yet attempt an implementation. The actual implementation will happen in future PRs r? @epage
update --precise
with pre-release
I believe @eopb was planning on working on this. I'd recommend coordinating with them |
Thanks Ed. Yes, I'm still intending to work on this. If you'd like to help @linyihai, please reach out to me on zulip (under the same username as here). I'm sure we can work together. The last thing I'd want to do is to slow things down by trying to hog this tracking issue. |
I'm sorry that I started the claim without further understanding of the requirement. You're the one who came up with this RFC, so I'm sure you know more details than I do. If you think it's better to do it yourself, that's fine. If you need help, break it down into smaller issues so that others see it and can help @eopb
I'll be in touch if I need anything. Thank you @eopb |
FYI,I recently tried to implement an MVP based on RFC content. |
Allow precise update to prerelease. ### What does this PR try to resolve? This is a feature that attempts to support updates to pre-release versions via `cargo update --precise`. when `precise-pre-release` used, the prerelase version will be taking consider as compatible version. That said, we can update to any compatible pre-release version. The logic of checking the compatibility of pre-release versions is currently tentative and does not take many conditions into account, this part of the logic makes more sense when implemented in semver. Use `-Zunstable-options` instead of `-Zprecise-pre-release`. ### How should we test and review this PR? ### Additional information Part of #13290
#14013 shows the current implementation is a bit buggy, and there are upper bound semantic issues not yet resolved. See these test cases: cargo/src/cargo/util/semver_ext.rs Lines 204 to 233 in 050f88c
It is technically possible to fix them inside cargo. However to do that we'll need to duplicate the logic in |
Yes, The
So we need to add the pre tag to the
|
After some experiments on
By look into the |
feat: Add matches_prerelease semantic ### What does this PR try to resolve? One implementaion for #13290 Thanks to `@Eh2406` feedback, a working version came out, and I think it should be able to test under the nightly feature. This PR proposes a `matches_prerelease semantic`. | req | matches | matches_prerelease | matches_prerelease_mirror_node [<sub>2<sub>](#mirror-node) | |------------------|---------------------|------------------------| ----------------------------------| | `Op::Exact` | | | | | =I.J.K | =I.J.K | >=I.J.K, <I.J.(K+1)-0 | >=I.J.K, <I.J.(K+1)-0 | | =I.J | >=I.J.0, <I.(J+1).0 | >=I.J.0, <I.(J+1).0-0 | >=I.J.0-0, <I.(J+1).0-0 | | =I | >=I.0.0, <(I+1).0.0 | >=I.0.0, <(I+1).0.0-0 | >=I.0.0-0, <(I+1).0.0-0 | | `Op::Greater` | | | | | >I.J.K | >I.J.K | >I.J.K | >I.J.K | | >I.J | >=I.(J+1).0 | >=I.(J+1).0-0 | >=I.(J+1).0-0 | | >I | >=(I+1).0.0 | >=(I+1).0.0-0 | >=(I+1).0.0-0 | | `Op::GreaterEq` | | | | | >=I.J.K | >=I.J.K | >=I.J.K | >=I.J.K | | >=I.J | >=I.J.0 | >=I.J.0 | >=I.J.0-0 | | >=I | >=I.0.0 | >=I.0.0 | >=I.0.0-0 | | `Op::Less` | | | | | <I.J.K | <I.J.K | <I.J.K or I.J.K-0 depends [<sub>1<sub>](#op-less) | <I.J.K | | <I.J | <I.J.0 | <I.J.0-0 | <I.J.0-0 | | <I | <I.0.0 | <I.0.0-0 | <I.0.0-0 | | `Op::LessEq` | | | | | <=I.J.K | <=I.J.K | <=I.J.K | <=I.J.K | | <=I.J | <I.(J+1).0 | <I.(J+1).0-0 | <I.(J+1).0-0 | | <=I | <(I+1).0.0 | <(I+1).0.0-0 | <(I+1).0.0-0 | | `Op::Tilde` | | | | | ~I.J.K | >=I.J.K, <I.(J+1).0 | >=I.J.K, <I.(J+1).0-0 | >=I.J.K, <I.(J+1).0-0 | | ~I.J | =I.J | >=I.J.0, <I.(J+1).0-0 | >=I.J.0, <I.(J+1).0-0 | | ~I | =I | >=I.0.0, <(I+1).0.0-0 | >=I.0.0, <(I+1).0.0-0 | | `Op::Caret` | | | | | ^I.J.K (for I>0) | >=I.J.K, <(I+1).0.0 | >=I.J.K, <(I+1).0.0-0 | >=I.J.K, <(I+1).0.0-0 | | ^0.J.K (for J>0) | >=0.J.K, <0.(J+1).0 | >=0.J.K, <0.(J+1).0-0 | >=0.J.K-0, <0.(J+1).0-0 | | ^0.0.K | =0.0.K | >=0.0.K, <0.0.(K+1)-0 | >=0.J.K-0, <0.(J+1).0-0 | | ^I.J | ^I.J.0 | >=I.J.0, <(I+1).0.0-0 | >=I.J.0-0, <(I+1).0.0-0 | | ^0.0 | =0.0 | >=0.0.0, <0.1.0-0 | >=0.0.0-0, <0.1.0-0 | | ^I | =I | >=I.0.0, <(I+1).0.0-0 | >=I.0.0-0, <(I+1).0.0-0 | | `Op::Wildcard` | | | | | `I.J.*` | =I.J | >=I.J.0, <I.(J+1).0-0 | >=I.J.0-0, <I.(J+1).0-0 | | `I.*` or `I.*.*` | =I | >=I.0.0, <(I+1).0.0-0 | >=I.0.0-0, <(I+1).0.0-0 | Notes: <div id="op-less"></div> - `<I.J.K`: This is equivalent to `<I.J.K-0` if no lower bound or the lower bound isn't pre-release, otherwise this is equivalent to `<I.J.K`. <div id="mirror-node"></div> - [matches_prerelease_mirror_node](dtolnay/semver@3464fd1) is yet another implementation of [node semver compatibility](https://github.com/npm/node-semver?tab=readme-ov-file#semver1----the-semantic-versioner-for-npm) (with [includePrerelease=true](https://github.com/npm/node-semver?tab=readme-ov-file#functions)) test. This is extrapolated from the test cases and is not necessarily the same as the node implementation Besides, the proposed semtantic left a [unsolved issuse ](dtolnay/semver#321 (comment)), I don't have clear idea to handle it. ### How should we test and review this PR? The tests in `src/cargo/util/semver_eval_ext.rs` are designed to reflect current semantic. ### Additional information Migrated from dtolnay/semver#321 TBO, this feature was not conceived in advance plus the semantic is unclear at first. I need to experiment step by step and find out what I think makes sense. My experiment can be seen this [comment](#13290 (comment)).
Summary
RFC: #3493
Original issue: #12579
Implementation: #13626
Documentation: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#precise-pre-release
Extends
cargo update --precise
to allow pre-release versions, even if the dependency declarations do not specify a pre-release.Unresolved Issues
semver
crateFuture Extensions
No response
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
The text was updated successfully, but these errors were encountered: