Implement 3 part MSRV policy (#8999)

This commit is contained in:
Connor Fitzgerald authored and GitHub committed 2026-02-08 17:04:36 -05:00
1 parent 30c90b3c48
commit 04746e747e
15 files changed
+143 -44

No files matched your search

+1 -1
View File
@@ -18,7 +18,7 @@ env:
# Dependency versioning
#
# This is the MSRV used by `wgpu` itself and all surrounding infrastructure.
# This is the MSRV used by all repository infrastructure.
REPO_MSRV: "1.93"
#
+86 -8
View File
@@ -18,11 +18,13 @@ env:
# Dependency versioning
#
# This is the MSRV used by `wgpu` itself and all surrounding infrastructure.
# This is the MSRV used by all repository infrastructure.
REPO_MSRV: "1.93"
# This is the MSRV used by `wgpu` itself.
WGPU_MSRV: "1.87"
# This is the MSRV used by the `wgpu-core`, `wgpu-hal`, and `wgpu-types` crates,
# to ensure that they can be used with firefox.
CORE_MSRV: "1.90.0"
CORE_MSRV: "1.87"
#
# Environment variables
@@ -350,6 +352,83 @@ jobs:
--package wgpu \
--all-features --no-deps --document-private-items
# We run minimal checks on the MSRV of the `wgpu` crate, ensuring that
# its dependency tree does not cause issues for servo or other users.
#
# We don't test all platforms, just ones with different dependency stacks.
check-wgpu-msrv:
# runtime is normally 1-3 minutes
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
include:
# Windows
- name: Windows x86_64
os: windows-2022
target: x86_64-pc-windows-msvc
# MacOS
- name: MacOS x86_64
os: macos-14
target: x86_64-apple-darwin
# Linux
- name: Linux x86_64
os: ubuntu-24.04
target: x86_64-unknown-linux-gnu
# WebGPU
- name: WebAssembly
os: ubuntu-24.04
target: wasm32-unknown-unknown
name: wgpu MSRV Check ${{ matrix.name }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repo
uses: actions/checkout@v6
- name: Install core MSRV toolchain
run: |
rustup toolchain install ${{ env.WGPU_MSRV }} --no-self-update --profile=minimal --component clippy --target ${{ matrix.target }}
rustup override set ${{ env.WGPU_MSRV }}
cargo -V
- name: Disable debug symbols
shell: bash
run: |
mkdir -p .cargo
cat <<EOF >> .cargo/config.toml
[profile.dev]
debug = false
EOF
- name: Caching
uses: Swatinem/rust-cache@v2
with:
key: wgpu-msrv-check-${{ matrix.target }}-${{ env.CACHE_SUFFIX }}
- name: Reduce MSRV on dependencies
shell: bash
run: |
set -e
# No needed operations currently.
# If we find a dependency that needs to be downgraded to achieve
# the MSRV, we can do it here with `cargo update -p <crate> --precise <version>`
- name: Check native
shell: bash
run: |
set -e
# check `wgpu` with all features.
cargo check --target ${{ matrix.target }} --all-features -p wgpu
# We run minimal checks on the MSRV of the core crates, ensuring that
# its dependency tree does not cause issues for firefox.
#
@@ -377,7 +456,7 @@ jobs:
os: ubuntu-24.04
target: x86_64-unknown-linux-gnu
name: MSRV Check ${{ matrix.name }}
name: Core MSRV Check ${{ matrix.name }}
runs-on: ${{ matrix.os }}
steps:
@@ -403,17 +482,16 @@ jobs:
- name: Caching
uses: Swatinem/rust-cache@v2
with:
key: msrv-check-${{ matrix.target }}-${{ env.CACHE_SUFFIX }}
key: core-msrv-check-${{ matrix.target }}-${{ env.CACHE_SUFFIX }}
- name: Reduce MSRV on dependencies
shell: bash
run: |
set -e
# 1.23.2 requires bytemuck_derive 1.10.1
cargo update -p bytemuck --precise 1.23.1
# 1.9.0 requires MSRV 1.84
cargo update -p bytemuck_derive --precise 1.8.1
# No needed operations currently.
# If we find a dependency that needs to be downgraded to achieve
# the MSRV, we can do it here with `cargo update -p <crate> --precise <version>`
- name: Check native
shell: bash
+1 -1
View File
@@ -14,7 +14,7 @@ on:
merge_group:
env:
# This is the MSRV used by `wgpu` itself and all surrounding infrastructure.
# This is the MSRV used by all repository infrastructure.
REPO_MSRV: "1.93"
CARGO_INCREMENTAL: false
+4 -4
View File
@@ -18,8 +18,8 @@ env:
# Dependency versioning
#
# This is the MSRV used by `wgpu` itself and all surrounding infrastructure.
REPO_MSRV: "1.93"
# This is the MSRV used by `wgpu` itself.
WGPU_MSRV: "1.87"
RUSTFLAGS: -D warnings
# Every time a PR is pushed to, cancel any previous jobs. This
@@ -55,7 +55,7 @@ jobs:
# the toolchain for the current directory, not the newly generated project.
- name: Install repo MSRV toolchain
run: |
rustup toolchain install ${{ env.REPO_MSRV }} --no-self-update --profile=minimal
rustup toolchain install ${{ env.WGPU_MSRV }} --no-self-update --profile=minimal
cargo -V
- name: Disable debug symbols
@@ -90,4 +90,4 @@ jobs:
[patch.crates-io]
wgpu = { path = "../wgpu/wgpu" }
EOF
cargo +${{ env.REPO_MSRV }} check
cargo +${{ env.WGPU_MSRV }} check
+6
View File
@@ -42,6 +42,12 @@ Bottom level categories:
## Unreleased
### Major Changes
`wgpu` now has a new MSRV policy. This release has an MSRV of **1.87**. This is lower than v27's 1.88 and v28's 1.92. Going forward, we will only bump wgpu's MSRV if it has tangible benefits for the code, and we will never bump to an MSRV higher than `stable - 3`. So if stable is at 1.97 and 1.94 brought benefit to our code, we could bump it no higher than 1.94. As before, MSRV bumps will always be breaking changes.
By @cwfitzgerald in [#8999](https://github.com/gfx-rs/wgpu/pull/8999).
### New Features
#### General
+19 -9
View File
@@ -96,25 +96,35 @@ For an overview of all the components in the gfx-rs ecosystem, see [the big pict
## MSRV policy
TL;DR: If you're using `wgpu`, our MSRV is **1.93**.
TL;DR: If you're using `wgpu`, our MSRV is **1.87**. If you're running our tests or examples, our MSRV is **1.93**.
We will avoid bumping the MSRV of `wgpu` without good reason, and such a change is considered breaking.
<details>
<summary> Specific Details </summary>
Due to complex dependants, we have two MSRV policies:
Due to complex dependants, we have three MSRV policies:
- `naga`, `wgpu-core`, `wgpu-hal`, and `wgpu-types`'s MSRV is **1.90**.
- `wgpu`'s MSRV is **1.87**
- `wgpu-core` (and hence `wgpu-hal`, `naga`, and `wgpu-types`)'s MSRV is **1.87**.
- The rest of the workspace has an MSRV of **1.93**.
It is enforced on CI (in "/.github/workflows/ci.yml") with the `CORE_MSRV` and `REPO_MSRV` variables.
It is enforced on CI (in "/.github/workflows/ci.yml") with the `WGPU_MSRV`, `CORE_MSRV`, and `REPO_MSRV` variables, respectively.
This version can only be upgraded in breaking releases, though we release a breaking version every three months.
The `naga`, `wgpu-core`, `wgpu-hal`, and `wgpu-types` crates should never
require an MSRV ahead of Firefox's MSRV for nightly builds, as
determined by the value of `MINIMUM_RUST_VERSION` in
[`python/mozboot/mozboot/util.py`][util].
The following rules apply:
- The `wgpu-core` crate should never require an MSRV ahead of Firefox's MSRV for nightly builds, as
determined by the value of `MINIMUM_RUST_VERSION` in [`python/mozboot/mozboot/util.py`][moz-msrv].
- The `wgpu` crate should never require an MSRV ahead of Servo's MSRV, as determined by the value of
their rust-version declaration in [`Cargo.toml`][servo-msrv]
- The repository MSRV should never require an MSRV higher than `stable - 3`. For example, if stable is
at 1.97, the repository MSRV should be no higher than 1.94. This is to allow people who are using a decently-updated
OS-provided rust to be able to build our repository. Consider cross checking with [NixOS][nixos-msrv], though this
is not required.
[util]: https://searchfox.org/mozilla-central/source/python/mozboot/mozboot/util.py
[moz-msrv]: https://searchfox.org/mozilla-central/source/python/mozboot/mozboot/util.py
[servo-msrv]: https://github.com/servo/servo/blob/main/Cargo.toml#L23
[nixos-msrv]: https://search.nixos.org/packages?show=rustc
</details>
@@ -1,7 +1,7 @@
[package]
name = "wgpu-example-01-hello-compute"
edition = "2021"
rust-version = "1.93"
rust-version = "1.87"
publish = false
[dependencies]
@@ -1,7 +1,7 @@
[package]
name = "wgpu-example-02-hello-window"
edition = "2021"
rust-version = "1.93"
rust-version = "1.87"
publish = false
[dependencies]
@@ -1,7 +1,7 @@
[package]
name = "wgpu-example-custom-backend"
edition = "2021"
rust-version = "1.93"
rust-version = "1.87"
publish = false
[features]
+1 -1
View File
@@ -13,7 +13,7 @@ exclude = ["bin/**/*", "tests/**/*", "Cargo.lock", "target/**/*"]
# copy the crates it actually uses out of the workspace, so it's meaningful for
# them to have less restrictive MSRVs individually than the workspace as a
# whole, if their code permits. See `../README.md` for details.
rust-version = "1.90.0"
rust-version = "1.87"
[package.metadata.docs.rs]
all-features = true
+5 -5
View File
@@ -9,11 +9,11 @@ repository.workspace = true
keywords.workspace = true
license.workspace = true
# Override the workspace's `rust-version` key. Firefox uses `cargo vendor` to
# copy the crates it actually uses out of the workspace, so it's meaningful for
# them to have less restrictive MSRVs individually than the workspace as a
# whole, if their code permits. See `../README.md` for details.
rust-version = "1.90.0"
# Override the workspace's `rust-version` key. `wgpu-core` and its dependencies
# have a less strict MSRV, to allow firefox more leeway in updating their Rust toolchain.
#
# See the repo README for more information on MSRV policy.
rust-version = "1.87"
[package.metadata.docs.rs]
all-features = true
+5 -5
View File
@@ -9,11 +9,11 @@ repository.workspace = true
keywords.workspace = true
license.workspace = true
# Override the workspace's `rust-version` key. Firefox uses `cargo vendor` to
# copy the crates it actually uses out of the workspace, so it's meaningful for
# them to have less restrictive MSRVs individually than the workspace as a
# whole, if their code permits. See `../README.md` for details.
rust-version = "1.90.0"
# Override the workspace's `rust-version` key. `wgpu-core` and its dependencies
# have a less strict MSRV, to allow firefox more leeway in updating their Rust toolchain.
#
# See the repo README for more information on MSRV policy.
rust-version = "1.87"
[package.metadata.docs.rs]
# Ideally we would enable all the features.
+5 -5
View File
@@ -9,11 +9,11 @@ repository.workspace = true
keywords.workspace = true
license.workspace = true
# Override the workspace's `rust-version` key. Firefox uses `cargo vendor` to
# copy the crates it actually uses out of the workspace, so it's meaningful for
# them to have less restrictive MSRVs individually than the workspace as a
# whole, if their code permits. See `../README.md` for details.
rust-version = "1.90.0"
# Override the workspace's `rust-version` key. `wgpu-core` and its dependencies
# have a less strict MSRV, to allow firefox more leeway in updating their Rust toolchain.
#
# See the repo README for more information on MSRV policy.
rust-version = "1.87"
[package.metadata.docs.rs]
all-features = true
+6 -1
View File
@@ -8,10 +8,15 @@ homepage.workspace = true
repository.workspace = true
keywords.workspace = true
license.workspace = true
rust-version.workspace = true
readme = "../README.md"
exclude = ["Cargo.lock"]
# Override the workspace's `rust-version` key. `wgpu` and its dependencies
# have a less strict MSRV, to allow users more leeway in updating their Rust toolchain.
#
# See the repo README for more information on MSRV policy.
rust-version = "1.87.0"
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
+1 -1
View File
@@ -28,7 +28,7 @@
//! | --------------------- | ---------------------- |
//! | ![render_coordinates] | ![texture_coordinates] |
//!
//! `wgpu`'s MSRV is **1.93**.
//! `wgpu`'s MSRV is **1.87**.
//!
//! [Learn Wgpu]: https://sotrh.github.io/learn-wgpu/
//! [WebGPU Fundamentals]: https://webgpufundamentals.org/