-
-
Notifications
You must be signed in to change notification settings - Fork 430
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
fix(aqua): apply override of version_prefix #4338
Merged
Merged
Conversation
This file contains 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
With #4340 merged, However,
|
risu729
commented
Feb 8, 2025
jdx
pushed a commit
that referenced
this pull request
Feb 8, 2025
While I was debugging for #4338, I found that the `versions` crate comparison logic was weird. It treated versions without prefixes larger than versions with prefixes. As documented in the code, it should be an expected behaviour, but since many GitHub release tags contain prefixes, we should somehow trim them before comparing versions. > `nth_lenient` pulls a leading digit from the `Version`'s chunk if it could. If it couldn't, that chunk is some string (perhaps a git hash) and is considered as marking a beta/prerelease version. It is thus considered less than the `SemVer`. https://github.com/fosskers/rs-versions/blob/efb1b0d16418b17a774e3e5572815367bc813bcd/src/semver.rs#L124-L130 However, we need to parse `version_constraint` to get `version_prefix` from `version_overrides`, so we cannot refer to the aqua registry to determine the prefix of tags. This PR simply trims prefix-ish letters (non-digit characters) from the version before comparison. It only trims the prefix in `semver` function in `expr-lang`, so the effect should be small. Example of `versions` behaviour: ```rust use versions::{Requirement, Versioning}; fn main() { let v = "test-0.2.0"; let req = Requirement::new("<=0.1.0").unwrap(); let ver = Versioning::new(v.strip_prefix('v').unwrap_or(v)).unwrap(); println!("{:?}", req); println!("{:?}", ver); println!("{:?}", req.matches(&ver)); } ``` ``` Requirement { op: LessEq, version: Some(Ideal(SemVer { major: 0, minor: 1, patch: 0, pre_rel: None, meta: None })) } General(Version { epoch: None, chunks: Chunks([Alphanum("test")]), release: Some(Release([Numeric(0), Numeric(2), Numeric(0)])), meta: None }) true ``` --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
jdx
pushed a commit
that referenced
this pull request
Feb 14, 2025
### 🚀 Features - **(registry)** add e1s by [@kiwamizamurai](https://github.com/kiwamizamurai) in [#4363](#4363) - **(registry)** add 'marksman' via 'aqua:artempyanykh/marksman' backend by [@iamoeg](https://github.com/iamoeg) in [#4357](#4357) - use `machengine.org` for downloading nominated zig versions by [@hadronomy](https://github.com/hadronomy) in [#4356](#4356) ### 🐛 Bug Fixes - **(aqua)** apply override of version_prefix by [@risu729](https://github.com/risu729) in [#4338](#4338) - **(env_directive)** apply redactions only to env with redact by [@risu729](https://github.com/risu729) in [#4388](#4388) - **(hook_env)** don't exit early if watching files are deleted by [@risu729](https://github.com/risu729) in [#4390](#4390) - **(rubygems_plugin)** Replace which ruby check for Windows compatibility by [@genskyff](https://github.com/genskyff) in [#4358](#4358) - lowercase desired shim names by [@KevSlashNull](https://github.com/KevSlashNull) in [#4333](#4333) - allow cosign opts to be empty in aqua by [@IxDay](https://github.com/IxDay) in [#4396](#4396) ### 📚 Documentation - update Fedora install for dnf5 by [@rkben](https://github.com/rkben) in [#4387](#4387) - fix links to idiomatic version file option by [@pietrodn](https://github.com/pietrodn) in [#4382](#4382) - add mise bootstrap example in CI docs by [@hverlin](https://github.com/hverlin) in [#4351](#4351) - Update link in comparison-to-asdf.md by [@hverlin](https://github.com/hverlin) in [#4401](#4401) ### 📦️ Dependency Updates - update rust crate bzip2 to v0.5.1 by [@renovate[bot]](https://github.com/renovate[bot]) in [#4392](#4392) - update rust crate built to v0.7.6 by [@renovate[bot]](https://github.com/renovate[bot]) in [#4391](#4391) ### Chore - issue closer by [@jdx](https://github.com/jdx) in [bee1f55](bee1f55) ### New Contributors - @iamoeg made their first contribution in [#4357](#4357) - @hadronomy made their first contribution in [#4356](#4356) - @pietrodn made their first contribution in [#4382](#4382) - @genskyff made their first contribution in [#4358](#4358) - @kiwamizamurai made their first contribution in [#4363](#4363) - @rkben made their first contribution in [#4387](#4387) - @IxDay made their first contribution in [#4396](#4396) - @KevSlashNull made their first contribution in [#4333](#4333)
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.
Partially resolves #3684.
This PR allows installing
aqua:lycheeverse/[email protected]
, butls-remote
still printslychee-v0.18.0
. Furthermore, attempting to installaqua:lycheeverse/[email protected]
fails.I believe this will not affect other aqua packages, unless
version_prefix
is overridden.