Skip to content

feat(launcher): build Going Commando on Linux (SteamOS) with a carried compiler - #2

Closed
DrLegitamate wants to merge 2 commits into
developfrom
claude/quirky-turing-e54uxd
Closed

DrLegitamate wants to merge 2 commits into
developfrom
claude/quirky-turing-e54uxd

Conversation

@DrLegitamate

Copy link
Copy Markdown
Owner

On SteamOS, building Going Commando from the launcher stopped with "Ninja was not found". Ninja was only the first missing tool. A stock Steam Deck has git and none of the build tools (pacman -Q shows no cmake, clang, gcc, ninja or make). Its system headers are stripped and its root filesystem is read-only. So the Linux installers' build from source (tools/build_game.py) can't work there.

Linux part build (the SteamOS fix)

The Linux installers (AppImage, .deb, .rpm) now do what the Windows one has done since OpenRAC#326. They carry three things:

  • the game built without the disc;
  • a kit: hostgen's output plus the headers the translated code includes;
  • Zig's Linux program (Clang and lld, 0.14.1, the release the Android build already pins).

tools/asm_part.py then builds the functions still in assembly into a .so on the player's computer. Nothing is installed or downloaded and no root is needed.

  • asm_part.py: kit --linux-zig puts the glibc and Linux headers from Zig's release in the kit, compiled for glibc 2.35, so the system's own headers are never read. The part links nothing.
  • cmake/Games.cmake: on Linux the program already exports its names (ENABLE_EXPORTS). Each name in asm_part_exports.def is now also passed to the linker with -u, so its object is always linked in. The names are bound when the game loads the part.
  • bundle_standalone.py: the Windows-only carried-part path now also covers Linux, taking the kit's target from kit.json. A Linux copy offers the part build instead of build_game.py.
  • launcher.yml: the linux, linux-arm64 and fedora rows build rac2-ntsc without the disc, fetch the pinned Zig and check its SHA-256, make and check the kit, and check it again from the assembled copy.
  • macOS is unchanged: it keeps the build from source.
  • Each Linux installer grows by about 35 to 52 MB, depending on the package's compression.

Ninja fix (separate commit)

When PATH has no Ninja on Linux, tools/build_port.py now downloads Ninja 1.13.2's official release into ~/.cache/openrac/toolchains/ninja. Both the archive and the program are checked against pinned SHA-256 values, the download is moved into place atomically, and a valid cached copy is reused. Nothing is written into the AppImage. A build folder configured from an earlier AppImage mount, whose Python or Ninja path has gone, is configured again with the current ones. Windows and macOS are unchanged.

Linux installers no longer take this route for Going Commando. It still helps Linux checkouts.

Verified (Ubuntu container, not SteamOS; no disc)

  • Going Commando built without the disc (headless preset, enhanced rendering off) exports all 2,201 names the part needs.
  • A Linux kit made with Zig 0.14.1 reads no header outside the kit (55 headers checked).
  • A part built through asm_part.py's Linux path that refers to every name loads in the real game. A part naming a missing function stops with undefined symbol: <name>.
  • A copy made by bundle_standalone.py builds the kit's check with its own Zig.
  • A real Ninja download, configure and build with no Ninja on PATH works, and a second run reuses the cached copy.
  • All 356 tools tests pass on Python 3.13 and 3.12.

Not verified

  • A part built from a real disc, and play.
  • The new CI steps, the standalone preset with ThinLTO, and the ARM64 and Fedora rows.
  • SteamOS itself, including the launcher's button and Game Mode.

Generated by Claude Code

SteamOS has no Ninja, and its system is read-only: tools/build_port.py
stopped with "Ninja was not found". On Linux, when PATH has no Ninja, the
build downloads Ninja 1.13.2's official release into
~/.cache/openrac/toolchains/ninja (XDG_CACHE_HOME first), checks the
archive and the program against their SHA-256, and puts it first on PATH
for CMake and every build it starts. A whole cached copy is used again
without the network; a corrupted or half-written one is replaced. Nothing
is written beside the program: an AppImage's mount is read-only.

A build folder configured from an earlier AppImage mount names a Python,
and could name a Ninja, that is gone: it is configured again with the
current ones. Windows and macOS are unchanged.

Verified on Linux (not SteamOS): unit tests with the network mocked, and
a real download, configure and build with no Ninja on PATH, then a second
run that reused it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017f7s8Mhbo9Ew2tbcLKXC66
SteamOS has no compiler, CMake, Ninja or make, strips its system headers
and is read-only, so the Linux installers' build from source
(tools/build_game.py) could not work there. The Linux installers now do
as the Windows one does: they carry the game built without the disc, a
kit, and Zig's Linux program (Clang and lld), and tools/asm_part.py builds
the functions still in assembly into a .so on the player's computer.

The Linux kit (asm_part.py kit --linux-zig) carries the glibc and Linux
headers from Zig's release, compiled for glibc 2.35, so the system's own
headers are never read. The part links nothing: the program exports its
names (ENABLE_EXPORTS), each one asm_part_exports.def lists is linked in
(-u, cmake/Games.cmake), and they are bound when the game loads the part.
macOS keeps the build from source.

Verified on Linux (Ubuntu, not SteamOS), without a disc: Going Commando
built without the disc (headless preset, enhanced rendering off) exports
all 2201 names; a Linux kit made with Zig 0.14.1 reads no header outside
itself; a part built through asm_part.py's Linux path that refers to
every name loads in the game, and one naming a missing function stops
with that name; a copy made by bundle_standalone.py builds the kit's
check with its own Zig. Not verified: a part from a real disc, play, CI's
new steps, the standalone preset, ARM64, SteamOS itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017f7s8Mhbo9Ew2tbcLKXC66
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants