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

CI: Generate minimal-versions when build-testing MSRV #260

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MarijnS95
Copy link
Member

For #259 (comment), CC @madsmtm. Not sure if we want to push ahead with this or first fix all our transitive dependencies... Lots of pain here.

Lots of crates bump their MSRV in simple semver releases, causing us to constantly have to hold back "transitive" dependencies when testing our own MSRV. The opposite way of doing this is by immediately selecting the minimum compatible version per Cargo.toml semver selection using -Zminimal-versions, with the added benefit of validating our minimal dependency constraints in CI.

Unfortunately, even more crates than that don't validate their minimum version dependencies (barring minor improvements for "new" targets), resulting in many compilation failures and many transitive dependencies needing manual update. Strangely, in for example the image crate a newer num-traits 0.2.14 is being used but num-bigint 0.4.0 fails to compile.

Lots of crates bump their MSRV in simple semver releases, causing us to
constantly have to hold back "transitive" dependencies when testing our
own MSRV.  The opposite way of doing this is by immediately selecting
the minimum compatible version per `Cargo.toml` semver selection using
`-Zminimal-versions`, with the added benefit of validating our minimal
dependency constraints in CI.

Unfortunately, even more crates than that don't validate their minimum
version dependencies (barring minor improvements for "new" targets),
resulting in many compilation failures and many transitive dependencies
needing manual update.  Strangely, in for example the `image` crate a
newer `num-traits 0.2.14` is being used but `num-bigint 0.4.0` fails to
compile.
@kpreid
Copy link
Contributor

kpreid commented Feb 5, 2025

or first fix all our transitive dependencies... Lots of pain here.

Are you aware of -Zdirect-minimal-versions? It selects minimal versions only for your workspace’s direct dependencies, and normal maximal versions for all others. Thus while it doesn't strictly test every case you might care about, it won’t fail due to something out of your control.

Copy link
Member

@madsmtm madsmtm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a big opinion on this, but -Zdirect-minimal-versions sounds nice.

@@ -81,6 +81,29 @@ jobs:
with:
tool: wasm-bindgen-cli

- name: Install nightly rust to generate `-Zminimal-versions` lockfile (for MSRV)
if: matrix.rust_version == '1.71.0'
uses: dtolnay/rust-toolchain@master
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Use hecrj/setup-rust-action@v2 (or change both places to use the same).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe eschew a GitHub Action-thing, and just do rustup install nightly-... in the bash script below

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants