WIP: test(builder): two builder checks that fail only on Windows pass there: their fixtures name Windows' programs and whole paths #2834

Draft
llun wants to merge 1 commit from llun/Longshot:fix/mod-api-win-builder-tests into mod-api
Member

Summary

For #2822 (into mod-api). Two of the builder's Rust checks fail on mod-api only on Windows (cargo test --target x86_64-pc-windows-gnullvm). Their fixtures assume Linux; the code they test is right on both systems. Tests only:

Check On mod-api, Windows Here
build-compile's toolchain::tests::the_builder_s_llvm_comes_before_emsdk_and_the_path the fake LONGSHOT_LLVM holds clang and ld.lld, which find() looks for as clang.exe and ld.lld.exe on Windows, so it found the PATH's clang (left: …\llvm-mingw\bin\clang.exe) the fixture's programs are named with std::env::consts::EXE_SUFFIX
build-core's driver_caches::tests::the_caches_are_longshots_own_unless_one_is_named plan() takes HOME and XDG_CACHE_HOME only when whole, and /h is not whole on Windows (left: []) the test's paths are rooted at C: on Windows, / on Linux as before

Read first: the two tests, in builder/crates/build-compile/src/toolchain.rs and builder/crates/build-core/src/driver_caches.rs.

Testing

Tested: Windows 11. cargo test -p build-core -p build-compile --target x86_64-pc-windows-gnullvm with llvm-mingw: both checks fail on mod-api @ eaf4a48b as the table says, and pass here. On Linux (WSL Ubuntu 24.04, Rust 1.99.1) both pass here, as before. Tests only, so there's no game run: the game runs none of it. cargo fmt --check on both crates and mise run lint pass.

Still failing on Windows on mod-api, unchanged by this PR:

  • build-core's files_windows::tests::the_cache_takes_files_folders_renames_and_removes: the broker's write-only open and made folder, #2726's bug, commented there.
  • build-compile's tests/compile_link.rs an_unchanged_rebuild_compiles_nothing_and_a_change_compiles_what_it_touches (and links nothing): an unchanged rebuild links again on Windows: its fixture's program and a bug in the link's key, fixed in #2835.

Still to test: None.

Measurements

Nothing to measure: two tests' fixtures.

Risks

The sandbox: not touched. These are two tests' fixtures, and the sandbox's checks are not weakened.

None for players: only #[cfg(test)] code changes, and neither check is weakened (Linux runs exactly what it ran). A revert is enough.

Checklist

Ready for review

  • One topic, on current mod-api (#2822's head); the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named). (These two pass. The two named above still fail on Windows on mod-api. mod-api's whole suite has other failures on Windows that this PR doesn't change.)
  • 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.
  • 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`). Two of the builder's Rust checks fail on `mod-api` only on Windows (`cargo test --target x86_64-pc-windows-gnullvm`). Their fixtures assume Linux; the code they test is right on both systems. Tests only: | Check | On `mod-api`, Windows | Here | |---|---|---| | `build-compile`'s `toolchain::tests::the_builder_s_llvm_comes_before_emsdk_and_the_path` | the fake `LONGSHOT_LLVM` holds `clang` and `ld.lld`, which `find()` looks for as `clang.exe` and `ld.lld.exe` on Windows, so it found the `PATH`'s clang (`left: …\llvm-mingw\bin\clang.exe`) | the fixture's programs are named with `std::env::consts::EXE_SUFFIX` | | `build-core`'s `driver_caches::tests::the_caches_are_longshots_own_unless_one_is_named` | `plan()` takes `HOME` and `XDG_CACHE_HOME` only when whole, and `/h` is not whole on Windows (`left: []`) | the test's paths are rooted at `C:` on Windows, `/` on Linux as before | Read first: the two tests, in `builder/crates/build-compile/src/toolchain.rs` and `builder/crates/build-core/src/driver_caches.rs`. ## Testing **Tested:** Windows 11. `cargo test -p build-core -p build-compile --target x86_64-pc-windows-gnullvm` with llvm-mingw: both checks fail on `mod-api` @ eaf4a48b as the table says, and pass here. On Linux (WSL Ubuntu 24.04, Rust 1.99.1) both pass here, as before. Tests only, so there's no game run: the game runs none of it. `cargo fmt --check` on both crates and `mise run lint` pass. Still failing on Windows on `mod-api`, unchanged by this PR: - `build-core`'s `files_windows::tests::the_cache_takes_files_folders_renames_and_removes`: the broker's write-only open and made folder, [#2726](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2726)'s bug, [commented there](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2726#issuecomment-91738). - `build-compile`'s `tests/compile_link.rs` `an_unchanged_rebuild_compiles_nothing_and_a_change_compiles_what_it_touches` (`and links nothing`): an unchanged rebuild links again on Windows: its fixture's program and a bug in the link's key, fixed in [#2835](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2835). **Still to test:** None. ## Measurements Nothing to measure: two tests' fixtures. ## Risks **The sandbox:** not touched. These are two tests' fixtures, and the sandbox's checks are not weakened. None for players: only `#[cfg(test)]` code changes, and neither check is weakened (Linux runs exactly what it ran). A revert is enough. ## 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, in the game for a change the game runs, as Testing says. - [ ] `mise run test` passes (any failure that also fails on `main` is named). (These two pass. The two named above still fail on Windows on `mod-api`. `mod-api`'s whole suite has other failures on Windows that this PR doesn't change.) - [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 check under `tests/` that reads changed source is updated, not weakened. - [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)
test(builder): two builder checks that fail only on Windows pass there: their fixtures name Windows' programs and whole paths
All checks were successful
PR description / Title and description (pull_request_target) Successful in 13s
7d24c41c12
Each failed on mod-api on Windows (cargo test --target x86_64-pc-windows-gnullvm) and passes there now, and on Linux:
- build-compile's toolchain::tests::the_builder_s_llvm_comes_before_emsdk_and_the_path: the fake LONGSHOT_LLVM held
  `clang` and `ld.lld`, which find() looks for as `clang.exe` and `ld.lld.exe` on Windows, so it found the PATH's clang
  instead: the fixture's programs are named with std::env::consts::EXE_SUFFIX;
- build-core's driver_caches::tests::the_caches_are_longshots_own_unless_one_is_named: plan() takes HOME and
  XDG_CACHE_HOME only when whole, and `/h` is not on Windows (left: []): the test's paths are rooted at `C:` there.

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

Possibly related, for context:

  • PR #2830 WIP: chore(lint): the workspace passes clippy for Windows' target, as mise.toml says the builder is checked for Windows — Same builder test suite on Windows; mentions these exact failing checks.
Possibly related, for context: - PR #2830 WIP: chore(lint): the workspace passes clippy for Windows' target, as mise.toml says the builder is checked for Windows — Same builder test suite on Windows; mentions these exact failing checks.
Author
Member

The compile_link failure named in Testing is explained and fixed in #2835: its fixture linked prog (Windows writes prog.exe), and link_inputs took a Windows path's drive colon for an option's separator, so a link's output went into its own key and every link ran again.

The compile_link failure named in Testing is explained and fixed in #2835: its fixture linked prog (Windows writes prog.exe), and link_inputs took a Windows path's drive colon for an option's separator, so a link's output went into its own key and every link ran again.
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-win-builder-tests from 7d24c41c12
All checks were successful
PR description / Title and description (pull_request_target) Successful in 13s
to fc262bd7e8
All checks were successful
PR description / Title and description (pull_request_target) Successful in 14s
2026-11-29 23:27:45 +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-win-builder-tests from fc262bd7e8
All checks were successful
PR description / Title and description (pull_request_target) Successful in 14s
to 11f066e714
All checks were successful
PR description / Title and description (pull_request_target) Successful in 11s
2026-11-29 23:58:24 +00:00
Compare
Author
Member

Rebased onto mod-api @ 816d2354 (#2837, headless shots of the mods' UI), now 11f066e7. 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 11f066e7. 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-win-builder-tests from 11f066e714
All checks were successful
PR description / Title and description (pull_request_target) Successful in 11s
to 6c1035304a
All checks were successful
PR description / Title and description (pull_request_target) Successful in 17s
2026-11-30 00:38:41 +00:00
Compare
llun force-pushed fix/mod-api-win-builder-tests from 6c1035304a
All checks were successful
PR description / Title and description (pull_request_target) Successful in 17s
to 78e48176a8
All checks were successful
PR description / Title and description (pull_request_target) Successful in 15s
2026-11-30 00:43:14 +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 78e48176, the same diff as before (same git patch-id), no conflict. main's #2833 changed toolchain.rs, so I ran cargo test -p build-compile -p build-core again on the rebased head (Windows, llvm-mingw): the same as before, with only compile_link's an_unchanged_rebuild_compiles_nothing_and_a_change_compiles_what_it_touches failing, as on mod-api (#2835 fixes it).

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 78e48176, the same diff as before (same `git patch-id`), no conflict. main's #2833 changed `toolchain.rs`, so I ran `cargo test -p build-compile -p build-core` again on the rebased head (Windows, llvm-mingw): the same as before, with only `compile_link`'s `an_unchanged_rebuild_compiles_nothing_and_a_change_compiles_what_it_touches` failing, as on `mod-api` (#2835 fixes it).
All checks were successful
PR description / Title and description (pull_request_target) Successful in 15s
This pull request is marked as a work in progress.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/mod-api-win-builder-tests:llun-fix/mod-api-win-builder-tests'
git switch 'llun-fix/mod-api-win-builder-tests'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'mod-api'
git merge --no-ff 'llun-fix/mod-api-win-builder-tests'
git switch 'llun-fix/mod-api-win-builder-tests'
git rebase 'mod-api'
git switch 'mod-api'
git merge --ff-only 'llun-fix/mod-api-win-builder-tests'
git switch 'llun-fix/mod-api-win-builder-tests'
git rebase 'mod-api'
git switch 'mod-api'
git merge --no-ff 'llun-fix/mod-api-win-builder-tests'
git switch 'mod-api'
git merge --squash 'llun-fix/mod-api-win-builder-tests'
git switch 'mod-api'
git merge --ff-only 'llun-fix/mod-api-win-builder-tests'
git switch 'mod-api'
git merge 'llun-fix/mod-api-win-builder-tests'
git push origin 'mod-api'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 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!2834
No description provided.