fix(builder): build-driver's tests pass on Windows: hard links, cache use marks, dev mod folders, send lock #2587

Merged
HumanBean merged 7 commits from pmwork-personal/Longshot:fix/build-driver-windows-tests into main 2026-11-28 04:09:56 +00:00
Member

Summary

cargo test --locked -p build-driver fails on Windows on main (CI runs these tests on Linux only; the Windows job
builds them, --no-run): 8 failures on main @ d9fa80cd. For each one the cause was found and the side that was wrong
was fixed. At 97683bbe, build-driver's tests all passed on Windows; the current head has not been tested.

The code was wrong on Windows (4 fixes):

  • Hard links were two files. build_core::fsx::same_file compared canonical paths on Windows, so a file and its
    hard link counted as different files. On Windows, a build from a dump folder refused a game folder whose romfs an
    older build had linked (romfs_folder_theirs: folder::romfs_made_here took the links for the player's own copy).
    It now compares the volume serial number and the 128-bit file id (GetFileInformationByHandleEx, FileIdInfo;
    ReFS, as in a Dev Drive, needs all 128 bits). If the identity query fails or gives no serial or no id (zero), it compares the
    paths, as before.
  • A folder's .used mark kept its first time. storage::mark_used wrote the empty mark again; on Windows that
    leaves the file's time unchanged. To the cache's budget, the unpacked tree, the tools, a from-source Rust toolchain
    and the shader caches looked unused since their first use, so over the budget a folder in daily use could go first
    and be unpacked or made again. It now also sets the time (the write stays: on Unix it needs only write access, where
    setting a time needs the file's owner, as in a cache shared by two users). The unpack (sources.rs) and
    from-source's tools and Rust (longshot-builder/src/from_source/) wrote the mark the same way and now call
    mark_used.
  • A dev mod folder with ; in its name. modhook::dev_mods_value used std::env::join_paths, which refuses a
    folder with : on Unix but puts a Windows folder with ; in quotes. The game splits LONGSHOT_DEV_MODS at each
    separator and reads no quotes, so such a folder is now refused on every OS (docs/dev/reference/build.md says so).
  • A send lock left as a directory was never cleared on Windows. Windows refuses a file over a directory with
    "access denied", not "already exists", so perf::take_send_lock sent without a lock every time. A directory at the
    lock's name now counts as "there", as on Unix, and the takeover clears it.

The test was wrong on Windows (4 tests):

  • channel::tests::profile_says_the_folder_and_the_known_keys and modhook::tests::a_context_resolves_the_profile_and_its_game
    wrote their scratch folder as <crate>/../../../target/... and compared it with the folder the code gives back
    through std::path::absolute, which drops the .. on Windows (Unix keeps it). Both now use crate::scratch,
    which spells the folder as std::path::absolute does.
  • perf::tests::one_sender_at_a_time made the lock a directory over the running holder's lock file, which only the
    Linux-only takeover step had removed (os error 183). The file goes first; the test then showed the send lock bug
    above.
  • read::tests::manifest_mods_are_found_and_ordered_as_the_game_does (#2607) made the mods A and a/inner. On a
    case-insensitive file system (Windows, macOS's default) those are one folder: a/inner went into the mod A, which
    the code rightly does not look below. It is ab/inner now, which keeps each order the test checks.

Read first: builder/crates/build-core/src/fsx.rs (same_file), builder/crates/build-core/src/sys.rs (file_id), builder/crates/build-driver/src/storage.rs
(mark_used), modhook.rs (dev_mods_value), perf.rs (lock_there).

Commits: the test fixes, then two new checks that fail on Windows on main (fsx::tests::a_hard_link_is_the_same_file_and_a_copy_is_not,
storage::tests::a_use_marks_a_folder_and_a_file_now_each_time), then the fixes; then main merged in (d9fa80cd) and
the manifest mods test.

Testing

Tested: Windows 11 (10.0.26300), Rust 1.99.1 x86_64-pc-windows-gnullvm with llvm-mingw, each run through the
PC's job queue in its own cargo target folder, no game:

cargo test --locked Before: main @ d9fa80cd After: this PR @ 97683bbe
-p build-driver 141 passed, 8 failed 150 passed, 0 failed
-p build-core 33 passed 34 passed (the new hard link check)
-p longshot-builder 7 failed the same 7 failed, no new one
  • (main @ d9fa80cd's build-driver numbers are from 5619426a: the two commits between them change nothing under
    builder/.)
  • The fixes' checks, at the tests-only commit (on main @ fd68f82c, before the merge), each failed for its bug:
    a_hard_link_is_the_same_file_and_a_copy_is_not ("a hard link of it"), a_use_marks_a_folder_and_a_file_now_each_time
    (the .used mark "still a month old"), the_dev_mod_folders_are_joined_by_the_os_separator (/a;b accepted),
    one_sender_at_a_time (no lock written over the directory), and the existing romfs_made_here and same_file
    checks in folder.rs and read.rs.
  • cargo fmt --check and cargo clippy --locked -p build-core -p build-driver -p longshot-builder --all-targets -- -D warnings on Windows @ 97683bbe: clean.
  • tests/run_all.py (every game-free check, Windows, 16 at once, without --strict: the 52 skips need Linux tools) @
    97683bbe: 793 passed, 23 failed. 21 of the 23 also fail on main @ d9fa80cd, run alone: test_auto_handheld,
    test_bug_report, test_builder_channel (its C fixture is POSIX: fcntl, setenv), test_control_picture,
    test_coverage_run, test_crash_record, test_dev_ab (a Δ printed to a cp1252 console), test_dev_build,
    test_dev_migrate, test_float_add_subgroup, test_game_menu_mouse_buttons, test_input_movie, test_job_queue,
    test_oot_menu_mouse, test_pads_after_menu, test_parity_gates, test_perf_send (its C++ fixture has no
    organized_game, on both), test_run_all_mingw, test_screensaver, test_switch_table, test_xinput_thread. The
    other 2 read only gpu/ and tests/ code, which this PR does not change, and pass alone here:
    test_fg_scale_sharpen, and test_sampler_admission, whose "id concurrent" case fails at random on main too.
  • A dev build with the builder in use (before the merge, on fd68f82c with #2581's PE padding fix on top):
    longshot-builder (release) and dev.py pack over the shared base: pack bd-wintests-wt: longshot.exe, longshot_vk.dll; 2 generated files, in 52 s. A dev pack marks no .used folders (it builds from the checkout, with
    its own store): mark_used is checked by the tests above, each_unpack_marks_its_folders_used with a real unpack
    into a cache.

Still to test: The current head on Windows.

Linux is not run here: the Rust CI job (cargo test --workspace) runs it. The Unix code paths change only in
dev_mods_value (the same refusal, a new message), mark_used (the time set, where the write already moved it) and
lock_there (a directory counts as there, as AlreadyExists already said).

Measurements

Nothing to measure: no change to the game, the build's output or its speed (same_file opens each file once, as canonicalize did).

Risks

  • same_file decides whether link_or_copy skips a file as already in place. A file system whose file ids are not
    unique would skip a copy; the id is the volume serial number with the 128-bit id, and a failed identity query or one that gives no
    serial or no id (zero) falls back to the path, as before. Two volumes with one serial (a cloned disk) are the case
    left, as two devices with one st_dev would be on Unix.
  • mark_used writes the mark as before and now sets its time too: on Linux the same result.
  • A dev mod folder with ; in its name is refused on Windows (it was passed on in quotes, which the game does not
    read). A revert undoes all of it. A player notices nothing after updating, except that the cache's budget keeps
    the folders they use.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit. (This PR combines four production fixes.)
  • Tested on my own PC, in the game for a change the game runs, as Testing says. (The game does not run this code:
    the builder's tests and checks, as Testing says.)
  • mise run test passes (any failure that also fails on main is named). (On Windows: each failure is named in
    Testing, with its result on main.)
  • 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. (On Windows; Linux passes on both.)
  • A check under tests/ that reads changed source is updated, not weakened. (None needed a change:
    test_log_redact, test_ngx_sdk, test_no_release_lookup, test_perf_report, test_prepare_journal,
    test_recomplauncher_json, test_ship_state_list and test_longshot_exit pass; test_builder_channel and
    test_dev_ab fail on main too, as Testing says.)
  • Docs updated.
  • 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.

Co-Authored-By: Claude Opus 5.5 [email protected]

🤖 Generated with Claude Code

## Summary `cargo test --locked -p build-driver` fails on Windows on `main` (CI runs these tests on Linux only; the Windows job builds them, `--no-run`): 8 failures on `main` @ d9fa80cd. For each one the cause was found and the side that was wrong was fixed. At 97683bbe, build-driver's tests all passed on Windows; the current head has not been tested. **The code was wrong on Windows (4 fixes):** - **Hard links were two files.** `build_core::fsx::same_file` compared canonical paths on Windows, so a file and its hard link counted as different files. On Windows, a build from a dump folder refused a game folder whose romfs an older build had linked (`romfs_folder_theirs`: `folder::romfs_made_here` took the links for the player's own copy). It now compares the volume serial number and the 128-bit file id (`GetFileInformationByHandleEx`, `FileIdInfo`; ReFS, as in a Dev Drive, needs all 128 bits). If the identity query fails or gives no serial or no id (zero), it compares the paths, as before. - **A folder's `.used` mark kept its first time.** `storage::mark_used` wrote the empty mark again; on Windows that leaves the file's time unchanged. To the cache's budget, the unpacked tree, the tools, a from-source Rust toolchain and the shader caches looked unused since their first use, so over the budget a folder in daily use could go first and be unpacked or made again. It now also sets the time (the write stays: on Unix it needs only write access, where setting a time needs the file's owner, as in a cache shared by two users). The unpack (`sources.rs`) and from-source's tools and Rust (`longshot-builder/src/from_source/`) wrote the mark the same way and now call `mark_used`. - **A dev mod folder with `;` in its name.** `modhook::dev_mods_value` used `std::env::join_paths`, which refuses a folder with `:` on Unix but puts a Windows folder with `;` in quotes. The game splits `LONGSHOT_DEV_MODS` at each separator and reads no quotes, so such a folder is now refused on every OS (`docs/dev/reference/build.md` says so). - **A send lock left as a directory was never cleared on Windows.** Windows refuses a file over a directory with "access denied", not "already exists", so `perf::take_send_lock` sent without a lock every time. A directory at the lock's name now counts as "there", as on Unix, and the takeover clears it. **The test was wrong on Windows (4 tests):** - `channel::tests::profile_says_the_folder_and_the_known_keys` and `modhook::tests::a_context_resolves_the_profile_and_its_game` wrote their scratch folder as `<crate>/../../../target/...` and compared it with the folder the code gives back through `std::path::absolute`, which drops the `..` on Windows (Unix keeps it). Both now use `crate::scratch`, which spells the folder as `std::path::absolute` does. - `perf::tests::one_sender_at_a_time` made the lock a directory over the running holder's lock file, which only the Linux-only takeover step had removed (os error 183). The file goes first; the test then showed the send lock bug above. - `read::tests::manifest_mods_are_found_and_ordered_as_the_game_does` (#2607) made the mods `A` and `a/inner`. On a case-insensitive file system (Windows, macOS's default) those are one folder: `a/inner` went into the mod `A`, which the code rightly does not look below. It is `ab/inner` now, which keeps each order the test checks. Read first: `builder/crates/build-core/src/fsx.rs` (`same_file`), `builder/crates/build-core/src/sys.rs` (`file_id`), `builder/crates/build-driver/src/storage.rs` (`mark_used`), `modhook.rs` (`dev_mods_value`), `perf.rs` (`lock_there`). Commits: the test fixes, then two new checks that fail on Windows on `main` (`fsx::tests::a_hard_link_is_the_same_file_and_a_copy_is_not`, `storage::tests::a_use_marks_a_folder_and_a_file_now_each_time`), then the fixes; then `main` merged in (d9fa80cd) and the manifest mods test. ## Testing **Tested:** Windows 11 (10.0.26300), Rust 1.99.1 `x86_64-pc-windows-gnullvm` with llvm-mingw, each run through the PC's job queue in its own cargo target folder, no game: | `cargo test --locked` | Before: main @ d9fa80cd | After: this PR @ 97683bbe | |---|---|---| | `-p build-driver` | 141 passed, 8 failed | **150 passed, 0 failed** | | `-p build-core` | 33 passed | 34 passed (the new hard link check) | | `-p longshot-builder` | 7 failed | the same 7 failed, no new one | - (`main` @ d9fa80cd's build-driver numbers are from 5619426a: the two commits between them change nothing under `builder/`.) - The fixes' checks, at the tests-only commit (on `main` @ fd68f82c, before the merge), each failed for its bug: `a_hard_link_is_the_same_file_and_a_copy_is_not` ("a hard link of it"), `a_use_marks_a_folder_and_a_file_now_each_time` (the `.used` mark "still a month old"), `the_dev_mod_folders_are_joined_by_the_os_separator` (`/a;b` accepted), `one_sender_at_a_time` (no lock written over the directory), and the existing `romfs_made_here` and `same_file` checks in `folder.rs` and `read.rs`. - `cargo fmt --check` and `cargo clippy --locked -p build-core -p build-driver -p longshot-builder --all-targets -- -D warnings` on Windows @ 97683bbe: clean. - `tests/run_all.py` (every game-free check, Windows, 16 at once, without `--strict`: the 52 skips need Linux tools) @ 97683bbe: 793 passed, 23 failed. 21 of the 23 also fail on `main` @ d9fa80cd, run alone: `test_auto_handheld`, `test_bug_report`, `test_builder_channel` (its C fixture is POSIX: `fcntl`, `setenv`), `test_control_picture`, `test_coverage_run`, `test_crash_record`, `test_dev_ab` (a Δ printed to a cp1252 console), `test_dev_build`, `test_dev_migrate`, `test_float_add_subgroup`, `test_game_menu_mouse_buttons`, `test_input_movie`, `test_job_queue`, `test_oot_menu_mouse`, `test_pads_after_menu`, `test_parity_gates`, `test_perf_send` (its C++ fixture has no `organized_game`, on both), `test_run_all_mingw`, `test_screensaver`, `test_switch_table`, `test_xinput_thread`. The other 2 read only `gpu/` and `tests/` code, which this PR does not change, and pass alone here: `test_fg_scale_sharpen`, and `test_sampler_admission`, whose "id concurrent" case fails at random on `main` too. - A dev build with the builder in use (before the merge, on fd68f82c with #2581's PE padding fix on top): `longshot-builder` (release) and `dev.py pack` over the shared base: `pack bd-wintests-wt: longshot.exe, longshot_vk.dll; 2 generated files, in 52 s`. A dev pack marks no `.used` folders (it builds from the checkout, with its own store): `mark_used` is checked by the tests above, `each_unpack_marks_its_folders_used` with a real unpack into a cache. **Still to test:** The current head on Windows. Linux is not run here: the Rust CI job (`cargo test --workspace`) runs it. The Unix code paths change only in `dev_mods_value` (the same refusal, a new message), `mark_used` (the time set, where the write already moved it) and `lock_there` (a directory counts as there, as `AlreadyExists` already said). ## Measurements Nothing to measure: no change to the game, the build's output or its speed (`same_file` opens each file once, as `canonicalize` did). ## Risks - `same_file` decides whether `link_or_copy` skips a file as already in place. A file system whose file ids are not unique would skip a copy; the id is the volume serial number with the 128-bit id, and a failed identity query or one that gives no serial or no id (zero) falls back to the path, as before. Two volumes with one serial (a cloned disk) are the case left, as two devices with one `st_dev` would be on Unix. - `mark_used` writes the mark as before and now sets its time too: on Linux the same result. - A dev mod folder with `;` in its name is refused on Windows (it was passed on in quotes, which the game does not read). A revert undoes all of it. A player notices nothing after updating, except that the cache's budget keeps the folders they use. ## Checklist ### Ready for review - [ ] One topic, on current `main`; the title is a Conventional Commit. (This PR combines four production fixes.) - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. (The game does not run this code: the builder's tests and checks, as Testing says.) - [x] `mise run test` passes (any failure that also fails on `main` is named). (On Windows: each failure is named in Testing, with its result on `main`.) - [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. (On Windows; Linux passes on both.) - [x] A check under `tests/` that reads changed source is updated, not weakened. (None needed a change: `test_log_redact`, `test_ngx_sdk`, `test_no_release_lookup`, `test_perf_report`, `test_prepare_journal`, `test_recomplauncher_json`, `test_ship_state_list` and `test_longshot_exit` pass; `test_builder_channel` and `test_dev_ab` fail on `main` too, as Testing says.) - [x] Docs updated. - [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. Co-Authored-By: Claude Opus 5.5 <[email protected]> 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Three tests failed on Windows for the test's own reason, not the code's:

- channel's profile_says_the_folder_and_the_known_keys and modhook's
  a_context_resolves_the_profile_and_its_game compared a folder they wrote
  as `<crate>/../../../target/...` with the one the code gives back through
  std::path::absolute, which drops the `..` on Windows (Unix keeps it).
  Their own scratch helpers are now crate::scratch, which spells the folder
  as std::path::absolute does.
- perf's one_sender_at_a_time made the lock a directory over the running
  holder's lock file, which only Linux's takeover step had removed (os
  error 183 on Windows). The file goes first. On Windows the test then
  fails one step later for the code's reason: a lock left as a directory
  is not cleared there (the fix is in this branch's last commit).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Two checks that fail on Windows on main, for the bugs this branch's last
commit fixes (Linux passes them):

- build-core's fsx::same_file says a file and its hard link are one file
  (it compares canonical paths on Windows, so two links are two files);
- build-driver's storage::mark_used moves a used folder's `.used` mark to
  now (writing the empty mark again leaves its time on Windows).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(builder): hard links, the cache's use marks, dev mod folders and a stale send lock on Windows
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
CI / What the change needs (pull_request) Successful in 9s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Failing after 1s
CI / Third-party parts and guide screenshots (pull_request) Successful in 13s
PR description / Title and description (pull_request_target) Successful in 6s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 0s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Failing after 1s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 1s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 0s
CI / Website build and checks (pull_request) Failing after 0s
12b5f4eec5
Four places where the builder did on Windows what it does not do on Linux:

- fsx::same_file compared canonical paths on Windows, so a file and its
  hard link were two files: romfs_made_here took an older build's linked
  romfs for the player's own, and link_or_copy linked a link again. It now
  compares the volume serial and the 128-bit file id
  (GetFileInformationByHandleEx, FileIdInfo); a file system that gives no
  serial or no id (zero) compares the paths as before.
- storage::mark_used wrote a folder's empty `.used` mark again, which
  leaves its time on Windows: to the cache's budget an unpacked tree, a
  tool, a Rust toolchain or a shader cache looked unused since its first
  use. It now also sets the time (the write stays: on Unix it needs only
  write access, setting a time needs the owner), and the unpack and
  from-source's tools and Rust mark their folders through it.
- modhook::dev_mods_value let std's join_paths put a Windows folder with
  `;` in its name in quotes, which the game's reading of LONGSHOT_DEV_MODS
  does not undo. Such a folder is refused on every OS, as on Unix.
- perf's send lock left as a directory was never cleared on Windows (a
  file over a directory is access denied there, not "exists"), so every
  send went unlocked. Something at the lock's name is now "there" on
  both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
pmwork-personal changed title from WIP: fix(builder): build-driver's tests pass on Windows: hard links, cache use marks, dev mod folders, send lock to fix(builder): build-driver's tests pass on Windows: hard links, cache use marks, dev mod folders, send lock 2026-11-26 01:28:51 +00:00
Member

Possibly related, for context:

  • PR #2581 fix(builder): a Windows longshot-builder no longer takes its file's zero padding for a download cut short — Separate Windows builder PE-padding fix; this PR reports it as the remaining test failure and was tested with it atop.
Possibly related, for context: - PR #2581 fix(builder): a Windows longshot-builder no longer takes its file's zero padding for a download cut short — Separate Windows builder PE-padding fix; this PR reports it as the remaining test failure and was tested with it atop.
test(build-driver): the manifest mods check names no two folders that differ only in case
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
CI / What the change needs (pull_request) Successful in 14s
CI / Third-party parts and guide screenshots (pull_request) Failing after 17s
PR description / Title and description (pull_request_target) Successful in 10s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 18s
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
97683bbead
manifest_mods_are_found_and_ordered_as_the_game_does made the mods `A` and
`a/inner`. On a case-insensitive file system (Windows, macOS's default)
those are one folder: `a/inner` was made in the mod `A`, which the code
rightly does not look below, so the test failed there. `ab/inner` keeps
each order the test checks.

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

Merged main (d9fa80cd) into the branch. The PE padding test passes on main since #2581. One new test fails on Windows on main: read::tests::manifest_mods_are_found_and_ordered_as_the_game_does (#2607). Its mods A and a/inner are one folder on a case-insensitive file system (Windows, macOS's default), so the test now uses ab/inner, which keeps each order it checks.

On Windows @ 97683bbe: cargo test -p build-driver 150 passed, 0 failed (main: 141 passed, 8 failed); build-core 34 passed; longshot-builder the same 7 failures as main; fmt and clippy clean. The description has the new numbers and the suite's results against main.

The first CI run failed in 0 to 1 s in every job: the runner could not pull the CI image (its registry answered HTTP to an HTTPS request). This push runs CI again.

Merged `main` (d9fa80cd) into the branch. The PE padding test passes on `main` since #2581. One new test fails on Windows on `main`: `read::tests::manifest_mods_are_found_and_ordered_as_the_game_does` (#2607). Its mods `A` and `a/inner` are one folder on a case-insensitive file system (Windows, macOS's default), so the test now uses `ab/inner`, which keeps each order it checks. On Windows @ 97683bbe: `cargo test -p build-driver` 150 passed, 0 failed (`main`: 141 passed, 8 failed); build-core 34 passed; longshot-builder the same 7 failures as `main`; fmt and clippy clean. The description has the new numbers and the suite's results against `main`. The first CI run failed in 0 to 1 s in every job: the runner could not pull the CI image (its registry answered HTTP to an HTTPS request). This push runs CI again.
Owner
@review
BeanBot left a comment

Recommendation: Request changes. The Windows fixes have test evidence, but the change adds unsafe code outside the repository’s permitted locations and combines unrelated fixes that the project requires to be separate.

The change fixes Windows file identity, cache-use timestamps, dev-mod path handling and stale send-lock recovery, and repairs several platform-sensitive tests. These fixes improve builder behavior, at the cost of broadening this pull request across unrelated causes.

Blocking (1): must change before merging.

  1. L1 builder/crates/build-core/src/fsx.rs:61: This adds an unsafe Windows API call outside the locations permitted by the builder’s code rules. (more on the line) Do: Move the Windows file identity system call into the permitted sys.rs Windows module and expose a safe wrapper to fsx.rs.

Should fix (1): not blocking, but worth doing before merging.

  • L2: The pull request combines four unrelated production fixes, contrary to the repository’s one-topic rule. When: Hard-link identity, cache timestamps, dev-mod path serialization and send-lock takeover have separate causes and affect separate builder paths; passing the Windows test suite is their common discovery, not a common fix. Do: Split the unrelated fixes and their associated tests into focused pull requests.

@fix can do L1 and L2.

Checks: Failing on this head, which is behind its base, where it passes: CI / Third-party parts and guide screenshots (pull_request). @rebase (or @fix) brings it up to date and runs it again; not held against it. Still running: 7 checks.

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

Does it help: Yes. The author reports build-driver tests changing from 141 passed and 8 failed on the base to 150 passed and 0 failed on Windows at HEAD; the targeted fix tests also failed for their respective bugs before the fixes. This is not a game performance change.

Other systems: The file identity check also affects linking or copying build files and compiler toolchain identification. Cache marks affect sources, tools, Rust, runtimes and shader caches on Windows and Linux; the author reports Windows tests, while Linux CI is still running. The dev-mod and send-lock paths do not affect GPU rendering.

Switches: None added, changed or removed.

Reviewed: 97683bbead against d9fa80cd12: Read the repository rules, PR template, standards, diff and commit messages; inspected the changed functions, their tests and relevant callers. Large changed files and their unrelated tests were skimmed rather than read in full; Tooling’s AGENTS.md was unavailable in the checkout. No generated files or recorded game runs were changed.; nothing run (a code review).

Checked and fine:

  • The hard-link test checks both identity and a distinct copy.
  • The new cache timestamp test checks an old mark and an old file.
  • The changed commits record AI assistance.
  • No game-derived files, generated files or switch-table changes appear in the diff.

Testing: Read-only review; no code or tests were run. The author reports Windows test results; the supplied CI status shows checks still running.

Overlaps and merge order: Not determined; network access was unavailable.


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

**Recommendation: Request changes.** The Windows fixes have test evidence, but the change adds unsafe code outside the repository’s permitted locations and combines unrelated fixes that the project requires to be separate. The change fixes Windows file identity, cache-use timestamps, dev-mod path handling and stale send-lock recovery, and repairs several platform-sensitive tests. These fixes improve builder behavior, at the cost of broadening this pull request across unrelated causes. **Blocking (1)**: must change before merging. 1. **L1** `builder/crates/build-core/src/fsx.rs:61`: This adds an unsafe Windows API call outside the locations permitted by the builder’s code rules. (more on the line) **Do:** Move the Windows file identity system call into the permitted sys.rs Windows module and expose a safe wrapper to fsx.rs. **Should fix (1)**: not blocking, but worth doing before merging. - **L2**: The pull request combines four unrelated production fixes, contrary to the repository’s one-topic rule. *When:* Hard-link identity, cache timestamps, dev-mod path serialization and send-lock takeover have separate causes and affect separate builder paths; passing the Windows test suite is their common discovery, not a common fix. **Do:** Split the unrelated fixes and their associated tests into focused pull requests. `@fix` can do L1 and L2. **Checks:** Failing on this head, which is behind its base, where it passes: `CI / Third-party parts and guide screenshots (pull_request)`. `@rebase` (or `@fix`) brings it up to date and runs it again; not held against it. Still running: 7 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes. The author reports build-driver tests changing from 141 passed and 8 failed on the base to 150 passed and 0 failed on Windows at HEAD; the targeted fix tests also failed for their respective bugs before the fixes. This is not a game performance change. **Other systems:** The file identity check also affects linking or copying build files and compiler toolchain identification. Cache marks affect sources, tools, Rust, runtimes and shader caches on Windows and Linux; the author reports Windows tests, while Linux CI is still running. The dev-mod and send-lock paths do not affect GPU rendering. **Switches:** None added, changed or removed. **Reviewed:** 97683bbead9d against d9fa80cd122d: Read the repository rules, PR template, standards, diff and commit messages; inspected the changed functions, their tests and relevant callers. Large changed files and their unrelated tests were skimmed rather than read in full; Tooling’s AGENTS.md was unavailable in the checkout. No generated files or recorded game runs were changed.; nothing run (a code review). **Checked and fine:** - The hard-link test checks both identity and a distinct copy. - The new cache timestamp test checks an old mark and an old file. - The changed commits record AI assistance. - No game-derived files, generated files or switch-table changes appear in the diff. **Testing:** Read-only review; no code or tests were run. The author reports Windows test results; the supplied CI status shows checks still running. **Overlaps and merge order:** Not determined; network access was unavailable. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
@ -49,0 +58,4 @@
/// The file at `p`'s volume serial and file id (links followed, as `fs::metadata` does); none when it can't be read,
/// or the file system fills in no serial or no id (zero: files of two such volumes, or two files, would be one).
#[cfg(windows)]
#[allow(unsafe_code)]
Member

L1 (blocking): This adds an unsafe Windows API call outside the locations permitted by the builder’s code rules.

When: The new file identity query opts out of the workspace’s unsafe-code restriction in fsx.rs, while docs/dev/standards.md permits builder unsafe code only in build-core’s sys.rs Windows module and game-files’ disk system calls.

Do: Move the Windows file identity system call into the permitted sys.rs Windows module and expose a safe wrapper to fsx.rs.

**L1** (blocking): This adds an unsafe Windows API call outside the locations permitted by the builder’s code rules. *When:* The new file identity query opts out of the workspace’s unsafe-code restriction in fsx.rs, while docs/dev/standards.md permits builder unsafe code only in build-core’s sys.rs Windows module and game-files’ disk system calls. **Do:** Move the Windows file identity system call into the permitted sys.rs Windows module and expose a safe wrapper to fsx.rs.
Member
@fix
fix(build-core): move Windows file identity query into sys
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
PR description / Title and description (pull_request_target) Failing after 9s
CI / What the change needs (pull_request) Successful in 10s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Waiting to run
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Waiting to run
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Waiting to run
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Waiting to run
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Waiting to run
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Waiting to run
CI / Website build and checks (pull_request) Waiting to run
CI / Third-party parts and guide screenshots (pull_request) Failing after 13s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 15s
b1fb288972
As the review on #2587 asked.
BeanBot left a comment

Recommendation: Approve. The pull request still combines four unrelated production fixes, contrary to the repository’s one-topic rule. Moving the Windows identity query preserves its behavior but does not address that issue. Nothing blocking is left. Recommend approval; not approved on the forge.

What @fix changed
I changed this pull request: the new head is b1fb288972. I merged main (a845154d34) into it, as it has merge commits. I edited its description to match the change.

Changed

  • Windows file identity query in fsx.rs:46: Moved the unsafe query into the Windows module in builder/crates/build-core/src/sys.rs:309 and exposed a safe wrapper at sys.rs:34. The existing identity comparison and path fallback are preserved. Tests were not run, as requested.

Nothing was built or run: the checks run again on the new head.

The builder fixes hard-link detection, cache-use marks, developer mod paths and stale send locks on Windows. They address separate problems and should be reviewed and merged separately.

Should fix (1): not blocking, but worth doing before merging.

  • L2: The pull request combines four unrelated production fixes, contrary to the repository’s one-topic rule. When: Hard-link identity, cache timestamps, dev-mod path serialization and send-lock takeover have separate causes and affect separate builder paths; passing the Windows test suite is their common discovery, not a common fix. Do: Split the unrelated fixes and their associated tests into focused pull requests.

@fix can do L2.

Checks: they run again on this head (CI / Third-party parts and guide screenshots (pull_request) failed on the last one); a failure shows on the pull request.

Also noticed (3; not asked for, not blocking)
  • The diff against the supplied base includes merged main changes to frame generation and GPU replay.
  • The base-to-HEAD diff also includes merged frame-generation and device-loss changes outside the builder work.
  • The current head still needs the Windows run identified in the pull request description.
More: does it help, other systems, switches, what was read

Does it help: Unproven on the current head. The author reports 150 build-driver tests passing on Windows at 97683bbe, compared with 141 passing and 8 failing on the base; the subsequent file-identity move has not been tested.

Other systems: The identity query is Windows-only; its safe wrapper preserves the previous query and path fallback. Linux retains its existing identity comparison. The current-head Windows and CI results are pending.

Switches: The fix adds or changes no switches. The base-to-HEAD diff also contains RX_VK_FG_GAME_CLOCK, default on, from a merged main change; its default and measurements were not assessed in this re-check.

Reviewed: b1fb288972 against a845154d34: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the file-identity fix and its surrounding code, and the builder diff. Skimmed the remaining base-to-HEAD diff and recorded test results; not all changed files were read in full. docs/review-checklist.md was absent.; nothing run (a code review).

Checked and fine:

  • The file identity query moved into the Windows sys module without changing its comparison or fallback.
  • The fix does not remove or route around the pull request’s hard-link detection.

Testing: No commands that build or run tests were executed. The author’s Windows results are for 97683bbe; CI has not run on the current head.

Overlaps and merge order: Not checked; network access is unavailable.


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

**Recommendation: Approve.** The pull request still combines four unrelated production fixes, contrary to the repository’s one-topic rule. Moving the Windows identity query preserves its behavior but does not address that issue. Nothing blocking is left. Recommend approval; not approved on the forge. **What `@fix` changed** I changed this pull request: the new head is b1fb288972b1. I merged `main` (a845154d3415) into it, as it has merge commits. I edited its description to match the change. **Changed** - **Windows file identity query in fsx.rs:46**: Moved the unsafe query into the Windows module in builder/crates/build-core/src/sys.rs:309 and exposed a safe wrapper at sys.rs:34. The existing identity comparison and path fallback are preserved. Tests were not run, as requested. Nothing was built or run: the checks run again on the new head. The builder fixes hard-link detection, cache-use marks, developer mod paths and stale send locks on Windows. They address separate problems and should be reviewed and merged separately. **Should fix (1)**: not blocking, but worth doing before merging. - **L2**: The pull request combines four unrelated production fixes, contrary to the repository’s one-topic rule. *When:* Hard-link identity, cache timestamps, dev-mod path serialization and send-lock takeover have separate causes and affect separate builder paths; passing the Windows test suite is their common discovery, not a common fix. **Do:** Split the unrelated fixes and their associated tests into focused pull requests. `@fix` can do L2. **Checks:** they run again on this head (`CI / Third-party parts and guide screenshots (pull_request)` failed on the last one); a failure shows on the pull request. <details> <summary>Also noticed (3; not asked for, not blocking)</summary> - The diff against the supplied base includes merged main changes to frame generation and GPU replay. - The base-to-HEAD diff also includes merged frame-generation and device-loss changes outside the builder work. - The current head still needs the Windows run identified in the pull request description. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven on the current head. The author reports 150 build-driver tests passing on Windows at 97683bbe, compared with 141 passing and 8 failing on the base; the subsequent file-identity move has not been tested. **Other systems:** The identity query is Windows-only; its safe wrapper preserves the previous query and path fallback. Linux retains its existing identity comparison. The current-head Windows and CI results are pending. **Switches:** The fix adds or changes no switches. The base-to-HEAD diff also contains RX_VK_FG_GAME_CLOCK, default on, from a merged main change; its default and measurements were not assessed in this re-check. **Reviewed:** b1fb288972b1 against a845154d3415: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the file-identity fix and its surrounding code, and the builder diff. Skimmed the remaining base-to-HEAD diff and recorded test results; not all changed files were read in full. docs/review-checklist.md was absent.; nothing run (a code review). **Checked and fine:** - The file identity query moved into the Windows sys module without changing its comparison or fallback. - The fix does not remove or route around the pull request’s hard-link detection. **Testing:** No commands that build or run tests were executed. The author’s Windows results are for 97683bbe; CI has not run on the current head. **Overlaps and merge order:** Not checked; network access is unavailable. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.</sub>
HumanBean deleted branch fix/build-driver-windows-tests 2026-11-28 04:09:56 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 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!2587
No description provided.