4040 - os : ubuntu-22.04
4141 target : x86_64-unknown-linux-gnu
4242 sidecar_name : rustfava-server-x86_64-unknown-linux-gnu
43- - os : macos-latest
43+ # PyInstaller cannot cross-compile: it emits a binary for the
44+ # runner's own arch. macos-latest is now Apple Silicon, so the x64
45+ # sidecar must build on a real Intel runner (issue #193).
46+ - os : macos-13
4447 target : x86_64-apple-darwin
4548 sidecar_name : rustfava-server-x86_64-apple-darwin
4649 - os : macos-14
@@ -66,13 +69,17 @@ jobs:
6669 env :
6770 GH_TOKEN : ${{ github.token }}
6871
69- - name : Download rustledger WASM from release
72+ - name : Download rustledger component WASM from release
7073 shell : bash
74+ # The in-process WASI Preview 2 component is the engine; the frozen app
75+ # bundles it (see contrib/pyinstaller_spec.spec) so it need not download
76+ # at first run. The legacy rustledger-ffi-wasi-*.wasm is no longer
77+ # shipped upstream (rustledger #1419).
7178 run : |
7279 gh release download ${{ steps.rustledger-tag.outputs.tag }} \
7380 --repo ${{ env.RUSTLEDGER_REPO }} \
74- --pattern "rustledger-ffi-wasi -*.wasm" \
75- --output src/rustfava/rustledger/rustledger-wasi .wasm
81+ --pattern "rustledger-ffi-component -*.wasm" \
82+ --output src/rustfava/rustledger/rustledger_ffi_component .wasm
7683 env :
7784 GH_TOKEN : ${{ github.token }}
7885
@@ -115,6 +122,13 @@ jobs:
115122 print(f'Compiled {po} -> {mo}')
116123 "
117124
125+ - name : Set RUSTFAVA_VERSION from tag
126+ # The spec bakes this into rustfava/_version.py so the frozen binary
127+ # reports the real version without dist-info metadata (issue #191).
128+ if : startsWith(github.ref, 'refs/tags/')
129+ shell : bash
130+ run : echo "RUSTFAVA_VERSION=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_ENV"
131+
118132 - name : Build sidecar with PyInstaller
119133 shell : bash
120134 run : |
@@ -130,6 +144,24 @@ jobs:
130144 run : |
131145 move dist\rustfava.exe dist\${{ matrix.sidecar_name }}
132146
147+ - name : Verify sidecar architecture (macOS)
148+ if : runner.os == 'macOS'
149+ shell : bash
150+ run : |
151+ BIN="dist/${{ matrix.sidecar_name }}"
152+ file "$BIN"
153+ case "${{ matrix.target }}" in
154+ x86_64-*) EXPECT="x86_64" ;;
155+ aarch64-*) EXPECT="arm64" ;;
156+ *) echo "::error::Unknown macOS target ${{ matrix.target }}"; exit 1 ;;
157+ esac
158+ # Use `file -b` (no filename) so the sidecar_name — which itself
159+ # contains "x86_64"/"aarch64" — can't false-match the grep.
160+ if ! file -b "$BIN" | grep -qw "$EXPECT"; then
161+ echo "::error::Sidecar arch mismatch: expected $EXPECT for ${{ matrix.target }}, got: $(file -b "$BIN")"
162+ exit 1
163+ fi
164+
133165 - name : Upload sidecar artifact
134166 uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
135167 with :
@@ -214,7 +246,9 @@ jobs:
214246 - os : ubuntu-22.04
215247 target : x86_64-unknown-linux-gnu
216248 sidecar_name : rustfava-server-x86_64-unknown-linux-gnu
217- - os : macos-latest
249+ # Intel runner: builds x86_64 natively so the smoke test can launch
250+ # the binary (an arm64 runner has no Rosetta by default), issue #193.
251+ - os : macos-13
218252 target : x86_64-apple-darwin
219253 sidecar_name : rustfava-server-x86_64-apple-darwin
220254 - os : macos-14
@@ -313,6 +347,26 @@ jobs:
313347 ls -la "$APP_PATH" || { echo "App bundle not found!"; exit 1; }
314348 file "$BINARY"
315349
350+ # Verify the bundled sidecar matches the target arch (issue #193).
351+ # Tauri strips the target triple, so the bundled name is plain
352+ # `rustfava-server` (no arch substring to confuse the grep).
353+ SIDECAR="$APP_PATH/Contents/MacOS/rustfava-server"
354+ if [ -f "$SIDECAR" ]; then
355+ file "$SIDECAR"
356+ case "${{ matrix.target }}" in
357+ x86_64-*) EXPECT="x86_64" ;;
358+ aarch64-*) EXPECT="arm64" ;;
359+ *) echo "::error::Unknown macOS target ${{ matrix.target }}"; exit 1 ;;
360+ esac
361+ if ! file -b "$SIDECAR" | grep -qw "$EXPECT"; then
362+ echo "::error::Bundled sidecar arch mismatch: expected $EXPECT for ${{ matrix.target }}, got: $(file -b "$SIDECAR")"
363+ exit 1
364+ fi
365+ else
366+ echo "::error::Bundled sidecar not found at $SIDECAR"
367+ exit 1
368+ fi
369+
316370 # Run binary directly to capture stdout/stderr and panic backtrace
317371 echo "=== Launching with RUST_BACKTRACE=full ==="
318372 RUST_BACKTRACE=full RUST_LOG=debug "$BINARY" > /tmp/app.log 2>&1 &
0 commit comments