Skip to content

Commit 9f55998

Browse files
jrrayclaude
andcommitted
Add Windows cross-compile to CI matrix
Add a new matrix-build entry that cross-compiles for x86_64-pc-windows-gnu from the same Linux container used by the existing matrix builds. This verifies the cross-compilation support and prevents regressions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: J Robert Ray <jrray@jrray.org>
1 parent 2a82af4 commit 9f55998

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

.github/workflows/rust.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ jobs:
196196
crates/spfs/tests/integration/run_privileged_tests.sh
197197
198198
matrix-build:
199-
name: build features ${{ matrix.no-default-features }} ${{ matrix.features }}
199+
name: build ${{ matrix.platform }} features ${{ matrix.no-default-features }} ${{ matrix.features }}
200200
runs-on: ubuntu-latest
201201
timeout-minutes: 45
202202
container:
@@ -209,12 +209,24 @@ jobs:
209209
strategy:
210210
fail-fast: false
211211
matrix:
212+
platform:
213+
- linux
212214
features:
213215
# SPI's standand features
214216
- migration-to-components,sentry,spfs/protobuf-src,spfs-vfs/protobuf-src,statsd,fuse-backend-rhel-7-6
215217
no-default-features:
216218
- ""
217219
- --no-default-features
220+
target:
221+
- ""
222+
exclude_crates:
223+
- ""
224+
include:
225+
- platform: windows
226+
features: server,spfs/server
227+
no-default-features: ""
228+
target: x86_64-pc-windows-gnu
229+
exclude_crates: --exclude spfs-cli-winfsp --workspace
218230
steps:
219231
- name: Cancel Previous Runs
220232
uses: styfle/cancel-workflow-action@0.11.0
@@ -229,6 +241,11 @@ jobs:
229241
curl --proto '=https' --tlsv1.2 -sSfL ${FB_REL}/download/v23.5.26/Linux.flatc.binary.g++-10.zip | funzip > /usr/bin/flatc
230242
chmod +x /usr/bin/flatc
231243
rustup component add clippy
244+
- name: Setup cross-compilation
245+
if: matrix.platform == 'windows'
246+
run: |
247+
apt-get install -y gcc-mingw-w64-x86-64
248+
rustup target add ${{ matrix.target }}
232249
- name: Configure cargo
233250
run: |
234251
mkdir -p .cargo
@@ -238,6 +255,14 @@ jobs:
238255
# can't cache incremental compiles.
239256
incremental = false
240257
EOF
258+
- name: Configure cross-compile linker
259+
if: matrix.platform == 'windows'
260+
run: |
261+
cat << 'EOF' >> .cargo/config.toml
262+
[target.x86_64-pc-windows-gnu]
263+
linker = "x86_64-w64-mingw32-gcc"
264+
ar = "x86_64-w64-mingw32-gcc-ar"
265+
EOF
241266
- name: Run sccache-cache
242267
uses: mozilla-actions/sccache-action@v0.0.9
243268
- name: Restore ast-grep cache
@@ -263,3 +288,5 @@ jobs:
263288
${{ matrix.no-default-features }}
264289
--features "${{ matrix.features }}"
265290
--all-targets
291+
${{ matrix.target && format('--target {0}', matrix.target) || '' }}
292+
${{ matrix.exclude_crates }}

0 commit comments

Comments
 (0)