WIP: fix(builder): the release's builder links its C++ runtime in again: longshot_builder.py build's flags are whole #2824

Closed
llun wants to merge 2 commits from fix/mod-api-builder-flags into mod-api
Member

Summary

For #2822 (into mod-api). scripts/longshot_builder.py build, which makes the release's builder, adds glslang's C++ runtime to rustc's flags with flags += " -C link-arg=-l:libc++.a -C link-arg=-l:libc++abi.a" (Windows) and flags += " -C link-arg=-l:libstdc++.a" (Linux). flags is a list since #2732, so the string goes in one character at a time: CARGO_ENCODED_RUSTFLAGS holds " ", "-", "C", " ", "l", ... and the link-args never reach rustc as flags. This adds them as list items, like the rest of the function's flags.

Read first: cmd_build in scripts/longshot_builder.py.

Testing

Tested: Windows 11, mise run test -- test_longshot_builder. The check now looks for the C++ runtime's link-args, each one whole, and asks that no flag is a single character. It fails on mod-api @ eaf4a48b (['-C', 'link-arg=-l:libc++.a'] not found in [... [' ', '-'], ['-', 'C'] ...], the same on the Linux side with -l:libstdc++.a) and passes here. mise run lint passes.

Still to test:

  • Release CI: build the release's builder for windows-x64 and linux-x64 with scripts/longshot_builder.py build, expecting it to link with glslang's C++ runtime static and pass check (by hand, a maintainer: it needs the pinned toolchain's download)

Measurements

Verdict: fixed. The release's C++ runtime link-args reach rustc whole: the check fails on mod-api and passes here.

Baseline: mod-api (#2822's head), the branch this PR goes into: the bug is there, not on main.

Setup: Windows 11, mise run test -- test_longshot_builder (its Windows and Linux cases, with longshot_builder.py build's cargo run stood in). The game and a build's speed are not affected: only the flags change.

Before: mod-api @ eaf4a48b After: this PR @ a96a9b63d
tests/test_longshot_builder.py FAIL: ['-C', 'link-arg=-l:libc++.a'] not found (the flags ' ', '-', 'C', ... one character each) pass

Risks

The sandbox: not touched. This is the release's build script for the builder: it links the builder's own C++ runtime in. What the builder confines, grants and serves to the game is the same code.

Only the release's longshot_builder.py build changes: its C++ runtime flags now reach rustc. A revert is enough. Players notice nothing.

Checklist

Ready for review

  • One topic, on current mod-api (#2822's head); the title is a Conventional Commit.
  • Tested on my own PC, as Testing says (a script and its check: no game run).
  • mise run test passes (any failure that also fails on main is named). (This check passes. The whole suite on mod-api has Windows-only failures, which another PR into mod-api fixes.)
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here. (It fails on mod-api, where the bug is.)
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.

🤖 Generated with Claude Code

## Summary For [#2822](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2822) (into `mod-api`). `scripts/longshot_builder.py build`, which makes the release's builder, adds glslang's C++ runtime to rustc's flags with `flags += " -C link-arg=-l:libc++.a -C link-arg=-l:libc++abi.a"` (Windows) and `flags += " -C link-arg=-l:libstdc++.a"` (Linux). `flags` is a list since [#2732](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2732), so the string goes in one character at a time: `CARGO_ENCODED_RUSTFLAGS` holds `" "`, `"-"`, `"C"`, `" "`, `"l"`, ... and the link-args never reach rustc as flags. This adds them as list items, like the rest of the function's flags. Read first: `cmd_build` in `scripts/longshot_builder.py`. ## Testing **Tested:** Windows 11, `mise run test -- test_longshot_builder`. The check now looks for the C++ runtime's link-args, each one whole, and asks that no flag is a single character. It fails on `mod-api` @ eaf4a48b (`['-C', 'link-arg=-l:libc++.a'] not found in [... [' ', '-'], ['-', 'C'] ...]`, the same on the Linux side with `-l:libstdc++.a`) and passes here. `mise run lint` passes. **Still to test:** - Release CI: build the release's builder for windows-x64 and linux-x64 with `scripts/longshot_builder.py build`, expecting it to link with glslang's C++ runtime static and pass `check` (by hand, a maintainer: it needs the pinned toolchain's download) ## Measurements **Verdict:** fixed. The release's C++ runtime link-args reach rustc whole: the check fails on `mod-api` and passes here. Baseline: `mod-api` (#2822's head), the branch this PR goes into: the bug is there, not on `main`. Setup: Windows 11, `mise run test -- test_longshot_builder` (its Windows and Linux cases, with `longshot_builder.py build`'s cargo run stood in). The game and a build's speed are not affected: only the flags change. | | Before: mod-api @ eaf4a48b | After: this PR @ a96a9b63d | |---|---|---| | `tests/test_longshot_builder.py` | FAIL: `['-C', 'link-arg=-l:libc++.a'] not found` (the flags `' '`, `'-'`, `'C'`, ... one character each) | pass | ## Risks **The sandbox:** not touched. This is the release's build script for the builder: it links the builder's own C++ runtime in. What the builder confines, grants and serves to the game is the same code. Only the release's `longshot_builder.py build` changes: its C++ runtime flags now reach rustc. A revert is enough. Players notice nothing. ## Checklist ### Ready for review - [x] One topic, on current `mod-api` (#2822's head); the title is a Conventional Commit. - [x] Tested on my own PC, as Testing says (a script and its check: no game run). - [ ] `mise run test` passes (any failure that also fails on `main` is named). (This check passes. The whole suite on `mod-api` has Windows-only failures, which another PR into `mod-api` fixes.) - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. (It fails on `mod-api`, where the bug is.) - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(game)!: the game side and the whole mod API in Rust, with system mods and the sandbox on by default
Some checks failed
CI / Third-party parts and guide screenshots (pull_request) Successful in 28s
PR description / Title and description (pull_request_target) Successful in 47s
CI / What the change needs (pull_request) Successful in 2m21s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 1m48s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
9e6b9c5782
The game side (between the C host and the lifted game) and the mod API move from C to Rust (game/crates), every game
setting and feature becomes a system mod (game/mods, Rust or TypeScript), and longshot-builder becomes the game's only
entrypoint, its sandboxer (Landlock and seccomp on Linux, an AppContainer on Windows) and its broker over one framed
channel. Native C mods and wasm are removed. The Insert menu is the menu system mod. One squashed commit of the former
mod-api branch (#2434).

Co-authored-by: Chloe Christley <[email protected]>
Co-authored-by: Jer9 <[email protected]>
Co-authored-by: snaildev99 <[email protected]>
Co-authored-by: SqueezyLemonade <[email protected]>
Co-authored-by: flashman4 <[email protected]>
Co-authored-by: dyst <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The release's builder links glslang's C++ runtime in (-l:libc++.a, -l:libc++abi.a on Windows, -l:libstdc++.a on
Linux). The check now looks for them in CARGO_ENCODED_RUSTFLAGS, each flag whole, and asks that no flag is one
character. It fails on mod-api: the flags are added to the list as a string, one character at a time.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(builder): the release's builder links its C++ runtime in again: longshot_builder.py build's flags are whole
All checks were successful
PR description / Title and description (pull_request_target) Successful in 38s
50a0a69717
`flags += " -C link-arg=..."` added a string to the list of rustc's flags one character at a time, so
CARGO_ENCODED_RUSTFLAGS held " ", "-", "C", ... and the release's builder (both systems) did not get its
-l:libc++.a / -l:libstdc++.a. The flags are now list items, as the rest of the function's are.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Measurements: the check's result before (mod-api @ 9e6b9c57, fails) and after (50a0a697, passes), with a Baseline line, as standards.md's Measurements asks of a fix.

Measurements: the check's result before (mod-api @ 9e6b9c57, fails) and after (50a0a697, passes), with a Baseline line, as standards.md's Measurements asks of a fix.
llun force-pushed fix/mod-api-builder-flags from 50a0a69717
All checks were successful
PR description / Title and description (pull_request_target) Successful in 38s
to 77ec30c293
All checks were successful
PR description / Title and description (pull_request_target) Successful in 12s
2026-11-29 22:15:14 +00:00
Compare
Author
Member

Rebased onto mod-api's new squash eaf4a48b (the same tree as 9e6b9c57, which this branch was on): the diff is this PR's own commits again. The checks and runs above hold as they are (the tree under them is unchanged); the description's commits are the new ones.

Rebased onto mod-api's new squash eaf4a48b (the same tree as 9e6b9c57, which this branch was on): the diff is this PR's own commits again. The checks and runs above hold as they are (the tree under them is unchanged); the description's commits are the new ones.
Author
Member

Risks now says how this change stands with the sandbox (what it touches, and why the confined game reaches nothing more).

Risks now says how this change stands with the sandbox (what it touches, and why the confined game reaches nothing more).
llun force-pushed fix/mod-api-builder-flags from 77ec30c293
All checks were successful
PR description / Title and description (pull_request_target) Successful in 12s
to d30e8cdd29
All checks were successful
PR description / Title and description (pull_request_target) Successful in 14s
2026-11-29 23:27:28 +00:00
Compare
Author
Member

Rebased onto mod-api's newest (4cc50ca1: main's newest merged in), with no conflict; this PR's own checks were run again on the rebased head and pass as before. The merge touched none of this PR's files (#2827: only a comment in host/hos_main.c, far from its change), so the measurements and runs above hold; the After commit is the rebased head.

Rebased onto mod-api's newest (4cc50ca1: main's newest merged in), with no conflict; this PR's own checks were run again on the rebased head and pass as before. The merge touched none of this PR's files (#2827: only a comment in host/hos_main.c, far from its change), so the measurements and runs above hold; the After commit is the rebased head.
llun force-pushed fix/mod-api-builder-flags from d30e8cdd29
All checks were successful
PR description / Title and description (pull_request_target) Successful in 14s
to d58044ad26
All checks were successful
PR description / Title and description (pull_request_target) Successful in 14s
2026-11-29 23:58:23 +00:00
Compare
Author
Member

Rebased onto mod-api @ 816d2354 (#2837, headless shots of the mods' UI), now d58044ad. No conflict, and the diff is the same as before (same git patch-id). #2837 touches none of this PR's files.

Rebased onto `mod-api` @ 816d2354 ([#2837](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2837), headless shots of the mods' UI), now d58044ad. No conflict, and the diff is the same as before (same `git patch-id`). #2837 touches none of this PR's files.
llun force-pushed fix/mod-api-builder-flags from d58044ad26
All checks were successful
PR description / Title and description (pull_request_target) Successful in 14s
to daf95b29ef
All checks were successful
PR description / Title and description (pull_request_target) Successful in 15s
2026-11-30 00:38:34 +00:00
Compare
llun force-pushed fix/mod-api-builder-flags from daf95b29ef
All checks were successful
PR description / Title and description (pull_request_target) Successful in 15s
to 3628cf9a97
All checks were successful
PR description / Title and description (pull_request_target) Successful in 22s
2026-11-30 00:42:56 +00:00
Compare
Author
Member

Rebased onto mod-api @ c5e5b676: it was re-squashed onto main @ 46291934 (#2833) twice today (cdbb8551, then c5e5b676), which made this PR show main's and the whole mod API's diff. Now 3628cf9a, the same diff as before (same git patch-id), no conflict. The changes underneath touch none of this PR's files, so its checks still hold.

Rebased onto `mod-api` @ c5e5b676: it was re-squashed onto main @ 46291934 (#2833) twice today (cdbb8551, then c5e5b676), which made this PR show main's and the whole mod API's diff. Now 3628cf9a, the same diff as before (same `git patch-id`), no conflict. The changes underneath touch none of this PR's files, so its checks still hold.
llun force-pushed fix/mod-api-builder-flags from 3628cf9a97
All checks were successful
PR description / Title and description (pull_request_target) Successful in 22s
to d4fcd9d066
All checks were successful
PR description / Title and description (pull_request_target) Successful in 20s
2026-11-30 01:32:26 +00:00
Compare
Author
Member

Rebased onto mod-api @ 537c2816 (#2848, game-free checks' fixtures only), now d4fcd9d0: the same diff (same git patch-id), no conflict. #2848 touches none of this PR's files, so its checks still hold.

Rebased onto `mod-api` @ 537c2816 ([#2848](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2848), game-free checks' fixtures only), now d4fcd9d0: the same diff (same `git patch-id`), no conflict. #2848 touches none of this PR's files, so its checks still hold.
llun force-pushed fix/mod-api-builder-flags from d4fcd9d066
All checks were successful
PR description / Title and description (pull_request_target) Successful in 20s
to 6e7f327069
All checks were successful
PR description / Title and description (pull_request_target) Successful in 10s
2026-11-30 02:14:00 +00:00
Compare
Author
Member

Rebased onto mod-api aea64d3a (#2745 nav.closest, one new commit): d4fcd9d0 -> 6e7f3270, the same diff (git patch-id unchanged), so the checks and runs above still hold; none of this PR's files changed on mod-api. The description's head hash is updated.

Rebased onto mod-api aea64d3a (#2745 nav.closest, one new commit): d4fcd9d0 -> 6e7f3270, the same diff (git patch-id unchanged), so the checks and runs above still hold; none of this PR's files changed on mod-api. The description's head hash is updated.
llun force-pushed fix/mod-api-builder-flags from 6e7f327069
All checks were successful
PR description / Title and description (pull_request_target) Successful in 10s
to 93c9fb516f
All checks were successful
PR description / Title and description (pull_request_target) Successful in 9s
2026-11-30 03:14:02 +00:00
Compare
Author
Member

Rebased onto the new mod-api cb37f5ab (#2851 native mouse camera, #2852 modding docs), which touch none of this PR's files: the same patch (same patch-id), head 93c9fb51.

Rebased onto the new `mod-api` cb37f5ab (#2851 native mouse camera, #2852 modding docs), which touch none of this PR's files: the same patch (same patch-id), head 93c9fb51.
llun force-pushed fix/mod-api-builder-flags from 93c9fb516f
All checks were successful
PR description / Title and description (pull_request_target) Successful in 9s
to 97708ddc4b
All checks were successful
PR description / Title and description (pull_request_target) Successful in 9s
2026-11-30 04:14:10 +00:00
Compare
Author
Member

Rebased onto mod-api @ 12f42db5 (#2855 rustfmt of nav.closest, #2861 menu rows by place): head 93c9fb516 -> 97708ddc4, the same diff (patch-id unchanged); neither commit touches this PR's files.

Rebased onto mod-api @ 12f42db5 (#2855 rustfmt of nav.closest, #2861 menu rows by place): head 93c9fb516 -> 97708ddc4, the same diff (patch-id unchanged); neither commit touches this PR's files.
llun force-pushed fix/mod-api-builder-flags from 97708ddc4b
All checks were successful
PR description / Title and description (pull_request_target) Successful in 9s
to ddcbb36a43
All checks were successful
PR description / Title and description (pull_request_target) Successful in 6s
2026-11-30 18:09:57 +00:00
Compare
Author
Member

Rebased onto mod-api @ 75bcd270 (#2881 a mod adds a game language): head 97708ddc4 -> ddcbb36a4, the same diff (patch-id unchanged); #2881 touches none of this PR's files.

Rebased onto mod-api @ 75bcd270 (#2881 a mod adds a game language): head 97708ddc4 -> ddcbb36a4, the same diff (patch-id unchanged); #2881 touches none of this PR's files.
llun force-pushed fix/mod-api-builder-flags from ddcbb36a43
All checks were successful
PR description / Title and description (pull_request_target) Successful in 6s
to f09e93d68c
All checks were successful
PR description / Title and description (pull_request_target) Successful in 13s
2026-11-30 19:37:06 +00:00
Compare
Author
Member

Rebased onto mod-api af3e4d40 (5 new commits on 75bcd270): head f09e93d68, the same diff (patch-id unchanged). The new mod-api commits touch none of this PR's files.

Rebased onto mod-api af3e4d40 (5 new commits on 75bcd270): head f09e93d68, the same diff (patch-id unchanged). The new mod-api commits touch none of this PR's files.
llun force-pushed fix/mod-api-builder-flags from f09e93d68c
All checks were successful
PR description / Title and description (pull_request_target) Successful in 13s
to 15348c8153
All checks were successful
PR description / Title and description (pull_request_target) Successful in 6s
2026-11-30 22:35:33 +00:00
Compare
Author
Member

Rebased onto mod-api 716735d8 (6 new commits on top of af3e4d40): head f09e93d68 -> 15348c815, the same diff (git patch-id unchanged). The new mod-api touches files near this PR; its checks are to be rerun on this head.

Rebased onto mod-api 716735d8 (6 new commits on top of af3e4d40): head f09e93d68 -> 15348c815, the same diff (git patch-id unchanged). The new mod-api touches files near this PR; its checks are to be rerun on this head.
llun force-pushed fix/mod-api-builder-flags from 15348c8153
All checks were successful
PR description / Title and description (pull_request_target) Successful in 6s
to 45338bf40a
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
2026-12-01 00:36:16 +00:00
Compare
Author
Member

Rebased onto mod-api 5780eeda (one new commit on 716735d8, the reverse-engineering tools for hook sites): head 15348c815 -> 45338bf40, the same diff (git patch-id unchanged). The new mod-api commit touches files near this PR (the builder crates, Cargo, CI); its checks are to be rerun on this head before it leaves WIP.

Rebased onto mod-api 5780eeda (one new commit on 716735d8, the reverse-engineering tools for hook sites): head 15348c815 -> 45338bf40, the same diff (git patch-id unchanged). The new mod-api commit touches files near this PR (the builder crates, Cargo, CI); its checks are to be rerun on this head before it leaves WIP.
llun force-pushed fix/mod-api-builder-flags from 45338bf40a
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
to 0f2f9967cd
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
2026-12-01 01:13:46 +00:00
Compare
Author
Member

Rebased onto mod-api 65148a78 (one new commit, photo-mode and effects APIs), now at 0f2f9967c: the same diff (git patch-id unchanged). Checks not rerun on this PC.

Rebased onto mod-api 65148a78 (one new commit, photo-mode and effects APIs), now at 0f2f9967c: the same diff (git patch-id unchanged). Checks not rerun on this PC.
llun force-pushed fix/mod-api-builder-flags from 0f2f9967cd
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
to 38078934b0
All checks were successful
PR description / Title and description (pull_request_target) Successful in 7s
2026-12-01 03:15:51 +00:00
Compare
Author
Member

Rebased onto the re-squashed mod-api 041890bb (it now carries main up to #2926 and #2884): only this PR's own commits moved with git rebase --onto, the diff unchanged (same git patch-id). Head 38078934b (was 0f2f9967c). Checks not rerun here: CI on the new head.

Rebased onto the re-squashed `mod-api` 041890bb (it now carries main up to #2926 and #2884): only this PR's own commits moved with `git rebase --onto`, the diff unchanged (same `git patch-id`). Head 38078934b (was 0f2f9967c). Checks not rerun here: CI on the new head.
llun force-pushed fix/mod-api-builder-flags from 38078934b0
All checks were successful
PR description / Title and description (pull_request_target) Successful in 7s
to a96a9b63d9
All checks were successful
PR description / Title and description (pull_request_target) Successful in 6s
2026-12-01 05:14:53 +00:00
Compare
Author
Member

Rebased onto mod-api 5740a5df (two new commits on 041890bb: actors.pose/freeze, and #2902's pool-flag sites in the owners table): head 38078934b -> a96a9b63d, the same diff (git patch-id unchanged). Checks not rerun on this PC: CI on the new head.

Rebased onto mod-api 5740a5df (two new commits on 041890bb: actors.pose/freeze, and #2902's pool-flag sites in the owners table): head 38078934b -> a96a9b63d, the same diff (git patch-id unchanged). Checks not rerun on this PC: CI on the new head.
Author
Member

Closing in favour of #2938: one pull request into mod-api with every fix a Windows test of it found, as asked. This PR's commits are there, rebased onto mod-api @ 5740a5df and checked again there on Windows (in the game, confined, and every game-free check) and Linux; its description lists this one.

Closing in favour of [#2938](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2938): one pull request into `mod-api` with every fix a Windows test of it found, as asked. This PR's commits are there, rebased onto `mod-api` @ 5740a5df and checked again there on Windows (in the game, confined, and every game-free check) and Linux; its description lists this one.
llun closed this pull request 2026-12-01 06:52:39 +00:00
All checks were successful
PR description / Title and description (pull_request_target) Successful in 6s

Pull request closed

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/Longshot!2824
No description provided.