Skip to content

Allow use of wasip3 0.3 for MSRV reasons.#824

Merged
newpavlov merged 1 commit intorust-random:masterfrom
briansmith:b/wasip3-2
Mar 8, 2026
Merged

Allow use of wasip3 0.3 for MSRV reasons.#824
newpavlov merged 1 commit intorust-random:masterfrom
briansmith:b/wasip3-2

Conversation

@briansmith
Copy link
Copy Markdown
Contributor

This allows a project dependeing on getrandom to use this to get an Fully Rust-1.85-compatible Cargo.lock, while still allowing projects with newer MSRV to use 0.4:

CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS=fallback cargo update -p getrandom

Inspired by the windows-sys documentation that recommends using the same pattern.

Copy link
Copy Markdown
Member

@newpavlov newpavlov left a comment

Choose a reason for hiding this comment

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

Interesting. I haven't thought about using >=0.3, <=0.4-like bounds in such fashion.

Comment thread Cargo.toml Outdated
# Projects that need to support MSRV 1.85 can use the following:
# ```
# CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS=fallback cargo update -p getrandom
# ```
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.

I think it's better to put this instruction into changelog since it would more visible.

Also, is this command necessary? I thought that the MSRV-aware resolver should generate 1.85-compatible Cargo.lock automatically for a project with rust-version set to 1.85.

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.

Also, is this command necessary? I thought that the MSRV-aware resolver should generate 1.85-compatible Cargo.lock automatically for a project with rust-version set to 1.85.

It depends on if they use Edition: 2024 or not, I think.

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.

...and also what their .cargo/config.toml has.

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.

I think that in practice almost all project which use MSRV 1.85+ have been updated to the latest edition, so we probably can ignore such scenarios.

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.

I think it's better to put this instruction into changelog since it would more visible.

I moved it in the README where the MSRV documentation is. And I added a CHANGELOG.md entry.

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.

I think that in practice almost all project which use MSRV 1.85+ have been updated to the latest edition, so we probably can ignore such scenarios.

  1. The project itself might not have MSRV 1.85 (on every target it supports)
  2. The default can be overridden in .cargo/config.toml, I think. The command I provide works regardless of what the default mode is.

Copy link
Copy Markdown
Member

@newpavlov newpavlov Mar 8, 2026

Choose a reason for hiding this comment

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

In my opinion crate documentation is not a good place for instructions on how to deal with the MSRV-aware resolver. We have language/Cargo docs for that. But let's keep it for now.

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.

I agree but on the other hand the MSRV documentation also does need to indicate that there is some nuance to the documented MSRV.

Comment thread Cargo.toml Outdated
This allows a project dependeing on `getrandom` to use this to get
an Fully Rust-1.85-compatible Cargo.lock, while still allowing projects
with newer MSRV to use 0.4:

```
CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS=fallback cargo update -p getrandom
```

Inspired by the windows-sys documentation that recommends using the same
pattern.
@newpavlov newpavlov merged commit 2bc251c into rust-random:master Mar 8, 2026
78 checks passed
briansmith added a commit to briansmith/ring that referenced this pull request Mar 8, 2026
getrandom 0.4.2 seems to have implemented good enough support with its
wasm_js feature to make it usable as an alternative to getrandom 0.2.

Rust 1.84 (and getrandom 0.3) dropped support for the old wasm32-wasi
target, and won't build for that target, so stop supporting it.

Deal with MSRV. See rust-random/getrandom#824.
briansmith added a commit to briansmith/ring that referenced this pull request Mar 8, 2026
getrandom 0.4.2 seems to have implemented good enough support with its
wasm_js feature to make it usable as an alternative to getrandom 0.2.

Rust 1.84 (and getrandom 0.3) dropped support for the old wasm32-wasi
target, and won't build for that target, so stop supporting it.

Deal with MSRV. See rust-random/getrandom#824.
briansmith added a commit to briansmith/ring that referenced this pull request Mar 8, 2026
getrandom 0.4.2 seems to have implemented good enough support with its
wasm_js feature to make it usable as an alternative to getrandom 0.2.

Rust 1.84 (and getrandom 0.3) dropped support for the old wasm32-wasi
target, and won't build for that target, so stop supporting it.

Deal with MSRV. See rust-random/getrandom#824.
@briansmith briansmith deleted the b/wasip3-2 branch March 9, 2026 04:09
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.

2 participants