fix(agent): clang gets the fetched sysroot on Linux, and a damaged Longshot clone is cloned again #59

Merged
HumanBean merged 1 commit from HumanBean/Beanstalk:fix/linux-sysroot-reclone into main 2026-11-16 11:17:43 +00:00
Owner

Why

With nightly-106, the Steam Deck's ZBIC build passed (#56), and its next job reached the base build. That build then stopped in Longshot's a64emit build (rp_a057a1feeb378777, #637):

third_party/a64-kit/lift/suyu/arm64_to_c.h:15:10: fatal error: 'algorithm' file not found

Longshot builds its host libraries (third_party/a64-kit/lift/build_emit.py, nx2/zbic.py) with the fetched clang, but without the fetched sysroot and lld, which the game's own compile and link name. So they need the system's C and C++ headers and linker, which SteamOS doesn't have.

On Tommy's PC, after the lease losses and a git checkout killed with 0xC000013A, the next job failed with "main has no commit 02608169e638". That commit is on main, and the fetch of main went through, so the clone itself is damaged.

What changed

  • Workspace.LinuxClangOverride: on Linux, sandboxed builds get CCC_OVERRIDE_OPTIONS=# ^-Qunused-arguments ^-fuse-ld=lld ^--sysroot=<fetched sysroot>.
    • Every clang the build starts gets these first. A compile that names its own --sysroot or -fuse-ld, like the game's, still gets its own, because the last one wins.
    • -Qunused-arguments keeps compile-only calls quiet about -fuse-ld.
    • Nothing is set without the fetched emsdk and sysroot, when linux_tools.py already set the variable, or when the path has a space.
  • A Longshot clone that lacks a commit of main after fetching main is removed and cloned again, once (Workspace.RecloneAsync). If the commit is still missing, the error quotes git cat-file's own words.

Testing

  • Agent checks: 1857 passed, with 4 new ones for the override. dotnet build agent/App -c Release: 0 warnings.
  • SteamOS-like, on this PC. I fetched main's real Linux tools with builder/linux/linux_tools.py env --install, then ran the builds in bwrap with /usr/include and /usr/lib/gcc emptied and /usr/bin/ld hidden:
    • without the override, build_emit.py fails with the Deck's exact error ("'algorithm' file not found"), and zbic.py's build fails with "'string.h' file not found";
    • with it, both build, and liba64emit.so and zbic.so load.
  • Longshot's Python build scripts call no emcc and use no -Werror, so nothing else should be affected.
  • The re-clone has no check of its own: the agent's git refuses the local file transport, which a local origin would need. It runs only when a fetched main still lacks the commit.
## Why With nightly-106, the Steam Deck's ZBIC build passed (#56), and its next job reached the base build. That build then stopped in Longshot's `a64emit` build ([rp_a057a1feeb378777](https://beanstalk.magicbean.dev/reports/rp_a057a1feeb378777), #637): ``` third_party/a64-kit/lift/suyu/arm64_to_c.h:15:10: fatal error: 'algorithm' file not found ``` Longshot builds its host libraries (`third_party/a64-kit/lift/build_emit.py`, `nx2/zbic.py`) with the fetched clang, but without the fetched sysroot and lld, which the game's own compile and link name. So they need the system's C and C++ headers and linker, which SteamOS doesn't have. On Tommy's PC, after the lease losses and a `git checkout` killed with 0xC000013A, the next job failed with "main has no commit 02608169e638". That commit is on main, and the fetch of main went through, so the clone itself is damaged. ## What changed - `Workspace.LinuxClangOverride`: on Linux, sandboxed builds get `CCC_OVERRIDE_OPTIONS=# ^-Qunused-arguments ^-fuse-ld=lld ^--sysroot=<fetched sysroot>`. - Every clang the build starts gets these first. A compile that names its own `--sysroot` or `-fuse-ld`, like the game's, still gets its own, because the last one wins. - `-Qunused-arguments` keeps compile-only calls quiet about `-fuse-ld`. - Nothing is set without the fetched emsdk and sysroot, when `linux_tools.py` already set the variable, or when the path has a space. - A Longshot clone that lacks a commit of main after fetching main is removed and cloned again, once (`Workspace.RecloneAsync`). If the commit is still missing, the error quotes `git cat-file`'s own words. ## Testing - Agent checks: 1857 passed, with 4 new ones for the override. `dotnet build agent/App -c Release`: 0 warnings. - **SteamOS-like, on this PC.** I fetched main's real Linux tools with `builder/linux/linux_tools.py env --install`, then ran the builds in bwrap with `/usr/include` and `/usr/lib/gcc` emptied and `/usr/bin/ld` hidden: - without the override, `build_emit.py` fails with the Deck's exact error ("'algorithm' file not found"), and `zbic.py`'s build fails with "'string.h' file not found"; - with it, both build, and `liba64emit.so` and `zbic.so` load. - Longshot's Python build scripts call no emcc and use no `-Werror`, so nothing else should be affected. - The re-clone has no check of its own: the agent's git refuses the local file transport, which a local origin would need. It runs only when a fetched main still lacks the commit.
fix(agent): clang gets the fetched sysroot on Linux, and a damaged Longshot clone is cloned again
Some checks are pending
CI / Coordinator tests (pull_request) Waiting to run
CI / Agent build and checks (pull_request) Waiting to run
CI / Coordinator image (pull_request) Waiting to run
CI / Conventional Commit title (pull_request) Successful in 8s
CI / Workflow lint (actionlint) (pull_request) Successful in 7s
847447aadf
On a Steam Deck the base build stopped in Longshot's a64emit build:
"'algorithm' file not found". Longshot's host libraries (a64emit, the ZBIC
reader) are compiled without the fetched sysroot and lld, so they need
the system's headers and linker, which SteamOS lacks. Every clang of the
Linux build now gets them first through CCC_OVERRIDE_OPTIONS; a compile
that names its own --sysroot or -fuse-ld still gets that, as the last one
wins.

A Windows clone whose git was killed mid-checkout then lacked main's
commit even after fetching main ("main has no commit 02608169e638").
The agent now removes such a clone and clones again once, and the error
quotes git's own words if the commit is still missing.

Assisted-by: Claude Opus 5.5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
HumanBean deleted branch fix/linux-sysroot-reclone 2026-11-16 11:17:43 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Beanstalk!59
No description provided.