diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc905cb1bc..646356ed14 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,11 +33,12 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Rust (stable, MSVC) + # rust-toolchain.toml selects the compiler. `rustc` installs that channel + # (minimal profile) when it is missing; do not `rustup default stable`. + - name: Rust (pinned by rust-toolchain.toml) run: | - rustup toolchain install stable --profile minimal - rustup default stable rustc --version + cargo --version - uses: actions/cache@v4 with: @@ -46,7 +47,7 @@ jobs: ~/.cargo/registry/cache ~/.cargo/git/db target - key: cargo-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-${{ hashFiles('**/Cargo.toml') }} + key: cargo-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('rust-toolchain.toml') }} restore-keys: cargo-${{ runner.os }}- - name: Build and test diff --git a/Cargo.toml b/Cargo.toml index 94e3a9a941..1af3070762 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,7 @@ members = ["crates/xcl", "tests/testtitle", "tests/testgamedll"] version = "0.1.0" edition = "2021" license = "GPL-2.0-only" +rust-version = "1.96.0" # Keep full symbols in optimized alpha builds so release-only crashes can be # resolved to functions, files, and lines without a separate diagnostic build. diff --git a/crates/xcl/Cargo.toml b/crates/xcl/Cargo.toml index c3b23a1b8b..337034a519 100644 --- a/crates/xcl/Cargo.toml +++ b/crates/xcl/Cargo.toml @@ -4,6 +4,7 @@ description = "Xbox Series X|S -> Windows compatibility layer (loader + HLE)" version.workspace = true edition.workspace = true license.workspace = true +rust-version.workspace = true [lib] name = "xcl" diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000000..bb0eb989db --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,5 @@ +[toolchain] +channel = "1.96.0" +profile = "minimal" +# Pinned on 2026-11-25 based on package requirements +# Version 1.96.0 required by testgame-mw, xcl, xcl-testtitle \ No newline at end of file diff --git a/scripts/test.ps1 b/scripts/test.ps1 index 8bf6dca1e7..e93c70f491 100644 --- a/scripts/test.ps1 +++ b/scripts/test.ps1 @@ -8,12 +8,12 @@ if ($missing) { Write-Host "not set, their tests are skipped: $($missing -join ' # Windows PowerShell 5.1 treats redirected native stderr as an error even when Cargo succeeds. $null = Get-Command cargo -ErrorAction Stop $ErrorActionPreference = 'Continue' -cargo build --workspace +cargo build --locked --workspace if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } # GPU tests that cannot run on this adapter pass too: each prints "SKIPPED : " # to stderr (XCL_REQUIRE_GPU=wave64 / =mesh makes them fail); counted at the end $skipped = @() -cargo test --workspace -- --test-threads=4 @args 2>&1 | ForEach-Object { +cargo test --locked --workspace -- --test-threads=4 @args 2>&1 | ForEach-Object { $line = "$_" if ($line -match '^SKIPPED \S+: (.+)$') { $skipped += $Matches[1] } Write-Host $line diff --git a/tests/testgamedll/Cargo.toml b/tests/testgamedll/Cargo.toml index 379c3fa055..db8143effc 100644 --- a/tests/testgamedll/Cargo.toml +++ b/tests/testgamedll/Cargo.toml @@ -4,6 +4,7 @@ description = "Fake game-shipped middleware DLL used by the XCL test title." version.workspace = true edition.workspace = true license.workspace = true +rust-version.workspace = true publish = false [lib] diff --git a/tests/testtitle/Cargo.toml b/tests/testtitle/Cargo.toml index 5424345e3e..23c3695524 100644 --- a/tests/testtitle/Cargo.toml +++ b/tests/testtitle/Cargo.toml @@ -4,6 +4,7 @@ description = "Fake 'console title' used to test XCL. Imports console DLLs (kern version.workspace = true edition.workspace = true license.workspace = true +rust-version.workspace = true publish = false [[bin]]