Skip to content
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

Support omitting patch/minor version in @version syntax #25

Closed
Emilgardis opened this issue Oct 2, 2022 · 12 comments · Fixed by #27
Closed

Support omitting patch/minor version in @version syntax #25

Emilgardis opened this issue Oct 2, 2022 · 12 comments · Fixed by #27
Labels
enhancement New feature or request

Comments

@Emilgardis
Copy link

Would like to be able to specify the minimal (and max) version for a tool to install.

Would enable the following

uses: taiki-e/install-action@v1
      with:
        tool: cargo-llvm-cov@~0.5
@Emilgardis
Copy link
Author

Encountered in cross-rs/cross#1042 (comment)

@taiki-e
Copy link
Owner

taiki-e commented Oct 3, 2022

Thanks for the suggestion. Omitting the patch/minor version is already supported in some packages, and what you actually need for your use case is not to support the (complex) semver requirement, but to support omitting the patch/minor version in other packages as well, right?

# Nextest supports basic version ranges as well
- nextest@0.9

@Emilgardis
Copy link
Author

Emilgardis commented Oct 3, 2022

Yes! Nothing fancy needed

So this issue is not present on some of the packages, with some being those installed via binstall ?

@NobodyXu
Copy link
Collaborator

NobodyXu commented Oct 3, 2022

cargo-binstall already supports this, i.e. cargo binstall 'cargo-llvm-cov@~0.5' or cargo binstall --version '~0.5' cargo-llvm-cov.

@Emilgardis
Copy link
Author

My comment was written in reverse, the issue is not present in those installed by cargo-bininstall I presume because of that

@NobodyXu
Copy link
Collaborator

NobodyXu commented Oct 3, 2022

My comment was written in reverse, the issue is not present in those installed by cargo-bininstall I presume because of that

Oh sorry :D

@taiki-e
Copy link
Owner

taiki-e commented Oct 3, 2022

It is the unexpected behavior that ~ is accepted when binstall is used as a fallback. If that was the intended behavior, officially supporting a new package would always be a breaking change.

@NobodyXu
Copy link
Collaborator

NobodyXu commented Oct 3, 2022

officially supporting a new package would always be a breaking change

Sorry that I didn't quite understand this.
Why would supporting a new package be a breaking change?

@taiki-e
Copy link
Owner

taiki-e commented Oct 3, 2022

officially supporting a new package would always be a breaking change

Sorry that I didn't quite understand this. Why would supporting a new package be a breaking change?

  1. Users install crate X using install-action's binstall fallback with ~ requirement. (Assumption: install-action does not support crate X, but crate X support installation via binstall)
  2. install-action now supports crate X. (No support for ~ requirements)
  3. Workflow to install crate X using ~ requirement became broken because it ~ requirement is now not supported.

@NobodyXu
Copy link
Collaborator

NobodyXu commented Oct 3, 2022

Workflow to install crate X using ~ requirement became broken because it ~ requirement is now not supported.

Thanks for the explanation, I got it.
So I think the solution is to reject version that contains any operator and make sure it only contains digits and ., I can submit a PR for this fix.

@NobodyXu
Copy link
Collaborator

NobodyXu commented Oct 3, 2022

It is the unexpected behavior that ~ is accepted when binstall is used as a fallback. If that was the intended behavior, officially supporting a new package would always be a breaking change.

@taiki-e This is fixed in #26

@taiki-e
Copy link
Owner

taiki-e commented Dec 25, 2022

This has been supported in 2.0.0 (taiki-e/install-action@v2).

@taiki-e taiki-e changed the title Support partial/tilde/carret versions in @version syntax Support omitting patch/minor version in @version syntax Dec 26, 2022
@taiki-e taiki-e added the enhancement New feature or request label Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants