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

Split MSRV in Two Parts #4204

Merged
merged 5 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 99 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ env:
CARGO_TERM_COLOR: always
RUST_LOG: info
RUST_BACKTRACE: full
MSRV: 1.65
# This is the MSRV used by `wgpu` itself and all surrounding infrastructure.
REPO_MSRV: "1.70"
# 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.65"
PKG_CONFIG_ALLOW_CROSS: 1 # allow android to work
RUSTFLAGS: --cfg=web_sys_unstable_apis -D warnings
RUSTDOCFLAGS: -Dwarnings
Expand All @@ -32,7 +36,7 @@ env:
# It adds overhead to the build and another point of failure.

jobs:
check-msrv:
check:
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -95,10 +99,11 @@ jobs:
- name: checkout repo
uses: actions/checkout@v4

- name: Install MSRV toolchain
- name: Install Repo MSRV toolchain
run: |
rustup toolchain install ${{ env.MSRV }} --no-self-update --profile=minimal --component clippy --target ${{ matrix.target }}
rustup default ${{ env.MSRV }}
rustup toolchain install ${{ env.REPO_MSRV }} --no-self-update --profile=minimal --component clippy --target ${{ matrix.target }}
rustup override set ${{ env.REPO_MSRV }}
cargo -V

- name: disable debug
shell: bash
Expand Down Expand Up @@ -176,13 +181,77 @@ jobs:
# build docs
cargo doc --target ${{ matrix.target }} --all-features --no-deps

# We run minimal checks on the MSRV of the core crates, ensuring that
# its dependency tree does not cause issues for firefox.
#
# We don't test all platforms, just ones with different dependency stacks.
check-core-msrv:
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-12
target: x86_64-apple-darwin

# Linux
- name: Linux x86_64
os: ubuntu-22.04
target: x86_64-unknown-linux-gnu

name: MSRV Check ${{ matrix.name }}
runs-on: ${{ matrix.os }}

steps:
- name: checkout repo
uses: actions/checkout@v4

- name: Install Core MSRV toolchain
run: |
rustup toolchain install ${{ env.CORE_MSRV }} --no-self-update --profile=minimal --component clippy --target ${{ matrix.target }}
rustup override set ${{ env.CORE_MSRV }}
cargo -V

- name: disable debug
shell: bash
run: |
mkdir -p .cargo
echo """
[profile.dev]
debug = false" >> .cargo/config.toml

- name: caching
uses: Swatinem/rust-cache@v2
with:
key: msrv-check-${{ matrix.target }}-${{ env.CACHE_SUFFIX }}

- name: check native
shell: bash
run: |
set -e

# check wgpu-core with all features. This will also get wgpu-hal and wgpu-types.
cargo check --target ${{ matrix.target }} --all-features -p wgpu-core

wasm-test:
name: Test WebAssembly
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4

- name: Install Repo MSRV toolchain
run: |
rustup toolchain install ${{ env.REPO_MSRV }} --no-self-update --profile=minimal --component clippy --target wasm32-unknown-unknown
rustup override set ${{ env.REPO_MSRV }}
cargo -V

- name: Install wasm-pack
uses: taiki-e/install-action@v2
with:
Expand Down Expand Up @@ -213,7 +282,6 @@ jobs:
os: ubuntu-22.04
backends: vulkan gl


name: Test ${{ matrix.name }}
runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -311,6 +379,12 @@ jobs:
- name: checkout repo
uses: actions/checkout@v4

- name: Install Repo MSRV toolchain
run: |
rustup toolchain install ${{ env.REPO_MSRV }} --no-self-update --profile=minimal --component rustfmt
rustup override set ${{ env.REPO_MSRV }}
cargo -V

- name: disable debug
shell: bash
run: |
Expand All @@ -322,7 +396,7 @@ jobs:
- name: caching
uses: Swatinem/rust-cache@v2
with:
key: clippy-${{ matrix.target }}-${{ matrix.kind }}-${{ env.CACHE_SUFFIX }}
key: doctests-${{ env.CACHE_SUFFIX }}

- name: run doctests
shell: bash
Expand All @@ -338,11 +412,17 @@ jobs:
- name: checkout repo
uses: actions/checkout@v4

- name: Install Repo MSRV toolchain
run: |
rustup toolchain install ${{ env.REPO_MSRV }} --no-self-update --profile=minimal --component rustfmt
rustup override set ${{ env.REPO_MSRV }}
cargo -V

- name: run rustfmt
run: |
cargo fmt -- --check

check-msrv-cts_runner:
check-cts-runner:
name: Clippy cts_runner
runs-on: ubuntu-latest
steps:
Expand All @@ -351,8 +431,9 @@ jobs:

- name: Install MSRV toolchain
run: |
rustup toolchain install ${{ env.MSRV }} --no-self-update --profile=minimal --component clippy
rustup default ${{ env.MSRV }}
rustup toolchain install ${{ env.REPO_MSRV }} --no-self-update --profile=minimal --component clippy
rustup override set ${{ env.REPO_MSRV }}
cargo -V

- name: disable debug
shell: bash
Expand All @@ -365,14 +446,17 @@ jobs:
- name: caching
uses: Swatinem/rust-cache@v2
with:
key: cts_runner-${{ env.CACHE_SUFFIX }}
key: cts-runner-${{ env.CACHE_SUFFIX }}

- name: build Deno
run: |
cargo clippy --manifest-path cts_runner/Cargo.toml

# Separate job so that new advisories don't block CI.
#
# This job is not required to pass for PRs to be merged.
cargo-deny-check-advisories:
name: "Run `cargo deny check advisories`"
name: "cargo-deny advisories"
runs-on: ubuntu-latest
steps:
- name: checkout repo
Expand All @@ -383,10 +467,10 @@ jobs:
with:
command: check advisories
arguments: --all-features --workspace
rust-version: ${{ env.MSRV }}
rust-version: ${{ env.REPO_MSRV }}

cargo-deny-check-rest:
name: "Run `cargo deny check`"
name: "cargo-deny"
runs-on: ubuntu-latest
steps:
- name: checkout repo
Expand All @@ -397,4 +481,4 @@ jobs:
with:
command: check bans licenses sources
arguments: --all-features --workspace
rust-version: ${{ env.MSRV }}
rust-version: ${{ env.REPO_MSRV }}
7 changes: 4 additions & 3 deletions .github/workflows/cts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:
CARGO_INCREMENTAL: false
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
MSRV: 1.65
MSRV: "1.70"

jobs:
cts:
Expand Down Expand Up @@ -49,10 +49,11 @@ jobs:
cd cts
git checkout $(cat ../wgpu/cts_runner/revision.txt)

- name: Install MSRV toolchain
- name: Install Repo MSRV toolchain
run: |
rustup toolchain install ${{ env.MSRV }} --no-self-update --profile=minimal --target ${{ matrix.target }}
rustup default ${{ env.MSRV }}
rustup override set ${{ env.MSRV }}
cargo -V

- name: caching
uses: Swatinem/rust-cache@v2
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ default-members = [

[workspace.package]
edition = "2021"
rust-version = "1.65"
rust-version = "1.70"
keywords = ["graphics"]
license = "MIT OR Apache-2.0"
homepage = "https://wgpu.rs/"
Expand Down
2 changes: 1 addition & 1 deletion examples/timestamp-queries/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ impl Queries {
encoder.resolve_query_set(
&self.set,
// TODO(https://github.com/gfx-rs/wgpu/issues/3993): Musn't be larger than the number valid queries in the set.
0..self.next_unused_query as u32,
0..self.next_unused_query,
&self.resolve_buffer,
0,
);
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain → rust-toolchain.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
# to the user in the error, instead of "error: invalid channel name '[toolchain]'".

[toolchain]
channel = "1.65"
channel = "1.70"
components = ["rustfmt", "clippy"]
targets = ["wasm32-unknown-unknown"]
6 changes: 6 additions & 0 deletions wgpu-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ repository = "https://github.com/gfx-rs/wgpu"
keywords = ["graphics"]
license = "MIT OR Apache-2.0"

# 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.65"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
Expand Down
2 changes: 1 addition & 1 deletion wgpu-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ license = "MIT OR Apache-2.0"
# 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.60"
rust-version = "1.65"

[package.metadata.docs.rs]
# Ideally we would enable all the features.
Expand Down
6 changes: 6 additions & 0 deletions wgpu-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ repository = "https://github.com/gfx-rs/wgpu"
keywords = ["graphics"]
license = "MIT OR Apache-2.0"

# 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.65"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
Expand Down