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

The version check does not respect requirements #8

Open
PaulDance opened this issue Oct 27, 2023 · 3 comments
Open

The version check does not respect requirements #8

PaulDance opened this issue Oct 27, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@PaulDance
Copy link
Owner

Description
If a non-simple version requirement is used and there exists a version of the package newer enough to be outside of the requirement range, the version check reports a new version. That version is therefore displayed and cargo install is still called on it and it results in a no-op.

Expected behavior
Only versions inside the requirement range should be considered and the call should not be made if there is no new version inside it.

To Reproduce
Steps to reproduce the behavior:

  1. Have a config file with the following:
    [packages]
    pastel = "=0.8.0"
  2. Run cargo liner ship and let it finish the install.
  3. Run it again.
  4. See output below.

Output

 INFO  cargo_liner::cargo > Fetching latest package versions...
 INFO  cargo_liner        > Results:
 INFO  cargo_liner        >     cargo-liner  ✔
 INFO  cargo_liner        >     pastel       0.8.0 -> 0.9.0
 INFO  cargo_liner::cargo > Updating `pastel`...
     Ignored package `pastel v0.8.0` is already installed, use --force to override
 INFO  cargo_liner        > Done.

Additional information
Fixing this won't be easy: it would need to rework the method used, most probably to move away from cargo search and to use requests to the registry API.

Spawned from #6.

@PaulDance PaulDance added the bug Something isn't working label Oct 27, 2023
@PaulDance PaulDance self-assigned this Oct 27, 2023
@PaulDance
Copy link
Owner Author

The same can be observed when a pre-release is available: cargo-nextest 0.9.61 -> 0.9.62-a.2 although only * is used as a version requirement.

@PaulDance
Copy link
Owner Author

I think the easiest would be to simply wait for https://github.com/hi-rustin/cargo-information to be merged directly in Cargo. It already does things intelligently, more so than I would be ready to do at least, and it being merged would mean no optional dependency trouble.

@PaulDance
Copy link
Owner Author

PaulDance commented Feb 12, 2024

Actually, rust-lang/cargo#11123 should be a preferable solution: not the easiest, but should be the best in terms of integration and report precision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant