chore: remove the builders' leftovers of the old self-update #161

Merged
HumanBean merged 1 commit from HumanBean/Longshot:chore/builder-update-cleanup into main 2026-11-13 08:09:11 +00:00
Owner

Why

Since #13 the Longshot Launcher installs and updates each version's builder, but the builders still carry Hookshot's self-update: about 800 lines of release lookup, update tracks, parts download and install code that nothing reaches, plus tests and docs that describe it as if it ran. This removes what is dead so the builders say what they really do.

What changed

Removed, with the callers checked (grep over builder/, nx2/, scripts/, tests/, docs/, .forgejo/, the WPF builder, and LongshotLauncher's Core/ and App/):

  • Linux, builder/linux/linux_update.py (581 to 103 lines). Kept what longshot_builder.py calls: data_root (the old NGX SDK folder), release_key, older_version, tools_tag, running_root, game_version, game_exe, and choose_mode, now without latest/switch. Removed:
    • the parts list reader and installer (Part, Manifest, parse_list, read_manifest, install, installed_apprun, fetch_manifest, startup_manifest, fetch_bytes and the download, unzip and symlink helpers, Cancelled): only reachable from begin_update when the running tools were not the target, which needs LONGSHOT_LATEST_TAG or --tag from the old self-restart; without LONGSHOT_LINUX_LIST it could only raise "The builder does not download versions".
    • the update tracks (TRACKS, track_of, update_target, newest_release): the Track menu is gone from the window already; the saved track setting could still flip switching() on.
    • The launcher does not call any of it: it unpacks the AppImage itself (Core/Toolchains.cs InstallAppImageAsync), installs tools.lock tools itself, and runs nx2/make_game.py directly (Core/MakeGameCommand.cs); it never starts the builder with --update, --tag or --fetched. builder/linux/linux_tools.py only names linux_update in a docstring.
  • Linux, builder/linux/longshot_builder.py: removed lookup_latest (LONGSHOT_LATEST_TAG), self.latest, the update track (TRACK_NAMES, track_id, switching, on_track_changed), the "Update builder" mode, the download thread and its Cancel (stop_update, the latest/note/do-build/update-error queue messages), and the --tag, --fetched, --allow-downgrade-from handoff of the old self-restart. begin_update now asks before building a newer game back (as before) and starts make_game.py --update at once. The buttons are unchanged for a player: with no newest version known (always, since the builder asks no server) the old code already reduced to Build / Update (an older game, built again with this version) / Play.
  • Linux, builder/linux/longshot-folder: removed the fallback to $XDG_DATA_HOME/longshot/builder/current and versions/<tag>/AppRun. Only linux_update.install wrote those, so no Longshot install has them; when the recorded builder= is gone, the game starts, as it already did.
  • builder/linux/AppRun and the module docstrings: --update <dir> builds that folder again with this version; --launch offers Update when the builder is newer than the game.
  • Python builder, builder/py/longshot_builder/updater.py (81 to 25 lines): removed latest_tag (LONGSHOT_LATEST_TAG), Install, run_latest_setup and the --tag/--fetched restart. update_folder(ui, folder) builds the folder again with these tools, as the WPF Updater.cs does. window.py: no "Update builder" mode, no release thread on the first page or the launcher page, no dead download/note/download_progress; longshot_builder_start.py takes no --tag/--fetched. restart stays (Repair).
  • WPF builder: Updater.cs keeps --update <folder> (MainWindow's launcher page and Update use UpdateFolder) and the launcher link, now LauncherDownload = https://longshot.magicbean.dev/download. MainWindow.xaml.cs: removed the dead download token source, DownloadToken, DownloadProgress and Note (no caller since the self-update went).
  • "Get the launcher" links now go to https://longshot.magicbean.dev/download: Updater.cs, builder/setup/setup.c (LAUNCHER_DOWNLOAD), builder/py/longshot_builder/__init__.py (LAUNCHER_DOWNLOAD, used by setup_parts.py).
  • Docs: deleted docs/linux-update-sysroot.md, docs/linux-builder-version-selection.md and its screenshot (nothing linked them; they describe the updater, tracks and installed-builder fallback). What still holds (the sysroot copies host aliases by value; the folder launcher starts the recorded builder, else the game; Update and the downgrade question) is now a paragraph in docs/development.md. Fixed self-update wording in docs/windows-portable-builder.md, code comments (Finder.cs, BuilderSettings.cs, MainWindow.xaml.cs, core.py, setup.c, make_game.py), README.md's AppImage --update line under Build from source, CONTRIBUTING.md's "no releases of its own yet / use the newest Hookshot release", and the issue forms' "Update track" field (now "Channel", the launcher's).
  • CHANGELOG.md deleted (Hookshot's, up to 2.2.0-rc.1; nothing writes it). Hookshot's history stays in NotRexed/Hookshot's CHANGELOG.md; Longshot's release notes are on each release page, written by git-cliff (cliff.toml, release.py notes). docs/versioning.md says so now. Veto here if it should stay.
  • scripts/linux/make_parts.py kept (the launcher's LONGSHOT_LAUNCHER_PARTS reads such a list for trying a version out), its docstring corrected: there is no release.py upload-parts, and a release ships the AppImage, not longshot-linux.txt. builder/linux/part_links.py stays with it.
  • Tests: deleted tests/test_linux_update_cancel.py (the cancel of a download and install that no longer exist) and tests/test_update_tracks.py (tracks, newest_release, fetch_manifest), replaced by tests/test_no_release_lookup.py (version order, the buttons, and no builder, setup or game naming a release lookup, LONGSHOT_LATEST_TAG, LONGSHOT_LINUX_LIST, --fetched or the removed functions). tests/test_linux_update.py keeps its checks of what stays (the buttons, running_root/tools_tag, the packaged folder, the folder launcher, make_parts packaging) and drops the 21 install, download, unzip and installed-builder checks. tests/test_linux_downgrade.py checks the slimmed handlers (decline, accept, DLSS, launcher, --update) instead of the handoff and the parts-list mismatch. test_builder_update_back.py and test_make_game_ngx.py lose their stubs of latest_tag/switching.

Unsure, kept:

  • The Python builder (builder/py, scripts/make_py_builder.py) is built by no workflow and released nowhere; its first start installs tools through setup_parts.py, which only works with LONGSHOT_SETUP_LIST. Its update hook is trimmed here; whether the whole builder goes is a separate call.
  • setup.c's LONGSHOT_SETUP_LIST install path (development lists) is untouched.

Left for LongshotLauncher (not this repo): its Core/PartsManifest.cs comments point at linux_update.py parse_list and _safe_name, which are gone. docs/releases.md (byte-identical in both repos, so not changed here) still says "Hookshot's CHANGELOG.md in Longshot is history".

Flags and settings

Flag What it does Default now Recommendation Helps on Doesn't help on Untested on
None added. Removed: LONGSHOT_LATEST_TAG (both builders) and LONGSHOT_LINUX_LIST (Linux builder), development hooks of the old self-update - - - - - -

Measurements

main: 1be180bb (2026-11-13)
this PR: chore/builder-update-cleanup @ bcca9b1d
Hardware: Ryzen desktop, CachyOS Linux (game-free checks only)
Scene: none, no game run
Method: LONGSHOT_VULKAN_HEADERS=/usr/include python -I -B tests/run_all.py, main and this PR interleaved, 2 runs each; line counts from jj diff --stat
How to reproduce: the same command in a checkout of each commit

main @ 1be180bb this PR @ bcca9b1d
run_all.py, run 1 500 passed, 2 failed, 36 skipped 499 passed, 2 failed, 36 skipped
run_all.py, run 2 500 passed, 2 failed, 36 skipped 499 passed, 2 failed, 36 skipped
lines, whole diff (37 files) +264 / -2813
lines, without CHANGELOG.md +264 / -2151
lines, builder/, nx2/, scripts/ +103 / -833
lines, tests/ +140 / -1239
main @ 1be180bb, runs 1 and 2:  500 passed, 2 failed, 36 skipped
this PR @ bcca9b1d, runs 1 and 2: 499 passed, 2 failed, 36 skipped
FAIL  tests/test_bake_portability.py      (both: no zstandard module on this PC)
FAIL  tests/test_builder_log_read_only.py (both: no Tk on this PC)
499 = 500 - test_linux_update_cancel.py - test_update_tracks.py + test_no_release_lookup.py

Testing

Tested: the whole game-free suite on Linux (above), main and this PR interleaved twice: the same two failures on both (test_bake_portability.py, no zstandard; test_builder_log_read_only.py, no Tk), nothing else; the changed checks alone (test_linux_update.py, test_linux_downgrade.py, test_no_release_lookup.py, test_builder_update_back.py, test_make_game_ngx.py, test_linux_builder_stop_reason.py). The WPF builder built with dotnet build builder/LongshotBuilder.sln -p:EnableWindowsTargeting=true (0 warnings, 0 errors); setup.c compiled with tools.lock's llvm-mingw (scripts/builder_package.py llvm-mingw --host linux, the CI command line, -Wall, no warnings), and the new link is in the exe's strings. pyflakes on the changed Python files: nothing new against main.

Not tested: the Linux builder window (this PC's Python has no Tk; the AppImage brings its own), the Python builder's window (no PySide6 here), the WPF builder on Windows, and a real game Update. No game run: nothing here touches the game, the renderer or make_game.py's build.

Needs other testers:

  • Linux, the AppImage from the launcher: start the builder, Build or Update a game folder older than the builder, and open the folder's longshot launcher page, expecting the same buttons as before, no "Update builder", and Update going straight to "Compiling what changed" (T-HHWZ)
  • Windows, the builder from the launcher: Repair on "The build tools need repairing" opens https://longshot.magicbean.dev/download, and a game folder's Update builds it again as before (T-7S7A)

Screenshots

Nothing on screen beyond wording: the Linux builder's status line for an older or newer game, and the launcher page's line, which no longer starts as "Checking for updates...".

Risk and rollback

A player-facing path that still used the removed code would break: the Linux builder's Update, its launcher page, or --update <folder>. The game-free checks run the real handlers for those; the launcher never called the removed paths. Reverting the commit restores everything; nothing is migrated or deleted on players' PCs.

Reviewer notes

Start with builder/linux/longshot_builder.py (apply_mode, apply_launch, begin_update) and builder/linux/linux_update.py. The Python builder and the CHANGELOG deletion are the two calls to make.

Issues

See #13

Checklist

For everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description).
  • Rebased on current main.
  • python -I -B tests/run_all.py run and passing (any failure that also fails on main is named above).
  • Tested in the game, or what wasn't is named under Testing.
  • Testing filled in: what was tested, what wasn't, and what needs other testers (with test requests).
  • Measured: main and this PR at named commits, on the same PC, scene and settings, at least 2 interleaved runs each, the median reported.
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

If applicable

  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • Docs updated.
## Why Since #13 the Longshot Launcher installs and updates each version's builder, but the builders still carry Hookshot's self-update: about 800 lines of release lookup, update tracks, parts download and install code that nothing reaches, plus tests and docs that describe it as if it ran. This removes what is dead so the builders say what they really do. ## What changed Removed, with the callers checked (grep over `builder/`, `nx2/`, `scripts/`, `tests/`, `docs/`, `.forgejo/`, the WPF builder, and LongshotLauncher's `Core/` and `App/`): - **Linux, `builder/linux/linux_update.py`** (581 to 103 lines). Kept what `longshot_builder.py` calls: `data_root` (the old NGX SDK folder), `release_key`, `older_version`, `tools_tag`, `running_root`, `game_version`, `game_exe`, and `choose_mode`, now without `latest`/`switch`. Removed: - the parts list reader and installer (`Part`, `Manifest`, `parse_list`, `read_manifest`, `install`, `installed_apprun`, `fetch_manifest`, `startup_manifest`, `fetch_bytes` and the download, unzip and symlink helpers, `Cancelled`): only reachable from `begin_update` when the running tools were not the target, which needs `LONGSHOT_LATEST_TAG` or `--tag` from the old self-restart; without `LONGSHOT_LINUX_LIST` it could only raise "The builder does not download versions". - the update tracks (`TRACKS`, `track_of`, `update_target`, `newest_release`): the Track menu is gone from the window already; the saved `track` setting could still flip `switching()` on. - The launcher does not call any of it: it unpacks the AppImage itself (`Core/Toolchains.cs` `InstallAppImageAsync`), installs `tools.lock` tools itself, and runs `nx2/make_game.py` directly (`Core/MakeGameCommand.cs`); it never starts the builder with `--update`, `--tag` or `--fetched`. `builder/linux/linux_tools.py` only names `linux_update` in a docstring. - **Linux, `builder/linux/longshot_builder.py`**: removed `lookup_latest` (`LONGSHOT_LATEST_TAG`), `self.latest`, the update track (`TRACK_NAMES`, `track_id`, `switching`, `on_track_changed`), the "Update builder" mode, the download thread and its Cancel (`stop_update`, the `latest`/`note`/`do-build`/`update-error` queue messages), and the `--tag`, `--fetched`, `--allow-downgrade-from` handoff of the old self-restart. `begin_update` now asks before building a newer game back (as before) and starts `make_game.py --update` at once. The buttons are unchanged for a player: with no newest version known (always, since the builder asks no server) the old code already reduced to Build / Update (an older game, built again with this version) / Play. - **Linux, `builder/linux/longshot-folder`**: removed the fallback to `$XDG_DATA_HOME/longshot/builder/current` and `versions/<tag>/AppRun`. Only `linux_update.install` wrote those, so no Longshot install has them; when the recorded `builder=` is gone, the game starts, as it already did. - **`builder/linux/AppRun`** and the module docstrings: `--update <dir>` builds that folder again with this version; `--launch` offers Update when the builder is newer than the game. - **Python builder, `builder/py/longshot_builder/updater.py`** (81 to 25 lines): removed `latest_tag` (`LONGSHOT_LATEST_TAG`), `Install`, `run_latest_setup` and the `--tag`/`--fetched` restart. `update_folder(ui, folder)` builds the folder again with these tools, as the WPF `Updater.cs` does. `window.py`: no "Update builder" mode, no release thread on the first page or the launcher page, no dead `download`/`note`/`download_progress`; `longshot_builder_start.py` takes no `--tag`/`--fetched`. `restart` stays (Repair). - **WPF builder**: `Updater.cs` keeps `--update <folder>` (MainWindow's launcher page and Update use `UpdateFolder`) and the launcher link, now `LauncherDownload` = https://longshot.magicbean.dev/download. `MainWindow.xaml.cs`: removed the dead `download` token source, `DownloadToken`, `DownloadProgress` and `Note` (no caller since the self-update went). - **"Get the launcher" links** now go to https://longshot.magicbean.dev/download: `Updater.cs`, `builder/setup/setup.c` (`LAUNCHER_DOWNLOAD`), `builder/py/longshot_builder/__init__.py` (`LAUNCHER_DOWNLOAD`, used by `setup_parts.py`). - **Docs**: deleted `docs/linux-update-sysroot.md`, `docs/linux-builder-version-selection.md` and its screenshot (nothing linked them; they describe the updater, tracks and installed-builder fallback). What still holds (the sysroot copies host aliases by value; the folder launcher starts the recorded builder, else the game; Update and the downgrade question) is now a paragraph in `docs/development.md`. Fixed self-update wording in `docs/windows-portable-builder.md`, code comments (`Finder.cs`, `BuilderSettings.cs`, `MainWindow.xaml.cs`, `core.py`, `setup.c`, `make_game.py`), `README.md`'s AppImage `--update` line under Build from source, `CONTRIBUTING.md`'s "no releases of its own yet / use the newest Hookshot release", and the issue forms' "Update track" field (now "Channel", the launcher's). - **`CHANGELOG.md` deleted** (Hookshot's, up to 2.2.0-rc.1; nothing writes it). Hookshot's history stays in NotRexed/Hookshot's `CHANGELOG.md`; Longshot's release notes are on each release page, written by git-cliff (`cliff.toml`, `release.py notes`). `docs/versioning.md` says so now. Veto here if it should stay. - **`scripts/linux/make_parts.py`** kept (the launcher's `LONGSHOT_LAUNCHER_PARTS` reads such a list for trying a version out), its docstring corrected: there is no `release.py upload-parts`, and a release ships the AppImage, not `longshot-linux.txt`. `builder/linux/part_links.py` stays with it. - **Tests**: deleted `tests/test_linux_update_cancel.py` (the cancel of a download and install that no longer exist) and `tests/test_update_tracks.py` (tracks, `newest_release`, `fetch_manifest`), replaced by `tests/test_no_release_lookup.py` (version order, the buttons, and no builder, setup or game naming a release lookup, `LONGSHOT_LATEST_TAG`, `LONGSHOT_LINUX_LIST`, `--fetched` or the removed functions). `tests/test_linux_update.py` keeps its checks of what stays (the buttons, `running_root`/`tools_tag`, the packaged folder, the folder launcher, `make_parts` packaging) and drops the 21 install, download, unzip and installed-builder checks. `tests/test_linux_downgrade.py` checks the slimmed handlers (decline, accept, DLSS, launcher, `--update`) instead of the handoff and the parts-list mismatch. `test_builder_update_back.py` and `test_make_game_ngx.py` lose their stubs of `latest_tag`/`switching`. Unsure, kept: - The Python builder (`builder/py`, `scripts/make_py_builder.py`) is built by no workflow and released nowhere; its first start installs tools through `setup_parts.py`, which only works with `LONGSHOT_SETUP_LIST`. Its update hook is trimmed here; whether the whole builder goes is a separate call. - `setup.c`'s `LONGSHOT_SETUP_LIST` install path (development lists) is untouched. Left for LongshotLauncher (not this repo): its `Core/PartsManifest.cs` comments point at `linux_update.py parse_list` and `_safe_name`, which are gone. `docs/releases.md` (byte-identical in both repos, so not changed here) still says "Hookshot's `CHANGELOG.md` in Longshot is history". ## Flags and settings | Flag | What it does | Default now | Recommendation | Helps on | Doesn't help on | Untested on | |---|---|---|---|---|---|---| | None added. Removed: `LONGSHOT_LATEST_TAG` (both builders) and `LONGSHOT_LINUX_LIST` (Linux builder), development hooks of the old self-update | - | - | - | - | - | - | ## Measurements main: 1be180bb (2026-11-13) this PR: chore/builder-update-cleanup @ bcca9b1d Hardware: Ryzen desktop, CachyOS Linux (game-free checks only) Scene: none, no game run Method: `LONGSHOT_VULKAN_HEADERS=/usr/include python -I -B tests/run_all.py`, main and this PR interleaved, 2 runs each; line counts from `jj diff --stat` How to reproduce: the same command in a checkout of each commit | | main @ 1be180bb | this PR @ bcca9b1d | |---|---|---| | run_all.py, run 1 | 500 passed, 2 failed, 36 skipped | 499 passed, 2 failed, 36 skipped | | run_all.py, run 2 | 500 passed, 2 failed, 36 skipped | 499 passed, 2 failed, 36 skipped | | lines, whole diff (37 files) | | +264 / -2813 | | lines, without CHANGELOG.md | | +264 / -2151 | | lines, `builder/`, `nx2/`, `scripts/` | | +103 / -833 | | lines, `tests/` | | +140 / -1239 | ``` main @ 1be180bb, runs 1 and 2: 500 passed, 2 failed, 36 skipped this PR @ bcca9b1d, runs 1 and 2: 499 passed, 2 failed, 36 skipped FAIL tests/test_bake_portability.py (both: no zstandard module on this PC) FAIL tests/test_builder_log_read_only.py (both: no Tk on this PC) 499 = 500 - test_linux_update_cancel.py - test_update_tracks.py + test_no_release_lookup.py ``` ## Testing **Tested:** the whole game-free suite on Linux (above), main and this PR interleaved twice: the same two failures on both (`test_bake_portability.py`, no `zstandard`; `test_builder_log_read_only.py`, no Tk), nothing else; the changed checks alone (`test_linux_update.py`, `test_linux_downgrade.py`, `test_no_release_lookup.py`, `test_builder_update_back.py`, `test_make_game_ngx.py`, `test_linux_builder_stop_reason.py`). The WPF builder built with `dotnet build builder/LongshotBuilder.sln -p:EnableWindowsTargeting=true` (0 warnings, 0 errors); `setup.c` compiled with tools.lock's llvm-mingw (`scripts/builder_package.py llvm-mingw --host linux`, the CI command line, `-Wall`, no warnings), and the new link is in the exe's strings. pyflakes on the changed Python files: nothing new against main. **Not tested:** the Linux builder window (this PC's Python has no Tk; the AppImage brings its own), the Python builder's window (no PySide6 here), the WPF builder on Windows, and a real game Update. No game run: nothing here touches the game, the renderer or `make_game.py`'s build. **Needs other testers:** - Linux, the AppImage from the launcher: start the builder, Build or Update a game folder older than the builder, and open the folder's `longshot` launcher page, expecting the same buttons as before, no "Update builder", and Update going straight to "Compiling what changed" (T-HHWZ) - Windows, the builder from the launcher: Repair on "The build tools need repairing" opens https://longshot.magicbean.dev/download, and a game folder's Update builds it again as before (T-7S7A) ## Screenshots Nothing on screen beyond wording: the Linux builder's status line for an older or newer game, and the launcher page's line, which no longer starts as "Checking for updates...". ## Risk and rollback A player-facing path that still used the removed code would break: the Linux builder's Update, its launcher page, or `--update <folder>`. The game-free checks run the real handlers for those; the launcher never called the removed paths. Reverting the commit restores everything; nothing is migrated or deleted on players' PCs. ## Reviewer notes Start with `builder/linux/longshot_builder.py` (`apply_mode`, `apply_launch`, `begin_update`) and `builder/linux/linux_update.py`. The Python builder and the CHANGELOG deletion are the two calls to make. ## Issues See #13 ## Checklist ### For everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`). - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` run and passing (any failure that also fails on `main` is named above). - [x] Tested in the game, or what wasn't is named under Testing. - [x] Testing filled in: what was tested, what wasn't, and what needs other testers (with test requests). - [x] Measured: main and this PR at named commits, on the same PC, scene and settings, at least 2 interleaved runs each, the median reported. - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### If applicable - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [x] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. - [x] Docs updated.
chore: remove the builders' leftovers of the old self-update
All checks were successful
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 6s
CI / Workflow lint (actionlint) (pull_request) Successful in 10s
Third-party parts / As their notes say (pull_request) Successful in 13s
PR description / Description follows the template (pull_request_target) Successful in 3s
bcca9b1d15
HumanBean changed title from WIP: chore: remove the builders' leftovers of the old self-update to chore: remove the builders' leftovers of the old self-update 2026-11-13 08:08:18 +00:00
HumanBean deleted branch chore/builder-update-cleanup 2026-11-13 08:09:12 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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!161
No description provided.