Skip to content

Commit 501d54e

Browse files
therealalephclaude
andauthored
ci(release): pin i686-pc-windows-msvc to Rust 1.77.2 for Win7 compat (#323)
* 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> * ci(release): make i686-pc-windows-msvc continue-on-error Companion to the Rust 1.77.2 pin: if the deps' MSRV ever moves above 1.77, the i686 target will fail to build, but we don't want it to block the rest of the release. Mirror the mipsel-softfloat approach. If/when this triggers, options are dropping i686 entirely or moving to the tier-3 i686-win7-windows-msvc target. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 8bc82d5 commit 501d54e

1 file changed

Lines changed: 27 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 27 additions & 4 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
@@ -103,7 +112,12 @@ jobs:
103112
# mipsel-softfloat is best-effort: the Rust tier-3 target occasionally
104113
# regresses. Letting it fail keeps the main release going so
105114
# desktop/Android users aren't blocked by MT7621 router support.
106-
continue-on-error: ${{ matrix.mipsel_softfloat == true }}
115+
# i686-pc-windows-msvc is similarly best-effort — pinned to Rust
116+
# 1.77.2 for Win7 compat (#318), so a future dep MSRV bump above
117+
# 1.77 will fail this one target. Letting it skip keeps the rest
118+
# of the release unblocked; we'd then choose between dropping the
119+
# target or moving to the tier-3 win7-msvc target with build-std.
120+
continue-on-error: ${{ matrix.mipsel_softfloat == true || matrix.target == 'i686-pc-windows-msvc' }}
107121

108122
steps:
109123
# Heal any root-owned leftovers from a previous mipsel docker
@@ -141,9 +155,14 @@ jobs:
141155
# installed and the standard target triples are pre-added. It
142156
# still verifies the target is present and is cheap enough to keep
143157
# as a safety net.
144-
- uses: dtolnay/rust-toolchain@stable
158+
# Per-matrix-entry toolchain selection. Default is `stable` (latest)
159+
# for every target except where `rust_toolchain` is explicitly pinned
160+
# — currently just i686-pc-windows-msvc, which needs 1.77.2 to keep
161+
# the Win7 binary loadable (Rust 1.78+ raised Windows MSRV to Win10).
162+
- uses: dtolnay/rust-toolchain@master
145163
if: matrix.mipsel_softfloat != true
146164
with:
165+
toolchain: ${{ matrix.rust_toolchain || 'stable' }}
147166
targets: ${{ matrix.target }}
148167

149168
# Cache target/ + cargo registry across runs — this is the big
@@ -162,7 +181,11 @@ jobs:
162181
- uses: Swatinem/rust-cache@v2
163182
if: matrix.mipsel_softfloat != true
164183
with:
165-
key: ${{ matrix.target }}
184+
# Include toolchain in the cache key so a pinned-Rust target
185+
# (i686-pc-windows-msvc on 1.77.2) doesn't collide with
186+
# stable-Rust caches for other targets, and a future toolchain
187+
# bump invalidates only the affected slot.
188+
key: ${{ matrix.target }}-${{ matrix.rust_toolchain || 'stable' }}
166189
cache-bin: "false"
167190

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

0 commit comments

Comments
 (0)