fix(builder): keep the Windows executable out of its link key #2872
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2872
Loading…
Reference in a new issue
No description provided.
Delete branch "futondestroyer/Longshot:codex/fix-windows-builder-relink"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
When a Windows profile build reaches the link check with its working directory on the same drive as
longshot.exe, Builder can relink after an unchanged build. Its option parser splits the drive colon in the output argument. The remaining rooted path resolves to the same executable, so the key includes the bytes of its previous output.link_inputsnow skips the known output argument before parsing option values. It still tracks actual inputs, including files passed through an option, and the cache still checks the linked outputs separately. The Windows regression uses a drive-qualified output and a real/orderinput.The reviewed branch was built from main
ae32c0dd. Main advanced to28cb22b9with a renderer fix. The integration preview is clean and the Builder source, Cargo manifests, lockfiles, and developer guidance are unchanged between those main revisions.Testing
Tested: Two same-drive Windows profile builds on the reproducing fork revision
f5a30063each cached all 928 native units and relinked. The trace found 51 matching linker arguments and exactly one changing key input, the preceding executable. The source oflink.rsat that revision matches official mainae32c0dd. The same fix hunk in the diagnostic Builder removed that input. After one link to replace the old record, both unchanged profile builds cached all 928 units, matched the new key and skipped the link.The Windows regression failed on test-only commit
f45ea82cwith the output alias present. It passed ondd1bc038from a fresh Cargo target directory, along with both existing link input tests. The fullbuild-compile --librun had 57 passes and two toolchain fixture failures also observed with the baseline binary in this environment.the_builder_s_llvm_comes_before_emsdk_and_the_pathpicked the installedclang.exeinstead of the fixture's extensionless compiler.a_windows_link_of_the_same_inputs_makes_the_same_bytesstopped when Clang could not execute the linker for the fixture's MSVC target. Independent cold source review of the exact base and candidate found no blockers.Forgejo run 58276 passed six jobs. The Linux Rust workspace tests and synthetic end-to-end test passed inside the Rust job. Its red status comes from two existing Clippy diagnostics in
exe_resourcesfor needless borrows of the ICO paths. Exact main and the head have the same source at those lines. Current main reproduced the Guide screenshot source drift and the Website's missing Simulated turf visibility condition. CI runAcross the two Linux game-free jobs, 34 failures have matching normalized first diagnostics on #2865, #2866 and #2872. The five additional #2872 fixtures are
test_blocks_at_start.py,test_image_reaper_threads.py,test_readback_timeout_reuse.py,test_target_retention.py, andtest_vram_compact.py. Their diagnostics concern the newer renderer allocator and eviction source. #2865 run · #2866 runThe full Windows strict suite used the same command and tool setup on current main
28cb22b9and exact headdd1bc038, with separate Cargo target and scratch directories. Main had 811 passes, 56 failures and 48 skips. The PR had 813 passes, 54 failures and 48 skips. All 54 PR failures also failed on main with the same normalized diagnostic, and the skip sets matched. Two checks failed on main only,test_longshot_ctl.pyandtest_memtour.py. The separate Rust formatting preflight had the same existingtoolchain.rsdiff on both. Debug and release Builder preflights completed on both. All five additional fixtures from the Linux CI comparison also failed on this shared Windows main control, with matching failures on the Windows candidate.54 matching Windows failures
tests/test_auto_handheld.pytests/test_blocks_at_start.pytests/test_bug_report.pytests/test_builder_channel.pytests/test_control_picture.pytests/test_coverage_run.pytests/test_crash_record.pytests/test_crt_options.pytests/test_dev_ab.pytests/test_dev_build.pytests/test_dev_migrate.pytests/test_dev_packs.pytests/test_dev_update.pytests/test_framegen_hdr.pytests/test_framegen_resources.pytests/test_fs_path_utf8.pytests/test_game_boundary.pytests/test_image_reaper_threads.pytests/test_image_view_retry.pytests/test_input_background.pytests/test_keyboard_menu_option.pytests/test_keyboard_option.pytests/test_lifter.pytests/test_linux_pressure.pytests/test_loaded_modules_drop.pytests/test_log_batch.pytests/test_log_levels.pytests/test_menu_keys.pytests/test_mods_list.pytests/test_oot_menu_mouse.pytests/test_oot_state_tap.pytests/test_option_ids.pytests/test_parity_gates.pytests/test_perf_send.pytests/test_present_source_crop.pytests/test_profile_symbols.pytests/test_program_cache_cleanup.pytests/test_program_cache_one_variant.pytests/test_program_cache_store_record.pytests/test_readback_timeout_reuse.pytests/test_run_all_mingw.pytests/test_screensaver.pytests/test_switch_table.pytests/test_target_retention.pytests/test_temporal_present_bandwidth.pytests/test_text_keyboard_policy.pytests/test_upscaler_round_trip.pytests/test_vcore_video_acquire.pytests/test_video_catchup.pytests/test_video_hold_early.pytests/test_video_input_limit.pytests/test_vram_compact.pytests/test_windows_display_startup.pytests/test_windows_on_linux.pyStill to test:
Measurements
Verdict: Two repeated links became zero. Both sides compiled zero native units.
Setup: The same warmed Windows profile on the same drive as Builder's working directory. The diagnostic replay used the identical
link.rsblob fromf5a30063and main, then applied the PR's fix hunk.ae32c0dddd1bc038Instrumented runs are unsuitable for comparing elapsed time.
Risks
A previously affected record can miss once because its old key included the executable. The link then writes the new key. Output metadata and every actual linker input remain checked.
Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.Assisted-by:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.Windows verification at
dd1bc038: the regression failed onf45ea82cfor the output alias and passed in a fresh Cargo target on the candidate. The crate had 57 passes and the same two toolchain fixture failures seen with the baseline binary. In the corrected same-drive profile replay, one link replaced the old record and both warmed repeats skipped the link with zero objects compiled.Current main
28cb22b9integrates cleanly withdd1bc038and leaves all tested Builder paths identical. CI logs match 34 Linux game-free failures across #2865, #2866 and #2872. Five additional #2872 fixtures fail in the newer renderer allocator and eviction code. Exact main reproduces the Guide source drift and the Simulated turf Website check. The local full Windows suite and one shared exact-main control are running. Main Actions run 58267 has pending statuses and no downloadable job logs.Matched Windows strict suites completed. Exact main
28cb22b9returned 811 passed, 56 failed and 48 skipped. Published headdd1bc038returned 813 passed, 54 failed and 48 skipped. Every head failure has the same normalized diagnostic on main, including the five additional renderer fixtures from the Linux CI comparison. The skip sets match. This clears the local readiness gate. The existing Linux CI findings remain recorded separately.WIP: fix(builder): keep the Windows executable out of its link keyto fix(builder): keep the Windows executable out of its link key@review
Recommendation: Approve. The code is ready: only testing is left. The reported Windows reproducer stopped relinking on both unchanged builds, and the regression test exercises the drive-colon failure. The build-time measurements required for a builder cache change are still missing. Recommend approval; not approved on the forge.
Builder skips its known output argument before parsing linker options, so an unchanged Windows profile build can reuse its link record instead of hashing and relinking its own executable. The change is small and retains separate output checks.
Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)
builder/crates/build-compile/src/link.rs:58: The required build-time comparison is missing for this cache change. (more on the line) Do: Measure clean, unchanged and one-function-change builds on the same Windows setup against the base, with repeated runs and build sizes, and report the results.Checks: Failing on this head, which is behind its base, where they pass:
CI / Third-party parts and guide screenshots (pull_request),CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request),CI / Website build and checks (pull_request),CI / Game-free checks (run_all.py, part 1/2) (pull_request),CI / Game-free checks (run_all.py, part 2/2) (pull_request),PR description / Title and description (pull_request_target).@rebase(or@fix) brings it up to date and runs them again; not held against it.More: does it help, other systems, switches, what was read
Does it help: Yes for the reported case: two unchanged Windows profile builds relinked twice before the fix and zero times after it, with zero native units compiled on either side. The PR reports that the regression test failed before the fix and passed after it; elapsed build-time savings were not measured.
Other systems: The same function serves the game, renderer, Windows DLSS forwarder and Linux shader-preparation links. Their callers pass the output as a separate argument and also check output metadata; the change does not alter game runtime, GPU, audio, input or save code. Linux and Windows build-time effects beyond the reported Windows replay are not measured.
Switches: None.
Reviewed:
dd1bc0382bagainstae32c0dd3c: Read AGENTS.md, CONTRIBUTING.md, the PR template, the changed link.rs in full, its diff and commits, and the link callers and command construction around the change. Read the applicable builder and standards guidance; skimmed the longer build and builder reference pages. docs/review-checklist.md and ../Tooling/AGENTS.md are absent from the checkout. No generated files or translations changed.; nothing run (a code review).Checked and fine:
Testing: Read-only review; no commands from the project, builds or tests were run. The PR reports a passing Windows regression and two successful unchanged-build replays. Its Linux CI comparison remains listed as still to test.
Overlaps and merge order: Not checked; the network is closed.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@ -55,2 +55,4 @@let (mut objs, mut others) = (Vec::new(), Vec::new());for arg in cmd {// Skip the output before a Windows drive colon can be parsed as an option delimiter.if Path::new(arg) == output {L1 (should fix): The required build-time comparison is missing for this cache change.
When: The reported replay counts avoided links but explicitly cannot compare elapsed time, so it does not show the time saved on an unchanged build or the effect on clean and one-function-change builds.
Do: Measure clean, unchanged and one-function-change builds on the same Windows setup against the base, with repeated runs and build sizes, and report the results.