Skip to content

Commit 939758e

Browse files
wehosHongzhi Wenclaude
authored
fix(ci): gate steamworks native libs by RUNNER_OS in Nuitka build (#1303)
#1285 added `if -f` guards but only on file presence. All platforms' libs are checked into steamworks/, so on macOS the Linux ELF .so also passes the check and gets fed to Nuitka, which aborts during link: FATAL: Error, cannot use file '.../steamworks/SteamworksPy.so' (ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), ...) to build arch 'arm64' result Wrap the .dylib block in `$RUNNER_OS == macOS` and the .so block in Linux. Windows is unaffected (its cmd branch only runs on Windows). Failing run: https://github.com/Project-N-E-K-O/N.E.K.O/actions/runs/25647861208 Co-authored-by: Hongzhi Wen <cartabio.coder1@gmail.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 47b2b1b commit 939758e

1 file changed

Lines changed: 16 additions & 11 deletions

File tree

.github/workflows/build-desktop.yml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -362,18 +362,23 @@ jobs:
362362
# Steam files (include if present in repo).
363363
# PR #1264 moved native libs into steamworks/; runtime still loads them
364364
# from the exe sibling dir (see steamworks/__init__.py), so dest stays at root.
365+
# Gate by RUNNER_OS: all platforms' libs are checked into the repo, but
366+
# feeding a Linux ELF .so to a macOS Nuitka build trips an arch-mismatch FATAL.
365367
NUITKA_OPTS="$NUITKA_OPTS --include-data-files=steam_appid.txt=steam_appid.txt"
366-
if [ -f "steamworks/libsteam_api.dylib" ]; then
367-
NUITKA_OPTS="$NUITKA_OPTS --include-data-files=steamworks/libsteam_api.dylib=libsteam_api.dylib"
368-
fi
369-
if [ -f "steamworks/SteamworksPy.dylib" ]; then
370-
NUITKA_OPTS="$NUITKA_OPTS --include-data-files=steamworks/SteamworksPy.dylib=SteamworksPy.dylib"
371-
fi
372-
if [ -f "steamworks/libsteam_api.so" ]; then
373-
NUITKA_OPTS="$NUITKA_OPTS --include-data-files=steamworks/libsteam_api.so=libsteam_api.so"
374-
fi
375-
if [ -f "steamworks/SteamworksPy.so" ]; then
376-
NUITKA_OPTS="$NUITKA_OPTS --include-data-files=steamworks/SteamworksPy.so=SteamworksPy.so"
368+
if [[ "$RUNNER_OS" == "macOS" ]]; then
369+
if [ -f "steamworks/libsteam_api.dylib" ]; then
370+
NUITKA_OPTS="$NUITKA_OPTS --include-data-files=steamworks/libsteam_api.dylib=libsteam_api.dylib"
371+
fi
372+
if [ -f "steamworks/SteamworksPy.dylib" ]; then
373+
NUITKA_OPTS="$NUITKA_OPTS --include-data-files=steamworks/SteamworksPy.dylib=SteamworksPy.dylib"
374+
fi
375+
elif [[ "$RUNNER_OS" == "Linux" ]]; then
376+
if [ -f "steamworks/libsteam_api.so" ]; then
377+
NUITKA_OPTS="$NUITKA_OPTS --include-data-files=steamworks/libsteam_api.so=libsteam_api.so"
378+
fi
379+
if [ -f "steamworks/SteamworksPy.so" ]; then
380+
NUITKA_OPTS="$NUITKA_OPTS --include-data-files=steamworks/SteamworksPy.so=SteamworksPy.so"
381+
fi
377382
fi
378383
379384
echo "=== Nuitka options ==="

0 commit comments

Comments
 (0)