refactor(builder): the swap of a running builder goes with self-update #3011
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!3011
Loading…
Reference in a new issue
No description provided.
Delete branch "PedroRossi/Longshot:refactor/release-swap-dead-code"
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
old,with_suffix,swapandtidyinbuilder/crates/release/src/swap.rsreplaced the running builder duringself-update, which #2762 removed (the launcher owns updates since). Nothing calls them but their own two tests and their helper.Besides 98 lines read and compiled for nothing, those tests describe swapping a running program as handled, while
what installs a builder now,
place(install.rs), renames the new program over the old one, only waiting while it isheld (
while_held): someone readingswap.rsto see how an update replaces a running builder is told aboutprotection the code no longer has.
The four go, with their two tests and their helper.
is_held,while_heldandset_subsystem, still used, stay, and the module'scomment says what it is for now.
Testing
Tested: on this PC (Linux): the release crate, longshot-builder and longshot-packager build with clippy -D
warnings (nothing else used the four); the release crate's tests; rustfmt. As
pr createasks for a builder change: Debian 13, GeForce GTX 1660 SUPER, NVIDIA 550.163.01: the game built by a builder from main @1938a302with #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 this change merged (together with #3009, #3010, #3012, #3013, #3014, from the same audit): 775 passed, 145 failed, 10 skipped both ways, so none fails only with it. The 145 are named at the end.Still to test:
None: code nothing called.
Measurements
Nothing to measure: code nothing ran; builds, updates and the game do what they did.
Risks
None: nothing called these, and a build that still did would no longer compile.
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
Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.The 145 checks of
mise run testthat fail on main @1938a302on this PC too, with or without this change97 need a tool this PC doesn't have on PATH (
--strictfails them):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
Tested in game: Debian 13, GeForce GTX 1660 SUPER, NVIDIA 550.163.01: the game built by a builder from main @
1938a302with 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.WIP: refactor(builder): the swap of a running builder goes with self-updateto refactor(builder): the swap of a running builder goes with self-update575ca4a64717d8889792@review
Recommendation: Approve. The removed functions have no remaining callers, and the retained installation helpers are unchanged. CI is still running. Nothing blocking is left. Recommend approval; not approved on the forge.
Removes unused self-update swap and recovery code and its tests, reducing misleading code without changing the current install path. The crate-level documentation still describes the removed behavior.
Nits (1): optional.
builder/crates/release/src/swap.rs:2: The crate-level overview still says this module replaces a running program for self-update, contradicting the updated module documentation. (more on the line) Do: Update the crate overview in lib.rs to describe the retained held-file retry and PE subsystem helpers, and remove its obsolete self-update reference.@fixcan do L1.Checks: Still running: 10 checks.
More: does it help, other systems, switches, what was read
Does it help: Not a perf change. The author reports that the release crate tests and relevant Rust builds passed on Linux; removing unreachable code does not require a performance measurement.
Other systems: The Windows and Linux install paths still use while_held, and the builder and packager still use the unchanged PE subsystem helpers. No runtime behavior is changed by the diff.
Switches: None.
Reviewed:
17d8889792againsta90fdf6776: Read AGENTS.md, CONTRIBUTING.md, docs/dev/standards.md, the pull request template, the commit, the complete changed file at HEAD and base, and the release crate root. Inspected install.rs and references to the changed module and removed functions; other callers were searched and skimmed. docs/review-checklist.md and the adjacent Tooling checkout were absent. No generated files or recorded runs changed.; nothing run (a code review).Checked and fine:
Testing: No commands from the project were run for this review. The author reports Linux Rust builds and release crate tests; the supplied CI checks are still running.
Overlaps and merge order: Not checked; network access is unavailable.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@ -8,2 +1,2 @@//! ([`tidy`]), when nothing runs from it any more (a delete that fails, an old copy still running, is tried again at//! the start after); a start that finds no program but its `.old` (power lost between the two renames) puts it back.//! A file Windows holds a moment tried again (an antivirus scanning a program just written: the Longshot Launcher's//! Core/SelfUpdate.cs WhileHeld, ported), and a Windows program made a windowed one. The swap of a running builderL1 (nit): The crate-level overview still says this module replaces a running program for self-update, contradicting the updated module documentation.
When: A reader starting at builder/crates/release/src/lib.rs is still directed to swap as the implementation of running-program replacement, although this change removes that implementation.
Do: Update the crate overview in lib.rs to describe the retained held-file retry and PE subsystem helpers, and remove its obsolete self-update reference.
@fix
@fix
17d8889792de64a94149Recommendation: Approve. The reported cleanup and overview correction are consistent, but the supplied base-to-head diff includes 949 files beyond the described change. CI also has not run on this head. Nothing blocking is left. Recommend approval; not approved on the forge.
What
@fixchangedI changed this pull request: the new head is
de64a94149. I rebased it ontomain(123b44ccb2). I edited its description to match the change.Changed
Nothing was built or run: the checks run again on the new head.
The described change removes unused self-update swap code and corrects the release crate overview. It reduces misleading code and documentation without an intended player-facing change.
Questions (1) (not confirmed from the code; they don't hold the recommendation)
a90fdf6776the intended comparison base for this pull request?Checks: they run again on this head; a failure shows on the pull request.
Also noticed (1; not asked for, not blocking)
More: does it help, other systems, switches, what was read
Does it help: Not a perf change. The author reports successful Linux builds and release-crate tests, plus identical 775 passed, 145 failed and 10 skipped suite results on the compared trees.
Other systems: The retained held-file retry and PE subsystem helpers are used by release installation and builder packaging on Windows and Linux. The described removal does not alter those helpers.
Switches: None in the described change.
Reviewed:
de64a94149against123b44ccb2: Read AGENTS.md, CONTRIBUTING.md, the pull request template, release/src/lib.rs and swap.rs in full; read the cleanup and fix commits' diffs and searched their callers. Skimmed the standards and the supplied base-to-head diff; the latter includes 949 files and was not reviewed in full. Tooling's AGENTS.md and docs/review-checklist.md were absent.; nothing run (a code review).Checked and fine:
Testing: No commands from the project were run. CI has not run on this head.
Overlaps and merge order: Not determined from the available information.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.