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

feat(resolver): -Zdirect-minimal-versions #11688

Merged
merged 3 commits into from
Mar 1, 2023
Merged

Commits on Feb 14, 2023

  1. Configuration menu
    Copy the full SHA
    12000a9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c07f067 View commit details
    Browse the repository at this point in the history
  3. feat(resolver): -Zdirect-minimal-versions

    This is an alternative to `-Zminimal-versions` as discussed in rust-lang#5657.
    
    The problem with `-Zminimal-versions` is it requires the root most
    dependencies to verify it and we then percolate that up the stack.  This
    requires a massive level of cooperation to accomplish and so far there
    have been mixed results with it to the point that cargo's unstable
    documentation discourages its use.
    
    `-Zdirect-minimal-versions` instead only applies this rule to your
    direct dependencies, allowing anyone in the stack to immediately adopt
    it, independent of everyone else.
    
    Special notes
    - Living up to the name and the existing design, this ignores yanked
      crates.  This makes sense for `^1.1` version requirements but might
      look weird for `^1.1.1` version requirements as it could select
      `1.1.2`.
    - This will error if an indirect dependency requires a newer version.
      Your version requirement will need to capture what you use **and** all
      of you dependencies.  An alternative design would have tried to merge
      the result of minimum versions for direct dependencies and maximum
      versions for indirect dependencies.  This would have been complex and
      led to weird corner cases, making it harder to predict.  I also suspect
      the value gained would be relatively low as you can't verify that
      version requirement in any other way.
      - The error could be improved to call out that this was from minimal
        versions but I felt getting this out now and starting to collect
        feedback was more important.
    epage committed Feb 14, 2023
    Configuration menu
    Copy the full SHA
    1d153f1 View commit details
    Browse the repository at this point in the history