fix(builder): a program the update can't replace keeps its record #3012

Open
PedroRossi wants to merge 2 commits from PedroRossi:fix/release-record-kept into main
Contributor

Summary

After a failed program swap, a version folder forgets which release it holds. place
(builder/crates/release/src/install.rs) deletes longshot_release.json, the record of the release the folder holds,
then renames the new program over the old one. When that rename fails (on Windows: the program is running, or a
scanner holds the file past the wait), the old program stays, but its record is gone, and the next start, finding no
record, checks the program again or downloads the release in full.

place now moves the record to longshot_release.json.previous before the swap and restores it if the move fails. If a backup already exists, it stops before changing the program or record. If restoration fails, it reports the error and leaves the backup in place.

How to see it on main: make the rename fail (the test puts a folder where the program goes): place returns the error,
and longshot_release.json is gone.

Read first: place.

Testing

Tested: on this PC (Linux), before the latest fix: the new test (a_program_that_cannot_be_replaced_keeps_its_record) fails on main, the record gone, and passed with the earlier fix; the release crate's tests, clippy -D warnings, rustfmt. These checks are pending on the current head. As pr create asks for
a builder change: Debian 13, GeForce GTX 1660 SUPER, NVIDIA 550.163.01: the game built by a builder from main @ 1938a302 with #3009, #3011 and #3012 merged, through the PC's job queue, played from the Market entrance repository save, then the control bridge's quit; exit 0. The release crate's code runs when a version is fetched or installed, not in a build or the game. mise run test (--strict) on main @ 1938a302, and on main with the earlier fix merged (together with #3009, #3010, #3011, #3013, #3014, from the same audit): 775 passed, 145 failed, 10 skipped both ways, so none failed only with that fix. The current head is pending. The 145 are named at the end.

Still to test:

  • Windows, by hand: update a version while its builder runs, so that the swap fails, expecting its
    longshot_release.json kept and the next start not to download it again (a failed move can also happen on other platforms)

Measurements

Nothing to measure: the change moves a small record file during an update.

Risks

A failed move restores the record when restoration succeeds; otherwise the backup remains and the error is reported. An existing backup stops the update. If removing the backup after a successful swap fails, the new record is not written.

Checklist

Ready for review

  • One topic, on current main; 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 on the current head is pending (failures from the earlier run that also fail on main are named).
  • 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: the game-free test fails on main; its run on the current head is pending.
  • 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.
The 145 checks of mise run test that fail on main @ 1938a302 on this PC too, with or without this change

97 need a tool this PC doesn't have on PATH (--strict fails them):

  • clang (63): test_audio_output_devices.py, test_box_light_reuse.py, test_camera_centering.py, test_camera_speed.py, test_drive_target.py, test_dynres_sites.py, test_exclusive_marks.py, test_fixed_scale_sites.py, test_floor_carry_step.py, test_frame_rate_cap_step.py, test_frame_whole.py, test_free_view_anchor.py, test_fullscreen_monitor_platform.py, test_high_fps_fixes.py, test_horse_jump_step.py, test_hos_ab.py, test_hud_layout.py, test_jump_takeoff_step.py, test_linux_audio_output.py, test_loop_step.py, test_menu_hooks.py, test_microphone_test_gain.py, test_monitor_friendly_names.py, test_mouse_native.py, test_movement_speed.py, test_movie_frame_count.py, test_nvn_null_pool.py, test_nvn_tex_builder_guard.py, test_ocarina_wait.py, test_ocb_hold.py, test_oot_barrier.py, test_oot_camera_clearance.py, test_oot_cloth.py, test_oot_cloth_60.py, test_oot_cloth_time.py, test_oot_damage.py, test_oot_fov.py, test_oot_heap_retry.py, test_oot_jitter.py, test_oot_shadow.py, test_oot_shadow_fit.py, test_oot_transition_autosave.py, test_oot_voice_option.py, test_oot_wide_bubble.py, test_oot_wide_save_picture.py, test_player_update_sites.py, test_sampler_stack_walk.py, test_saved_turn_rate.py, test_scarecrow_timing.py, test_scene_format.py, test_sdl_monitor_names.py, test_shadow_slot.py, test_song_note_cue.py, test_sound_held_frames.py, test_sprint.py, test_svc_core_mask.py, test_tex_compact.py, test_text_speed.py, test_title_card_sites.py, test_water_substeps.py, test_web_floor_steps.py, test_wide_sites.py, test_wide_ui.py
  • spirv-val (20): f2i_immediate, global_load_16, native_suatom, test_coop_spirv.py, test_default_point_size.py, test_depth_sample_types.py, test_draw_parameters.py, test_fsr4_tune.py, test_guest_page_fast32.py, test_image_arrays.py, test_mesh_fallback_layout.py, test_mesh_unreachable_outputs.py, test_mma_software.py, test_native_float_atomic_add.py, test_nonuniform_image_arrays.py, test_spirv_struct_identity.py, test_texture_phi_dominance.py, test_unsigned_image_types.py, test_vendor_translation.py, test_wmma16_spirv_val.py
  • clang++ (7): test_dead_targets_sweep.py, test_lower_depbar.py, test_lower_lds_after_sts.py, test_lower_register_markers.py, test_native_suatom.py, test_program_answer_domains.py, test_target_pool_cap.py
  • glslang (5): test_framegen_hdr.py, test_fsr3fi_hud_layer.py, test_fsr3fi_hudless_colour.py, test_host_shaders.py, test_temporal_present_bandwidth.py
  • glslang, spirv-val (1): test_fsr3_shaders.py
  • llvm-mc (1): test_lifter.py

48 fail on main itself: test_blocks_at_start.py, test_bug_report.py, test_cloth_kernels.py, test_cloth_loops.py, test_cloth_sphere.py, test_cloth_step12.py, test_cloth_step8.py, test_cloth_step9.py, test_control_picture.py, test_crash_record.py, test_crt_options.py, test_dev_update.py, test_dlssg_pace.py, test_draw_stream_visibility.py, test_framegen_resources.py, test_fsr_uniform_ownership.py, test_game_boundary.py, test_guest_holes.py, test_image_reaper_threads.py, test_image_view_retry.py, test_input_background.py, test_keyboard_option.py, test_linux_pressure.py, test_loaded_modules_drop.py, test_log_levels.py, test_menu_keys.py, test_menu_save_atomic.py, test_mesh_first_types.py, test_oot_occ_raster.py, test_option_ids.py, test_perf_send.py, test_pipeline_tour.py, test_present_acquire_ahead.py, test_present_image_free.py, test_present_source_crop.py, test_program_cache_cleanup.py, test_program_cache_one_variant.py, test_readback_timeout_reuse.py, test_recording_admission.py, test_screensaver.py, test_switch_table.py, test_target_retention.py, test_tex_desc_memo.py, test_thinlto_tls.py, test_upscaler_round_trip.py, test_vram_compact.py, test_windows_display_startup.py, test_windows_on_linux.py


Found in an AI-assisted audit of the repository. The test, the fix, the runs and this description were made with Claude Code; I reviewed them.

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

🤖 Generated with Claude Code

## Summary After a failed program swap, a version folder forgets which release it holds. `place` (`builder/crates/release/src/install.rs`) deletes `longshot_release.json`, the record of the release the folder holds, then renames the new program over the old one. When that rename fails (on Windows: the program is running, or a scanner holds the file past the wait), the old program stays, but its record is gone, and the next start, finding no record, checks the program again or downloads the release in full. `place` now moves the record to `longshot_release.json.previous` before the swap and restores it if the move fails. If a backup already exists, it stops before changing the program or record. If restoration fails, it reports the error and leaves the backup in place. How to see it on main: make the rename fail (the test puts a folder where the program goes): `place` returns the error, and `longshot_release.json` is gone. Read first: `place`. ## Testing **Tested:** on this PC (Linux), before the latest fix: the new test (`a_program_that_cannot_be_replaced_keeps_its_record`) fails on main, the record gone, and passed with the earlier fix; the release crate's tests, clippy -D warnings, rustfmt. These checks are pending on the current head. As `pr create` asks for a builder change: Debian 13, GeForce GTX 1660 SUPER, NVIDIA 550.163.01: the game built by a builder from main @ 1938a302 with #3009, #3011 and #3012 merged, through the PC's job queue, played from the Market entrance repository save, then the control bridge's quit; exit 0. The release crate's code runs when a version is fetched or installed, not in a build or the game. `mise run test` (`--strict`) on main @ 1938a302, and on main with the earlier fix merged (together with #3009, #3010, #3011, #3013, #3014, from the same audit): 775 passed, 145 failed, 10 skipped both ways, so none failed only with that fix. The current head is pending. The 145 are named at the end. **Still to test:** - Windows, by hand: update a version while its builder runs, so that the swap fails, expecting its `longshot_release.json` kept and the next start not to download it again (a failed move can also happen on other platforms) ## Measurements Nothing to measure: the change moves a small record file during an update. ## Risks A failed move restores the record when restoration succeeds; otherwise the backup remains and the error is reported. An existing backup stops the update. If removing the backup after a successful swap fails, the new record is not written. ## Checklist ### Ready for review - [x] One topic, on current `main`; 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` on the current head is pending (failures from the earlier run that also fail on `main` are named). - [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 fix: the game-free test fails on `main`; its run on the current head is pending. - [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. <details><summary>The 145 checks of <code>mise run test</code> that fail on main @ 1938a302 on this PC too, with or without this change</summary> 97 need a tool this PC doesn't have on PATH (`--strict` fails them): - clang (63): test_audio_output_devices.py, test_box_light_reuse.py, test_camera_centering.py, test_camera_speed.py, test_drive_target.py, test_dynres_sites.py, test_exclusive_marks.py, test_fixed_scale_sites.py, test_floor_carry_step.py, test_frame_rate_cap_step.py, test_frame_whole.py, test_free_view_anchor.py, test_fullscreen_monitor_platform.py, test_high_fps_fixes.py, test_horse_jump_step.py, test_hos_ab.py, test_hud_layout.py, test_jump_takeoff_step.py, test_linux_audio_output.py, test_loop_step.py, test_menu_hooks.py, test_microphone_test_gain.py, test_monitor_friendly_names.py, test_mouse_native.py, test_movement_speed.py, test_movie_frame_count.py, test_nvn_null_pool.py, test_nvn_tex_builder_guard.py, test_ocarina_wait.py, test_ocb_hold.py, test_oot_barrier.py, test_oot_camera_clearance.py, test_oot_cloth.py, test_oot_cloth_60.py, test_oot_cloth_time.py, test_oot_damage.py, test_oot_fov.py, test_oot_heap_retry.py, test_oot_jitter.py, test_oot_shadow.py, test_oot_shadow_fit.py, test_oot_transition_autosave.py, test_oot_voice_option.py, test_oot_wide_bubble.py, test_oot_wide_save_picture.py, test_player_update_sites.py, test_sampler_stack_walk.py, test_saved_turn_rate.py, test_scarecrow_timing.py, test_scene_format.py, test_sdl_monitor_names.py, test_shadow_slot.py, test_song_note_cue.py, test_sound_held_frames.py, test_sprint.py, test_svc_core_mask.py, test_tex_compact.py, test_text_speed.py, test_title_card_sites.py, test_water_substeps.py, test_web_floor_steps.py, test_wide_sites.py, test_wide_ui.py - spirv-val (20): f2i_immediate, global_load_16, native_suatom, test_coop_spirv.py, test_default_point_size.py, test_depth_sample_types.py, test_draw_parameters.py, test_fsr4_tune.py, test_guest_page_fast32.py, test_image_arrays.py, test_mesh_fallback_layout.py, test_mesh_unreachable_outputs.py, test_mma_software.py, test_native_float_atomic_add.py, test_nonuniform_image_arrays.py, test_spirv_struct_identity.py, test_texture_phi_dominance.py, test_unsigned_image_types.py, test_vendor_translation.py, test_wmma16_spirv_val.py - clang++ (7): test_dead_targets_sweep.py, test_lower_depbar.py, test_lower_lds_after_sts.py, test_lower_register_markers.py, test_native_suatom.py, test_program_answer_domains.py, test_target_pool_cap.py - glslang (5): test_framegen_hdr.py, test_fsr3fi_hud_layer.py, test_fsr3fi_hudless_colour.py, test_host_shaders.py, test_temporal_present_bandwidth.py - glslang, spirv-val (1): test_fsr3_shaders.py - llvm-mc (1): test_lifter.py 48 fail on main itself: test_blocks_at_start.py, test_bug_report.py, test_cloth_kernels.py, test_cloth_loops.py, test_cloth_sphere.py, test_cloth_step12.py, test_cloth_step8.py, test_cloth_step9.py, test_control_picture.py, test_crash_record.py, test_crt_options.py, test_dev_update.py, test_dlssg_pace.py, test_draw_stream_visibility.py, test_framegen_resources.py, test_fsr_uniform_ownership.py, test_game_boundary.py, test_guest_holes.py, test_image_reaper_threads.py, test_image_view_retry.py, test_input_background.py, test_keyboard_option.py, test_linux_pressure.py, test_loaded_modules_drop.py, test_log_levels.py, test_menu_keys.py, test_menu_save_atomic.py, test_mesh_first_types.py, test_oot_occ_raster.py, test_option_ids.py, test_perf_send.py, test_pipeline_tour.py, test_present_acquire_ahead.py, test_present_image_free.py, test_present_source_crop.py, test_program_cache_cleanup.py, test_program_cache_one_variant.py, test_readback_timeout_reuse.py, test_recording_admission.py, test_screensaver.py, test_switch_table.py, test_target_retention.py, test_tex_desc_memo.py, test_thinlto_tls.py, test_upscaler_round_trip.py, test_vram_compact.py, test_windows_display_startup.py, test_windows_on_linux.py </details> --- Found in an AI-assisted audit of the repository. The test, the fix, the runs and this description were made with Claude Code; I reviewed them. Co-Authored-By: Claude Opus 5.5 <[email protected]> 🤖 Generated with [Claude Code](https://claude.com/claude-code)
place removes longshot_release.json, the record of the installed version, then renames the new program over the old
one: when the rename fails (on Windows, the program running, or a scanner holding it past the wait), the old program
stays without its record, and the next start checks or downloads it all again. The test's program can't be replaced
(a folder in its place); fails on main.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(builder): a program the update can't replace keeps its record
Some checks are pending
CI / What the change needs (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Blocked by required conditions
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
PR description / Title and description (pull_request_target) Successful in 7s
773c6dff3f
place reads the record before it removes it, and writes it back when the move fails: the program before is still
there, and so is the record of what it is.

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

Tested in game: Debian 13, GeForce GTX 1660 SUPER, NVIDIA 550.163.01: the game built by a builder from main @ 1938a302 with this change merged (and my two other release-crate pull requests), through the PC's job queue, played from the Market entrance repository save, then the control bridge's quit; exit 0. The release crate's code runs when a version is fetched or installed, not in a build or the game.

Tested in game: Debian 13, GeForce GTX 1660 SUPER, NVIDIA 550.163.01: the game built by a builder from main @ 1938a302 with this change merged (and my two other release-crate pull requests), through the PC's job queue, played from the Market entrance repository save, then the control bridge's quit; exit 0. The release crate's code runs when a version is fetched or installed, not in a build or the game.
PedroRossi changed title from WIP: fix(builder): a program the update can't replace keeps its record to fix(builder): a program the update can't replace keeps its record 2026-12-02 16:12:17 +00:00
Owner
@review
BeanBot left a comment

Recommendation: Approve. The test shows that the record is restored after a simulated failed rename, but the Windows failure the fix targets has not yet been tested. Restoration can also fail and leave the original problem in place. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.

The change saves the installed release record before replacing the program and restores it if the move fails. It avoids a later recheck or download in the tested case, at the cost of an additional small file read and a recovery path that can itself fail.

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

  • L1 builder/crates/release/src/install.rs:530: The restore write can fail after the original record has been deleted, and its error is ignored. (more on the line) Do: Preserve the existing record on disk, for example by moving it aside before the swap and restoring it on failure, and handle recovery errors explicitly.

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L2 builder/crates/release/src/install.rs:528: The Windows held-program failure remains untested. (more on the line) Do: On Windows, hold the installed program open through the retries, attempt the update, and verify the old program and record remain and the next fetch recognizes them.

@fix can do L1.

Checks: Still running: 10 checks.

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

Does it help: Yes, for the simulated failure: the author reports that the new test fails on base 1938a302 and passes on this head. The actual Windows held-program case remains untested.

Other systems: The release fetch path is used by the builder and can be invoked by the launcher. Linux and Windows use the changed record handling; the test simulates a rename failure with a directory, while Windows sharing violations and retry behavior still need a real run. The game and GPU rendering do not execute this path.

Switches: None.

Reviewed: 773c6dff3f against 1938a302fe: Read both changed files, the installation and swap paths, repository contribution rules, standards and pull request template. Read the diff and both commit messages; checked record readers and fetch callers by search. No generated files or translations changed. The referenced adjacent Tooling AGENTS.md and docs/review-checklist.md were absent.; nothing run (a code review).

Checked and fine:

  • The new test checks the record contents and would fail if the restoration were removed.
  • Both commits record AI assistance; the diff contains no game-derived files, generated files, API changes or switch changes.

Testing: No code or tests were run during review. The author reports the release crate tests, clippy and rustfmt passed on Linux; CI is still running.

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.

**Recommendation: Approve.** The test shows that the record is restored after a simulated failed rename, but the Windows failure the fix targets has not yet been tested. Restoration can also fail and leave the original problem in place. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge. The change saves the installed release record before replacing the program and restores it if the move fails. It avoids a later recheck or download in the tested case, at the cost of an additional small file read and a recovery path that can itself fail. **Should fix (1)**: not blocking, but worth doing before merging. - **L1** `builder/crates/release/src/install.rs:530`: The restore write can fail after the original record has been deleted, and its error is ignored. (more on the line) **Do:** Preserve the existing record on disk, for example by moving it aside before the swap and restoring it on failure, and handle recovery errors explicitly. **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L2** `builder/crates/release/src/install.rs:528`: The Windows held-program failure remains untested. (more on the line) **Do:** On Windows, hold the installed program open through the retries, attempt the update, and verify the old program and record remain and the next fetch recognizes them. `@fix` can do L1. **Checks:** Still running: 10 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes, for the simulated failure: the author reports that the new test fails on base 1938a302 and passes on this head. The actual Windows held-program case remains untested. **Other systems:** The release fetch path is used by the builder and can be invoked by the launcher. Linux and Windows use the changed record handling; the test simulates a rename failure with a directory, while Windows sharing violations and retry behavior still need a real run. The game and GPU rendering do not execute this path. **Switches:** None. **Reviewed:** 773c6dff3fdc against 1938a302feb0: Read both changed files, the installation and swap paths, repository contribution rules, standards and pull request template. Read the diff and both commit messages; checked record readers and fetch callers by search. No generated files or translations changed. The referenced adjacent Tooling AGENTS.md and docs/review-checklist.md were absent.; nothing run (a code review). **Checked and fine:** - The new test checks the record contents and would fail if the restoration were removed. - Both commits record AI assistance; the diff contains no game-derived files, generated files, API changes or switch changes. **Testing:** No code or tests were run during review. The author reports the release crate tests, clippy and rustfmt passed on Linux; CI is still running. **Overlaps and merge order:** Not checked; the network is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
@ -525,3 +527,2 @@
let _ = std::fs::remove_file(dir.join(RECORD));
crate::swap::while_held(|| std::fs::rename(made, program), &std::thread::sleep)
.map_err(|e| FetchError::io(program, &e))?;
if let Err(e) = crate::swap::while_held(|| std::fs::rename(made, program), &std::thread::sleep) {
Member

L2 (should fix): The Windows held-program failure remains untested.

When: The automated test makes the destination a directory; it does not exercise Windows sharing violations, the retry wait, or restoration after an executable is held open.

Do: On Windows, hold the installed program open through the retries, attempt the update, and verify the old program and record remain and the next fetch recognizes them.

**L2** (should fix): The Windows held-program failure remains untested. *When:* The automated test makes the destination a directory; it does not exercise Windows sharing violations, the retry wait, or restoration after an executable is held open. **Do:** On Windows, hold the installed program open through the retries, attempt the update, and verify the old program and record remain and the next fetch recognizes them.
@ -527,1 +528,3 @@
.map_err(|e| FetchError::io(program, &e))?;
if let Err(e) = crate::swap::while_held(|| std::fs::rename(made, program), &std::thread::sleep) {
if let Some(bytes) = before {
let _ = std::fs::write(dir.join(RECORD), bytes);
Member

L1 (should fix): The restore write can fail after the original record has been deleted, and its error is ignored.

When: If the program is held and the filesystem becomes full or denies creation during the retry wait, the rename fails and restoring the record fails or leaves a partial file. The next fetch cannot use the record and must check the program or download it again.

Do: Preserve the existing record on disk, for example by moving it aside before the swap and restoring it on failure, and handle recovery errors explicitly.

**L1** (should fix): The restore write can fail after the original record has been deleted, and its error is ignored. *When:* If the program is held and the filesystem becomes full or denies creation during the retry wait, the rename fails and restoring the record fails or leaves a partial file. The next fetch cannot use the record and must check the program or download it again. **Do:** Preserve the existing record on disk, for example by moving it aside before the swap and restoring it on failure, and handle recovery errors explicitly.
Owner
@fix
BeanBot left a comment

Recommendation: Approve. The failed-swap path preserves the old record when restoration succeeds, but the Windows held-program case remains untested. A leftover backup also prevents later updates until it is resolved manually. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.

What @fix changed
I changed this pull request: the new head is 96751022e02a. I rebased it onto main (ad7970c429). I edited its description to match the change.

Changed

  • Preserve the record when a program swap fails: Moved the record aside before the swap, restored it on failure, and reported recovery errors without deleting the backup (builder/crates/release/src/install.rs:527). Updated the failed-swap test and added backup collision coverage (builder/crates/release/src/install/tests.rs:339). Tests were not run as instructed.

Not done

  • Recover interrupted swaps in builder/crates/release/src/install.rs: The filesystem is full, so the edit failed and truncated install.rs. Restoring it also failed for lack of space. After freeing space, restore the file with git show HEAD:builder/crates/release/src/install.rs > builder/crates/release/src/install.rs, then implement recovery and tests for interruptions before and after the program rename.

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

The update moves the old release record aside and restores it if replacing the program fails. This avoids losing the record on that failure path, at the cost of requiring recovery if a backup is left behind.

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

  • L3 builder/crates/release/src/install.rs:530: A leftover backup stops every subsequent update until someone manually resolves it. When: If the process stops after moving the record aside, the next fetch sees longshot_release.json.previous and returns an error instead of recovering and continuing the update. Do: Recover an interrupted swap safely on the next fetch, checking the program before restoring or discarding the backup, and test interruption on both sides of the program rename.

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L2 builder/crates/release/src/install.rs:528: The Windows held-program failure remains untested. When: The automated test makes the destination a directory; it does not exercise Windows sharing violations, the retry wait, or restoration after an executable is held open. Do: On Windows, hold the installed program open through the retries, attempt the update, and verify the old program and record remain and the next fetch recognizes them.

@fix can do L3.

Checks: they run again on this head; a failure shows on the pull request.

Also noticed (2; not asked for, not blocking)
  • The pull request description still describes reading and rewriting the record, while the fix now renames it aside.
  • The regression test and release-crate checks are pending on the current head.
More: does it help, other systems, switches, what was read

Does it help: Unproven on the current head: the author reports that the earlier fix passed the regression test on Linux, but the revised fix and the Windows held-program case are still pending.

Other systems: The swap path runs on Windows and Linux. The regression test simulates a failed rename with a directory; it does not exercise a Windows-held executable. The game does not run this release-install code.

Switches: None.

Reviewed: 96751022e02a against ad7970c429: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the changed install code and tests, and the swap helper. Skimmed the standards references and recorded runs. The separate review checklist and adjacent Tooling rules were unavailable.; nothing run (a code review).

Checked and fine:

  • A failed program rename restores the saved record when the restore rename succeeds.
  • A failed restoration reports the error and leaves the backup in place.
  • The backup collision test checks that the program, record and existing backup remain unchanged.

Testing: No commands that build or run tests were executed. The author reports the earlier fix passed its Linux regression test; current-head checks and a Windows held-program run are pending.

Overlaps and merge order: Not checked; the network 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 failed-swap path preserves the old record when restoration succeeds, but the Windows held-program case remains untested. A leftover backup also prevents later updates until it is resolved manually. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge. **What `@fix` changed** I changed this pull request: the new head is 96751022e02a. I rebased it onto `main` (ad7970c429a9). I edited its description to match the change. **Changed** - **Preserve the record when a program swap fails**: Moved the record aside before the swap, restored it on failure, and reported recovery errors without deleting the backup (builder/crates/release/src/install.rs:527). Updated the failed-swap test and added backup collision coverage (builder/crates/release/src/install/tests.rs:339). Tests were not run as instructed. **Not done** - **Recover interrupted swaps in builder/crates/release/src/install.rs**: The filesystem is full, so the edit failed and truncated install.rs. Restoring it also failed for lack of space. After freeing space, restore the file with `git show HEAD:builder/crates/release/src/install.rs > builder/crates/release/src/install.rs`, then implement recovery and tests for interruptions before and after the program rename. Nothing was built or run: the checks run again on the new head. The update moves the old release record aside and restores it if replacing the program fails. This avoids losing the record on that failure path, at the cost of requiring recovery if a backup is left behind. **Should fix (1)**: not blocking, but worth doing before merging. - **L3** `builder/crates/release/src/install.rs:530`: A leftover backup stops every subsequent update until someone manually resolves it. *When:* If the process stops after moving the record aside, the next fetch sees longshot_release.json.previous and returns an error instead of recovering and continuing the update. **Do:** Recover an interrupted swap safely on the next fetch, checking the program before restoring or discarding the backup, and test interruption on both sides of the program rename. **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L2** `builder/crates/release/src/install.rs:528`: The Windows held-program failure remains untested. *When:* The automated test makes the destination a directory; it does not exercise Windows sharing violations, the retry wait, or restoration after an executable is held open. **Do:** On Windows, hold the installed program open through the retries, attempt the update, and verify the old program and record remain and the next fetch recognizes them. `@fix` can do L3. **Checks:** they run again on this head; a failure shows on the pull request. <details> <summary>Also noticed (2; not asked for, not blocking)</summary> - The pull request description still describes reading and rewriting the record, while the fix now renames it aside. - The regression test and release-crate checks are pending on the current head. </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 that the earlier fix passed the regression test on Linux, but the revised fix and the Windows held-program case are still pending. **Other systems:** The swap path runs on Windows and Linux. The regression test simulates a failed rename with a directory; it does not exercise a Windows-held executable. The game does not run this release-install code. **Switches:** None. **Reviewed:** 96751022e02a against ad7970c429a9: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the changed install code and tests, and the swap helper. Skimmed the standards references and recorded runs. The separate review checklist and adjacent Tooling rules were unavailable.; nothing run (a code review). **Checked and fine:** - A failed program rename restores the saved record when the restore rename succeeds. - A failed restoration reports the error and leaves the backup in place. - The backup collision test checks that the program, record and existing backup remain unchanged. **Testing:** No commands that build or run tests were executed. The author reports the earlier fix passed its Linux regression test; current-head checks and a Windows held-program run are pending. **Overlaps and merge order:** Not checked; the network 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>
Owner
@fix
Member

The branch moved while I worked (someone pushed 96751022e02a), so I did it again on top of that. I didn't fix this pull request: the branch kept moving while I worked (now at 96751022e02a): ask again when it's quiet. Nothing was pushed.


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

The branch moved while I worked (someone pushed 96751022e02a), so I did it again on top of that. I didn't fix this pull request: the branch kept moving while I worked (now at 96751022e02a): ask again when it's quiet. Nothing was pushed. --- <sub>Automated fix by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
Owner
@fix
Member

The branch moved while I worked (someone pushed 96751022e02a), so I did it again on top of that. I didn't fix this pull request: the branch kept moving while I worked (now at 96751022e02a): ask again when it's quiet. Nothing was pushed.


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

The branch moved while I worked (someone pushed 96751022e02a), so I did it again on top of that. I didn't fix this pull request: the branch kept moving while I worked (now at 96751022e02a): ask again when it's quiet. Nothing was pushed. --- <sub>Automated fix by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
Some checks are pending
CI / What the change needs (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Blocked by required conditions
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
PR description / Title and description (pull_request_target) Successful in 7s
This pull request is broken due to missing fork information.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/release-record-kept:PedroRossi-fix/release-record-kept'
git switch 'PedroRossi-fix/release-record-kept'
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!3012
No description provided.