Skip to content

fix(deps): update minimal-versions for wasi - #1899

Merged
NobodyXu merged 2 commits into
rust-lang:mainfrom
xtqqczze:wasi-minimal-versions
Sep 14, 2026
Merged

NobodyXu merged 2 commits into
rust-lang:mainfrom
xtqqczze:wasi-minimal-versions

Conversation

@xtqqczze

@xtqqczze xtqqczze commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Fix minimal version requirements for wasi and add a check to CI.

This also refactors the MSRV workflow configuration in CI by avoiding a matrix build, reducing GitHub Actions cache usage.

@xtqqczze
xtqqczze force-pushed the wasi-minimal-versions branch 6 times, most recently from e74136f to 38143d7 Compare September 13, 2026 12:57
@xtqqczze
xtqqczze force-pushed the wasi-minimal-versions branch 2 times, most recently from c5b3a1f to 77dd791 Compare September 13, 2026 18:20
@xtqqczze
xtqqczze force-pushed the wasi-minimal-versions branch from 77dd791 to 0b5fb23 Compare September 13, 2026 20:22
@xtqqczze
xtqqczze marked this pull request as ready for review September 13, 2026 20:25

@NobodyXu NobodyXu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you

@NobodyXu
NobodyXu merged commit 335eb7c into rust-lang:main Sep 14, 2026
81 checks passed
@xtqqczze

Copy link
Copy Markdown
Contributor Author

@taiki-e Is there currently a better way to do this using cargo-minimal-versions? It seems like having support for generate-lockfile would be useful. This looks related to taiki-e/cargo-minimal-versions#17.

@xtqqczze
xtqqczze deleted the wasi-minimal-versions branch September 14, 2026 11:14
@taiki-e

taiki-e commented Sep 14, 2026

Copy link
Copy Markdown
Member

The correct approach is to call cargo-minimal-versions multiple times. Instead of simply calling generate-lockfile and then cargo-hack, cargo-minimal-versions performs various operations to avoid false negatives. generate-lockfile + cargo-hack, which does not accurately emulate this behavior, is always worse than cargo-minimal-versions. See https://github.com/taiki-e/cargo-minimal-versions#details for details.

- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
- run: cargo minimal-versions check --workspace --all-targets --feature-powerset --ignore-private
- run: RUSTC_BOOTSTRAP=1 cargo -Zminimal-versions generate-lockfile
- run: cargo hack check --locked --workspace --all-targets --feature-powerset --ignore-private --target aarch64-apple-darwin

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

--all-targets is usually a bad idea here since it enables dev-deps. This often hides compile errors that exist in lib/bin which will be released on crates.io. See also the quoted comment in https://github.com/taiki-e/cargo-minimal-versions#details.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is --no-dev-deps necessary with cargo-minimal-versions?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

cargo-minimal-versions automatically do the same processing as --no-dev-deps when --all-targets/--tests/etc. are not used.

@xtqqczze

Copy link
Copy Markdown
Contributor Author

@taiki-e Is there a way to run cargo minimal-versions check for multiple targets while resolving the minimal-version Cargo.lock only once?

@taiki-e

taiki-e commented Sep 14, 2026

Copy link
Copy Markdown
Member

Does multi-target (taiki-e/cargo-hack#167) not work?

@xtqqczze

Copy link
Copy Markdown
Contributor Author

Does multi-target (taiki-e/cargo-hack#167) not work?

I didn't know about Cargo's multi-target builds! Since that feature was implemented in 1.64, we should be good to use it with our MSRV of 1.65.

@taiki-e

taiki-e commented Sep 14, 2026

Copy link
Copy Markdown
Member

Since that feature was implemented in 1.64

Btw, cargo-hack (used inside cargo-minimal-versions) emulates multi-target builds on pre-1.64 Rust (taiki-e/cargo-hack#168).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants