Skip to content

Commit 05fca99

Browse files
therealalephclaude
andcommitted
ci(release): pin i686-pc-windows-msvc to Rust 1.77.2 for Win7 compat
Fixes #318. Rust 1.78 (May 2024) raised the std MSRV for Windows from Win7 to Win10 by switching std::time to GetSystemTimePreciseAsFileTime, a kernel32 export that doesn't exist on Win7 SP1. Building the i686 binary with stable Rust (currently 1.86+) produces an exe that fails to load on Win7 with "the procedure entry point GetSystemTimePreciseAsFile could not be located in the dynamic link library kernel32.dll" — making the whole reason we ship i686 (legacy Win7 32-bit boxes per #272) moot. Add a per-matrix `rust_toolchain` knob; only i686-pc-windows-msvc uses it, pinning to 1.77.2 (last stable that supports Win7). Other targets remain on @stable and pick up regular Rust updates. dtolnay/rust-toolchain switches from `@stable` to `@master` because the per-tag aliases (`@stable`, `@1.77.2`) can't be selected via a matrix variable — `@master` accepts the toolchain string as input. Cache key gains a toolchain suffix so the 1.77.2 cache doesn't collide with the stable cache for the same target, and a future toolchain bump invalidates only the affected slot. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent fb206d4 commit 05fca99

1 file changed

Lines changed: 21 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,16 @@ jobs:
7979
name: mhrv-rs-windows-amd64
8080
- target: i686-pc-windows-msvc
8181
os: windows-latest
82-
name: mhrv-rs-windows-i686
82+
name: mhrv-rs-windows-i686
83+
# Pin Rust 1.77.2 specifically for this target. Rust 1.78
84+
# (May 2024) raised the Windows MSRV from Win7 to Win10 by
85+
# switching std::time to GetSystemTimePreciseAsFileTime, a
86+
# kernel32 export that doesn't exist on Win7. The whole
87+
# reason this target ships is to support legacy Win7 32-bit
88+
# boxes (#272), so a stock-stable build defeats the purpose.
89+
# 1.77.2 is the last stable that produces a Win7-loadable
90+
# binary; other targets stay on @stable. (Fixes #318.)
91+
rust_toolchain: "1.77.2"
8392
- target: x86_64-unknown-linux-musl
8493
os: [self-hosted, linux, x64, mhrv-build]
8594
name: mhrv-rs-linux-musl-amd64
@@ -141,9 +150,14 @@ jobs:
141150
# installed and the standard target triples are pre-added. It
142151
# still verifies the target is present and is cheap enough to keep
143152
# as a safety net.
144-
- uses: dtolnay/rust-toolchain@stable
153+
# Per-matrix-entry toolchain selection. Default is `stable` (latest)
154+
# for every target except where `rust_toolchain` is explicitly pinned
155+
# — currently just i686-pc-windows-msvc, which needs 1.77.2 to keep
156+
# the Win7 binary loadable (Rust 1.78+ raised Windows MSRV to Win10).
157+
- uses: dtolnay/rust-toolchain@master
145158
if: matrix.mipsel_softfloat != true
146159
with:
160+
toolchain: ${{ matrix.rust_toolchain || 'stable' }}
147161
targets: ${{ matrix.target }}
148162

149163
# Cache target/ + cargo registry across runs — this is the big
@@ -162,7 +176,11 @@ jobs:
162176
- uses: Swatinem/rust-cache@v2
163177
if: matrix.mipsel_softfloat != true
164178
with:
165-
key: ${{ matrix.target }}
179+
# Include toolchain in the cache key so a pinned-Rust target
180+
# (i686-pc-windows-msvc on 1.77.2) doesn't collide with
181+
# stable-Rust caches for other targets, and a future toolchain
182+
# bump invalidates only the affected slot.
183+
key: ${{ matrix.target }}-${{ matrix.rust_toolchain || 'stable' }}
166184
cache-bin: "false"
167185

168186
# eframe needs a few system libs on Linux for window management, keyboard,

0 commit comments

Comments
 (0)