build(tools): llvm-mingw's Windows tool keeps llvm-ar and its x86-64 drivers #2963

Merged
HumanBean merged 2 commits from neotoxic/Longshot:build/llvm-mingw-llvm-ar into mod-api 2026-12-02 15:10:19 +00:00
Contributor

Summary

The pin half of a tool bump (docs/dev/reference/releases.md, "Bumping a tool"): tools.lock's trimmed llvm-mingw for Windows keeps llvm-ar.exe and llvm-mingw's two x86-64 drivers (x86_64-w64-mingw32-clang.exe, x86_64-w64-mingw32-clang++.exe), and LLVM_MINGW_TRIM goes to 2, a new package version (a version's files never change).

Why: the trimmed llvm-mingw has no archiver. A developer's game build on Windows archives the game's Rust's C, C++ and CMake objects (shaderc's among them, whose paths pass 260 characters) with whatever ar the PC has: none on a clean PC, or MinGW's, which cannot open those paths. #2961 hands the toolchain's llvm-ar to cargo and CMake when there is one, and for now names rustup's llvm-tools in setup.md. llvm-ar.exe loads libLLVM-<n>.dll, which the trim keeps already.

The drivers: scripts/longshot_builder.py's Windows build names x86_64-w64-mingw32-clang.exe as its linker and C compiler and x86_64-w64-mingw32-clang++.exe as its C++ one, in the llvm-mingw it is given. A build from source on Windows (the launcher's, #2961) gives it the source tools' trimmed llvm-mingw, which has clang.exe and clang++.exe only, so the builder could not be made. They are llvm-mingw's small drivers (14 KB each, running clang-<n>.exe as clang.exe does).

Read first: builder/tools/windows-x64/llvm-mingw.sh (trim_llvm_mingw), builder/tools/pins.sh.

Once tools.lock names the new version, a player's from-source build on Windows changes too: from_source::archiver finds tools/llvm-mingw/bin/llvm-ar.exe, so RenHDrum is compiled from the source instead of renhdrum_not_built (the running builder's library). docs/dev/reference/build.md's "with none (a Steam Deck, Windows)" then goes stale: that line changes with tools.lock's line, in the third pull request.

See #2961.

Testing

Tested: the recipe itself not yet: it runs in Ubuntu 22.04 (builder/tools/docker.sh or the Check tools workflow), which this Windows PC does not have. Its files, on Windows 11 (the three added by hand from llvm-mingw 20261104's UCRT x86-64 release to tools.lock's 20261104-x64-1):

  • scripts/longshot_builder.py build --target windows --profile release with that llvm-mingw as LONGSHOT_MINGW: the builder is made (the drivers as linker, CC and CXX).
  • That builder's from-source --archive of #2961's head under the launcher's data folder, with that llvm-mingw as the source tools' and MinGW's ar first on the PATH: done in 349 s; shaderc's CMake took tools/llvm-mingw/bin/llvm-ar.exe (its toolchain file); RenHDrum built from the source (renhdrum.dll, no renhdrum_not_built); the version's Longshot.exe answers --version.

Still to test:

  • The Check tools workflow on this branch: windows-x64/llvm-mingw, expecting the archive made the same twice, bin/llvm-ar.exe and the two bin/x86_64-w64-mingw32-clang*.exe in it, a new version 20261104-x64-2 (by hand: someone with write access dispatches tools-check.yml).
  • Windows, with the archive in a checkout's tools.lock (make.sh's add.sh): tools\llvm-mingw\bin\llvm-ar.exe --version runs; dev.py rt then dev.py smoke with no other llvm-ar on the PATH, expecting PASS (by hand).
  • Windows, a from-source build with it (longshot-builder build --source ...): RenHDrum compiled, no renhdrum_not_built warning (by hand).

Measurements

Nothing to measure: a build tool's archive gains one small program; the game is built as before.

Risks

  • The archive grows by llvm-ar.exe and the two drivers (small programs over the DLL and clang-<n>.exe it already carries).
  • With the new tools.lock line, a Windows from-source build compiles RenHDrum where it took the running builder's library before.
  • Nothing changes until tools.lock names the new version; revert is enough before that.

Checklist

Ready for review

  • One topic, on current mod-api; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says. Not yet: the recipe needs Ubuntu 22.04 (Still to test).
  • mise run test passes (any failure that also fails on main is named). Not run for this branch: it changes two shell recipes, which tests/test_tools_pins.py checks on Linux (CI).
  • 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 check under tests/ that reads changed source is updated, not weakened. tests/test_tools_pins.py reads pins.sh; nothing in it needs a change (CI runs it).
  • 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 The pin half of a tool bump (docs/dev/reference/releases.md, "Bumping a tool"): tools.lock's trimmed llvm-mingw for Windows keeps `llvm-ar.exe` and llvm-mingw's two x86-64 drivers (`x86_64-w64-mingw32-clang.exe`, `x86_64-w64-mingw32-clang++.exe`), and `LLVM_MINGW_TRIM` goes to 2, a new package version (a version's files never change). Why: the trimmed llvm-mingw has no archiver. A developer's game build on Windows archives the game's Rust's C, C++ and CMake objects (shaderc's among them, whose paths pass 260 characters) with whatever `ar` the PC has: none on a clean PC, or MinGW's, which cannot open those paths. #2961 hands the toolchain's `llvm-ar` to cargo and CMake when there is one, and for now names rustup's `llvm-tools` in setup.md. `llvm-ar.exe` loads `libLLVM-<n>.dll`, which the trim keeps already. The drivers: `scripts/longshot_builder.py`'s Windows build names `x86_64-w64-mingw32-clang.exe` as its linker and C compiler and `x86_64-w64-mingw32-clang++.exe` as its C++ one, in the llvm-mingw it is given. A build from source on Windows (the launcher's, #2961) gives it the source tools' trimmed llvm-mingw, which has `clang.exe` and `clang++.exe` only, so the builder could not be made. They are llvm-mingw's small drivers (14 KB each, running `clang-<n>.exe` as `clang.exe` does). Read first: `builder/tools/windows-x64/llvm-mingw.sh` (`trim_llvm_mingw`), `builder/tools/pins.sh`. Once tools.lock names the new version, a player's from-source build on Windows changes too: `from_source::archiver` finds `tools/llvm-mingw/bin/llvm-ar.exe`, so RenHDrum is compiled from the source instead of `renhdrum_not_built` (the running builder's library). docs/dev/reference/build.md's "with none (a Steam Deck, Windows)" then goes stale: that line changes with tools.lock's line, in the third pull request. See #2961. ## Testing **Tested:** the recipe itself not yet: it runs in Ubuntu 22.04 (`builder/tools/docker.sh` or the Check tools workflow), which this Windows PC does not have. Its files, on Windows 11 (the three added by hand from llvm-mingw 20261104's UCRT x86-64 release to tools.lock's `20261104-x64-1`): - `scripts/longshot_builder.py build --target windows --profile release` with that llvm-mingw as `LONGSHOT_MINGW`: the builder is made (the drivers as linker, CC and CXX). - That builder's `from-source --archive` of #2961's head under the launcher's data folder, with that llvm-mingw as the source tools' and MinGW's `ar` first on the PATH: done in 349 s; shaderc's CMake took `tools/llvm-mingw/bin/llvm-ar.exe` (its toolchain file); RenHDrum built from the source (`renhdrum.dll`, no `renhdrum_not_built`); the version's `Longshot.exe` answers `--version`. **Still to test:** - The Check tools workflow on this branch: `windows-x64/llvm-mingw`, expecting the archive made the same twice, `bin/llvm-ar.exe` and the two `bin/x86_64-w64-mingw32-clang*.exe` in it, a new version `20261104-x64-2` (by hand: someone with write access dispatches `tools-check.yml`). - Windows, with the archive in a checkout's `tools.lock` (make.sh's `add.sh`): `tools\llvm-mingw\bin\llvm-ar.exe --version` runs; `dev.py rt` then `dev.py smoke` with no other `llvm-ar` on the PATH, expecting PASS (by hand). - Windows, a from-source build with it (`longshot-builder build --source ...`): RenHDrum compiled, no `renhdrum_not_built` warning (by hand). ## Measurements Nothing to measure: a build tool's archive gains one small program; the game is built as before. ## Risks - The archive grows by `llvm-ar.exe` and the two drivers (small programs over the DLL and `clang-<n>.exe` it already carries). - With the new tools.lock line, a Windows from-source build compiles RenHDrum where it took the running builder's library before. - Nothing changes until tools.lock names the new version; revert is enough before that. ## Checklist ### Ready for review - [x] One topic, on current `mod-api`; the title is a Conventional Commit. - [ ] Tested on my own PC, in the game for a change the game runs, as Testing says. Not yet: the recipe needs Ubuntu 22.04 (Still to test). - [ ] `mise run test` passes (any failure that also fails on `main` is named). Not run for this branch: it changes two shell recipes, which `tests/test_tools_pins.py` checks on Linux (CI). - [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 - [ ] A check under `tests/` that reads changed source is updated, not weakened. `tests/test_tools_pins.py` reads `pins.sh`; nothing in it needs a change (CI runs it). - [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)
build(tools): llvm-mingw's Windows tool keeps llvm-ar
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
aa349bcec1
tools.lock's trimmed llvm-mingw has no archiver, so a game build on
Windows archives the game's Rust's C, C++ and CMake objects with whatever
ar the PC has: none on a clean PC, or MinGW's, which cannot open a path
past 260 characters (shaderc's, previous commit). llvm-ar.exe goes in the
trim (it loads libLLVM-<n>.dll, already there), and LLVM_MINGW_TRIM is 2:
a new package version, which make.sh builds and the release's
longshot-tools workflow uploads, then tools.lock names. Until then, an
llvm-ar on the PATH does (rustup's llvm-tools component has one).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
neotoxic force-pushed build/llvm-mingw-llvm-ar from aa349bcec1
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
to e73c622eb0
All checks were successful
PR description / Title and description (pull_request_target) Successful in 6s
2026-12-01 18:46:19 +00:00
Compare
build(tools): llvm-mingw's Windows tool keeps its two x86-64 drivers
Some checks failed
PR description / Title and description (pull_request_target) Failing after 8s
228d482d00
scripts/longshot_builder.py's Windows build names x86_64-w64-mingw32-clang.exe as the linker and the
C compiler, and x86_64-w64-mingw32-clang++.exe as the C++ one, in the llvm-mingw it is given; a
build from source on Windows (the launcher's, #2961) gives it the source tools' trimmed llvm-mingw,
which kept clang.exe and clang++.exe only, so the builder could not be made from them. They are
llvm-mingw's small drivers (14 KB each, running clang-<n>.exe as clang.exe does), so they come in the
same LLVM_MINGW_TRIM 2 as llvm-ar.exe: the archive is not published yet.

Checked on Windows 11 with these files added to tools.lock's llvm-mingw: longshot_builder.py build
--target windows --profile release, then that builder's from-source of #2961's head under the
launcher's data folder: done, shaderc archived by this llvm-ar.exe.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
neotoxic changed title from WIP: build(tools): llvm-mingw's Windows tool keeps llvm-ar to WIP: build(tools): llvm-mingw's Windows tool keeps llvm-ar and its x86-64 drivers 2026-12-02 03:30:47 +00:00
Owner
@review
BeanBot left a comment

Recommendation: Request changes. The recipe adds the files needed by Windows builds, but it has no game-free regression test for the missing archiver and drivers. The actual generated archive has also yet to be tested.

The next Windows llvm-mingw package will include llvm-ar and the two target-prefixed compiler drivers, allowing builds to use the intended tools. The current tools.lock still selects the old package, as expected for the first stage of the documented tool-bump process.

Blocking (1): must change before merging.

  1. L1 builder/tools/windows-x64/llvm-mingw.sh:21: This fix has no game-free regression test for the files the trimmed package must retain. (more on the line) Do: Add a game-free test that exercises the trim on an authored fixture and checks that all three tools are retained; it should fail against the base recipe.

Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)

  • L2 builder/tools/windows-x64/llvm-mingw.sh:21: The recipe-produced package has not yet been exercised. (more on the line) Do: Run the documented Check tools workflow, then install its archive on Windows and exercise llvm-ar, the developer build and a from-source build as described in Still to test.

@fix can do L1.

More: does it help, other systems, switches, what was read

Does it help: Unproven for the recipe: the author reports a successful Windows builder and from-source build using files added by hand, but has not made or tested the archive produced by this change.

Other systems: The recipe produces the Windows x64 tool package; Linux builds and game runtime code are unchanged. Once tools.lock selects the new package, Windows from-source builds can compile RenHDrum from source, which still needs verification with the generated archive.

Switches: None.

Reviewed: 228d482d00 against 1e8153d50d: Read AGENTS.md, CONTRIBUTING.md, the pull request template, standards, both changed files and their full diff, the commit messages, the tool-bump procedure, make.sh, the relevant tool-pin tests and the Check tools workflow. Skimmed tool consumers and related search results. docs/review-checklist.md and ../Tooling/AGENTS.md were absent. No recorded runs, translations or generated files changed.; nothing run (a code review).

Checked and fine:

  • The trim revision increases from 1 to 2, preserving package-version immutability.
  • The tool-bump procedure explicitly stages the recipe and tools.lock in separate pull requests.
  • Both commits record AI assistance; the diff contains no game-derived files or generated output.

Testing: No commands from the project or tests were run, as requested. The author reports Windows testing with manually added files; the recipe and generated archive remain untested.

Overlaps and merge order: The description identifies #2961 as related; its contents were not available for review.


Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The recipe adds the files needed by Windows builds, but it has no game-free regression test for the missing archiver and drivers. The actual generated archive has also yet to be tested. The next Windows llvm-mingw package will include llvm-ar and the two target-prefixed compiler drivers, allowing builds to use the intended tools. The current tools.lock still selects the old package, as expected for the first stage of the documented tool-bump process. **Blocking (1)**: must change before merging. 1. **L1** `builder/tools/windows-x64/llvm-mingw.sh:21`: This fix has no game-free regression test for the files the trimmed package must retain. (more on the line) **Do:** Add a game-free test that exercises the trim on an authored fixture and checks that all three tools are retained; it should fail against the base recipe. **Testing before merging (1)** (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation) - **L2** `builder/tools/windows-x64/llvm-mingw.sh:21`: The recipe-produced package has not yet been exercised. (more on the line) **Do:** Run the documented Check tools workflow, then install its archive on Windows and exercise llvm-ar, the developer build and a from-source build as described in Still to test. `@fix` can do L1. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven for the recipe: the author reports a successful Windows builder and from-source build using files added by hand, but has not made or tested the archive produced by this change. **Other systems:** The recipe produces the Windows x64 tool package; Linux builds and game runtime code are unchanged. Once tools.lock selects the new package, Windows from-source builds can compile RenHDrum from source, which still needs verification with the generated archive. **Switches:** None. **Reviewed:** 228d482d0023 against 1e8153d50d7c: Read AGENTS.md, CONTRIBUTING.md, the pull request template, standards, both changed files and their full diff, the commit messages, the tool-bump procedure, make.sh, the relevant tool-pin tests and the Check tools workflow. Skimmed tool consumers and related search results. docs/review-checklist.md and ../Tooling/AGENTS.md were absent. No recorded runs, translations or generated files changed.; nothing run (a code review). **Checked and fine:** - The trim revision increases from 1 to 2, preserving package-version immutability. - The tool-bump procedure explicitly stages the recipe and tools.lock in separate pull requests. - Both commits record AI assistance; the diff contains no game-derived files or generated output. **Testing:** No commands from the project or tests were run, as requested. The author reports Windows testing with manually added files; the recipe and generated archive remain untested. **Overlaps and merge order:** The description identifies #2961 as related; its contents were not available for review. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
@ -16,3 +20,2 @@
rm -rf "$out" && mkdir -p "$out/bin" "$out/x86_64-w64-mingw32" "$out/lib/clang/$major/lib/windows"
for f in clang.exe clang++.exe "clang-$major.exe" ld.lld.exe "libLLVM-$major.dll" libclang-cpp.dll libc++.dll \
libunwind.dll x86_64-w64-windows-gnu.cfg x86_64-pc-windows-gnu.cfg mingw32-common.cfg; do
for f in clang.exe clang++.exe x86_64-w64-mingw32-clang.exe x86_64-w64-mingw32-clang++.exe "clang-$major.exe" \
Member

L1 (blocking): This fix has no game-free regression test for the files the trimmed package must retain.

When: If llvm-ar or either target-prefixed driver is removed from this copy list later, the existing pin tests still pass, but the resulting Windows package again lacks a tool needed by the build.

Do: Add a game-free test that exercises the trim on an authored fixture and checks that all three tools are retained; it should fail against the base recipe.

**L1** (blocking): This fix has no game-free regression test for the files the trimmed package must retain. *When:* If llvm-ar or either target-prefixed driver is removed from this copy list later, the existing pin tests still pass, but the resulting Windows package again lacks a tool needed by the build. **Do:** Add a game-free test that exercises the trim on an authored fixture and checks that all three tools are retained; it should fail against the base recipe.
Member

L2 (should fix): The recipe-produced package has not yet been exercised.

When: The reported Windows builds used files inserted by hand, so they do not show that this recipe produces a usable archive with the required files and dependencies.

Do: Run the documented Check tools workflow, then install its archive on Windows and exercise llvm-ar, the developer build and a from-source build as described in Still to test.

**L2** (should fix): The recipe-produced package has not yet been exercised. *When:* The reported Windows builds used files inserted by hand, so they do not show that this recipe produces a usable archive with the required files and dependencies. **Do:** Run the documented Check tools workflow, then install its archive on Windows and exercise llvm-ar, the developer build and a from-source build as described in Still to test.
HumanBean changed title from WIP: build(tools): llvm-mingw's Windows tool keeps llvm-ar and its x86-64 drivers to build(tools): llvm-mingw's Windows tool keeps llvm-ar and its x86-64 drivers 2026-12-02 15:10:16 +00:00
HumanBean merged commit 2540f4579c into mod-api 2026-12-02 15:10:19 +00:00
HumanBean deleted branch build/llvm-mingw-llvm-ar 2026-12-02 15:10:20 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
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!2963
No description provided.