feat(dev): dev.py update keeps a game folder on main's newest, picks merged PRs, merges open ones on top, gathers logs (--gui) #1932

Merged
HumanBean merged 5 commits from GummiNaomi/Longshot:feat/dev-update into main 2026-11-21 00:03:07 +00:00
Member

Summary

Testing what landed on main an hour ago means waiting for Nightly or rebuilding a game folder by hand. This adds
dev.py update: it keeps a game folder you play on the newest commit of main (or another branch), or on its own
commit plus only the merged pull requests you pick, with open pull requests merged on top if you want to try them
before they land. It also gathers the folder's logs into one zip for a bug report, and does all of it in a small window
with --gui.

python -I scripts/dev.py update --game <folder>    # once: names the folder (remembered) and builds it
python -I scripts/dev.py update                    # later: builds again only when main moved
python -I scripts/dev.py update --check            # the pull requests merged since the folder's build; builds nothing
python -I scripts/dev.py update --pick 1874,1880   # the folder's commit with only those merged pull requests
python -I scripts/dev.py update --with 1913,1925   # open pull requests merged on top (with --pick too)
python -I scripts/dev.py update --rollback         # the folder back as it was before its last update
python -I scripts/dev.py update --logs             # logs, crash records and settings in one zip, for a bug report
python -I scripts/dev.py update --gui              # all of it in a window

An update:

  1. fetches the branch into the repository and puts a worktree of its own (update/tree in the development folder,
    detached) on the newest commit, so your checkouts and branches are not touched;
  2. backs up the folder's build files (the game, the renderer, image.bin, longshot_env.txt,
    longshot_options.ini, the texts...) into update/backups/, the last three kept;
  3. builds that commit into the folder with that commit's own dev.py when it has this command (so its own
    tools.lock and builder), in the player's build environment (build.environment), through the job queue, sharing
    the development folder's stores: when the translation didn't change, only what changed compiles. A folder that keeps
    its game files (romfs/, .longshot_exefs/) is built again from them (make_game.py --update); a new one from the
    files dev.py finds (the romfs hard-linked, as make_game.py does);
  4. on failure puts the backup back; a stopped update (the window's Stop, a closed terminal) is put back by the next
    dev.py update command, once its process is gone. On success it writes the commit into the folder
    (.longshot_dev_update) and what came in into update/history.md.

Picking (--pick, or unticking merged pull requests in the window): the worktree goes on the folder's commit and
the picked pull requests' commits are cherry-picked onto it in their order. One that needs a pull request left out is
refused, naming it and the files it conflicts in. Every one picked is the newest commit itself. The picks are written
beside the commit (.longshot_dev_update_picks), and the next check marks them "in your build".

Open pull requests (--with, or ticking them in the window): each one's head (refs/pull/N/head, which Forgejo,
Gitea and GitHub keep) is fetched and merged onto the build in number order, after the main commit or the picks. One
that conflicts is refused before the folder is touched, named with its files. The open ones in a build are written
beside its commit (.longshot_dev_update_open) and marked by the next check ("updated since" when the pull request
moved); an update without --with leaves them out and says so. The list is read from the remote's forge without
signing in (Forgejo or Gitea's /api/v1, or GitHub's API, from the remote's URL). The forge list's mergeable field
is not shown: it was stale here for pull requests that merge cleanly, so the real merge decides.

Logs (--logs, the window's Gather logs): logs/ (the log, its older copies, the frame log; never profile-*
folders), bug-reports/ but bug-reports/local-only/ (minidumps: game and private data, never shared), the
settings files, the last build log and the history, and a summary of the PC and the build, zipped into update/logs/.
Logs can name the user's folder: the command says to read them before sharing.

The window (--gui): on the left, the pull requests merged since the folder's build (colour-coded by kind, ticked
to pick) and the open ones (ticked to merge on top; drafts and WIPs greyed), with a search box over both (a number
matches the pull requests whose number holds it, other text the titles and authors; Ctrl+F); on the right, the build
log in colour (errors, warnings, stages, done). Check, Update, Roll back, Stop, Gather logs. Each action runs
dev.py update ..., so the window and the command line behave the same.

It refuses while the game in that folder is running. Saves, mods, longshot_options.ini and longshot_env.txt are
kept by the builder, as in a launcher update.

Read first: scripts/devtools/update.py (cmd_update, run_build, merge_open, recover), then the new section
Keep a game on main in docs/dev/developing.md.

Testing

Tested: Windows 11 Pro 26200, RTX 4070 SUPER (NVIDIA 617.42), Ryzen 9 9950X3D, Python 3.13.

  • A fresh game folder, for real: dev.py update --game <new folder> on a PC with no development folder yet:
    tools.lock's Windows tools installed, main @ 87c0d7b4 built from the game files dev_build.json names (romfs
    hard-linked), the shaders prepared: 20.5 min in all (the build 14:45). The folder's commit, the history and a
    backup written. The game started from it, ran 75 s with no window and sat at the title with no CRASH or [error]
    line in its log.
  • An update with nothing changed: --force on that folder: 0.5 min, every object and the translation reused; the
    game, renderer and image.bin byte for byte the same.
  • Stop: the same update killed 12 s in (its whole process tree), with the folder's update under way. The next
    dev.py update command said "the update to 87c0d7b4 did not finish: the game folder is put back as it was"; the
    game, renderer and image.bin were byte for byte as before, no update left pending, no build process left.
  • Gather logs on that folder: one zip with the log, the crash records, the settings, the build log, the history and
    the summary (system, game commit, GPU and driver).
  • The window, with a folder marked as built from 89c3d21e: 36 merged pull requests listed, colour-coded; unticking
    two shows "34 of 36 merged"; 292 open pull requests listed from the forge without signing in; searching "18"
    narrows both sections (15 merged, 29 open shown); ticking an open one shows "1 open on top".
  • tests/test_dev_update.py (new, game-free: a temporary repository stands for upstream, with refs/pull/N/head refs
    for open pull requests, and a stand-in for the build writes the folder), 25 cases: the new commits listed; an update
    that builds, records the commit and the history and keeps three backups; an up-to-date folder not built (and built
    with --force); a failed, an interrupted and a stopped build put back; an update still running not put back;
    --rollback; the settings remembered; make_game.py's command for a folder with and without its game files; the
    build handed to a newer tree's own dev.py; a dirty worktree and a running game refused; --pick (only the picked
    ones built, a pick that needs one left out refused and named, every one picked = the newest); --with (open heads
    merged on top, with --pick too, one that conflicts refused and named, an unknown number refused, an update
    without it leaving them out); the search; the forge API from https, scp-style, ssh and GitHub remote URLs; the
    window's JSON list; --logs (the minidumps and profiles left out). All pass.
  • Checks: test_dev_update, test_doc_anchors, byte_compile_tracked pass. test_job_queue, test_dev_ab,
    test_dev_packs, test_dev_migrate and test_dev_build fail on this Windows PC with exactly the same failing cases
    on main @ 66dc0a51 (Linux paths and file behaviour); ruff isn't installed here, so CI's run is the lint.
  • Seen in passing, not changed here: build.environment() prints "no NVIDIA DLSS in this build" before it applies
    dev_build.json's env, so with LONGSHOT_NGX_SDK set there it warns although the build has DLSS (its log says
    "with NVIDIA DLSS").

Still to test:

  • Windows: --with for real (an open pull request merged on top and built), and --pick for real once main has moved
    (by hand, me)
  • Linux: an update, --with, and --gui (by hand: someone with Linux)

Measurements

Nothing to measure: a development tool that runs the existing builder; the game is unchanged. Its own times are in
Tested (a fresh folder 20.5 min, an update with nothing changed 0.5 min).

Risks

Developers only: nothing reaches players. It writes only into the folder you name (after backing it up) and into the
development folder's update/ (a worktree, a work folder and up to three backups of about 0.7 GB each). It reads the
forge's public API for the open pull requests and fetches their heads; nothing is sent. A revert is enough to remove
it; update/ can be deleted.

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 passes (any failure that also fails on main is named). (The dev tools' checks and the docs'
    ones; the five Windows failures are main's own, named in Testing.)
  • 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

  • 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.

🤖 Generated with Claude Code

## Summary Testing what landed on `main` an hour ago means waiting for Nightly or rebuilding a game folder by hand. This adds `dev.py update`: it keeps a game folder you play on the newest commit of `main` (or another branch), or on its own commit plus only the merged pull requests you pick, with open pull requests merged on top if you want to try them before they land. It also gathers the folder's logs into one zip for a bug report, and does all of it in a small window with `--gui`. ``` python -I scripts/dev.py update --game <folder> # once: names the folder (remembered) and builds it python -I scripts/dev.py update # later: builds again only when main moved python -I scripts/dev.py update --check # the pull requests merged since the folder's build; builds nothing python -I scripts/dev.py update --pick 1874,1880 # the folder's commit with only those merged pull requests python -I scripts/dev.py update --with 1913,1925 # open pull requests merged on top (with --pick too) python -I scripts/dev.py update --rollback # the folder back as it was before its last update python -I scripts/dev.py update --logs # logs, crash records and settings in one zip, for a bug report python -I scripts/dev.py update --gui # all of it in a window ``` An update: 1. fetches the branch into the repository and puts a worktree of its own (`update/tree` in the development folder, detached) on the newest commit, so your checkouts and branches are not touched; 2. backs up the folder's build files (the game, the renderer, `image.bin`, `longshot_env.txt`, `longshot_options.ini`, the texts...) into `update/backups/`, the last three kept; 3. builds that commit into the folder with **that commit's own `dev.py`** when it has this command (so its own `tools.lock` and builder), in the player's build environment (`build.environment`), through the job queue, sharing the development folder's stores: when the translation didn't change, only what changed compiles. A folder that keeps its game files (`romfs/`, `.longshot_exefs/`) is built again from them (`make_game.py --update`); a new one from the files `dev.py` finds (the romfs hard-linked, as `make_game.py` does); 4. on failure puts the backup back; a stopped update (the window's Stop, a closed terminal) is put back by the next `dev.py update` command, once its process is gone. On success it writes the commit into the folder (`.longshot_dev_update`) and what came in into `update/history.md`. **Picking** (`--pick`, or unticking merged pull requests in the window): the worktree goes on the folder's commit and the picked pull requests' commits are cherry-picked onto it in their order. One that needs a pull request left out is refused, naming it and the files it conflicts in. Every one picked is the newest commit itself. The picks are written beside the commit (`.longshot_dev_update_picks`), and the next check marks them "in your build". **Open pull requests** (`--with`, or ticking them in the window): each one's head (`refs/pull/N/head`, which Forgejo, Gitea and GitHub keep) is fetched and merged onto the build in number order, after the main commit or the picks. One that conflicts is refused before the folder is touched, named with its files. The open ones in a build are written beside its commit (`.longshot_dev_update_open`) and marked by the next check ("updated since" when the pull request moved); an update without `--with` leaves them out and says so. The list is read from the remote's forge without signing in (Forgejo or Gitea's `/api/v1`, or GitHub's API, from the remote's URL). The forge list's `mergeable` field is not shown: it was stale here for pull requests that merge cleanly, so the real merge decides. **Logs** (`--logs`, the window's Gather logs): `logs/` (the log, its older copies, the frame log; never `profile-*` folders), `bug-reports/` but `bug-reports/local-only/` (minidumps: game and private data, never shared), the settings files, the last build log and the history, and a summary of the PC and the build, zipped into `update/logs/`. Logs can name the user's folder: the command says to read them before sharing. **The window** (`--gui`): on the left, the pull requests merged since the folder's build (colour-coded by kind, ticked to pick) and the open ones (ticked to merge on top; drafts and WIPs greyed), with a search box over both (a number matches the pull requests whose number holds it, other text the titles and authors; Ctrl+F); on the right, the build log in colour (errors, warnings, stages, done). Check, Update, Roll back, Stop, Gather logs. Each action runs `dev.py update ...`, so the window and the command line behave the same. It refuses while the game in that folder is running. Saves, mods, `longshot_options.ini` and `longshot_env.txt` are kept by the builder, as in a launcher update. Read first: `scripts/devtools/update.py` (`cmd_update`, `run_build`, `merge_open`, `recover`), then the new section *Keep a game on main* in `docs/dev/developing.md`. ## Testing **Tested:** Windows 11 Pro 26200, RTX 4070 SUPER (NVIDIA 617.42), Ryzen 9 9950X3D, Python 3.13. - **A fresh game folder, for real:** `dev.py update --game <new folder>` on a PC with no development folder yet: `tools.lock`'s Windows tools installed, main @ 87c0d7b4 built from the game files `dev_build.json` names (romfs hard-linked), the shaders prepared: 20.5 min in all (the build 14:45). The folder's commit, the history and a backup written. The game started from it, ran 75 s with no window and sat at the title with no `CRASH` or `[error]` line in its log. - **An update with nothing changed:** `--force` on that folder: 0.5 min, every object and the translation reused; the game, renderer and `image.bin` byte for byte the same. - **Stop:** the same update killed 12 s in (its whole process tree), with the folder's update under way. The next `dev.py update` command said "the update to 87c0d7b4 did not finish: the game folder is put back as it was"; the game, renderer and `image.bin` were byte for byte as before, no update left pending, no build process left. - **Gather logs** on that folder: one zip with the log, the crash records, the settings, the build log, the history and the summary (system, game commit, GPU and driver). - **The window**, with a folder marked as built from 89c3d21e: 36 merged pull requests listed, colour-coded; unticking two shows "34 of 36 merged"; 292 open pull requests listed from the forge without signing in; searching "18" narrows both sections (15 merged, 29 open shown); ticking an open one shows "1 open on top". - `tests/test_dev_update.py` (new, game-free: a temporary repository stands for upstream, with `refs/pull/N/head` refs for open pull requests, and a stand-in for the build writes the folder), 25 cases: the new commits listed; an update that builds, records the commit and the history and keeps three backups; an up-to-date folder not built (and built with `--force`); a failed, an interrupted and a stopped build put back; an update still running not put back; `--rollback`; the settings remembered; make_game.py's command for a folder with and without its game files; the build handed to a newer tree's own `dev.py`; a dirty worktree and a running game refused; `--pick` (only the picked ones built, a pick that needs one left out refused and named, every one picked = the newest); `--with` (open heads merged on top, with `--pick` too, one that conflicts refused and named, an unknown number refused, an update without it leaving them out); the search; the forge API from https, scp-style, ssh and GitHub remote URLs; the window's JSON list; `--logs` (the minidumps and profiles left out). All pass. - Checks: `test_dev_update`, `test_doc_anchors`, `byte_compile_tracked` pass. `test_job_queue`, `test_dev_ab`, `test_dev_packs`, `test_dev_migrate` and `test_dev_build` fail on this Windows PC with exactly the same failing cases on `main` @ 66dc0a51 (Linux paths and file behaviour); ruff isn't installed here, so CI's run is the lint. - Seen in passing, not changed here: `build.environment()` prints "no NVIDIA DLSS in this build" before it applies `dev_build.json`'s `env`, so with `LONGSHOT_NGX_SDK` set there it warns although the build has DLSS (its log says "with NVIDIA DLSS"). **Still to test:** - Windows: `--with` for real (an open pull request merged on top and built), and `--pick` for real once main has moved (by hand, me) - Linux: an update, `--with`, and `--gui` (by hand: someone with Linux) ## Measurements Nothing to measure: a development tool that runs the existing builder; the game is unchanged. Its own times are in Tested (a fresh folder 20.5 min, an update with nothing changed 0.5 min). ## Risks Developers only: nothing reaches players. It writes only into the folder you name (after backing it up) and into the development folder's `update/` (a worktree, a work folder and up to three backups of about 0.7 GB each). It reads the forge's public API for the open pull requests and fetches their heads; nothing is sent. A revert is enough to remove it; `update/` can be deleted. ## 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` passes (any failure that also fails on `main` is named). (The dev tools' checks and the docs' ones; the five Windows failures are main's own, named in Testing.) - [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] 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. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(dev): dev.py update keeps a game folder you play on main's newest commit, with a window (--gui)
Some checks failed
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
Website / Website on Cloudflare (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 29s
PR description / Description follows the template (pull_request_target) Successful in 42s
CI / Workflow lint (actionlint) (pull_request) Successful in 44s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 37s
Third-party parts / As their notes say (pull_request) Successful in 54s
CI / Website build and checks (pull_request) Has been cancelled
10b32ae4fd
`dev.py update --game <folder>` fetches the branch (main by default), puts a worktree of its own in the development
folder on the newest commit, backs up the folder's build files and builds that commit into it with the commit's own
dev.py, through the job queue and the shared stores; a failed or stopped build puts the backup back. --check says what
is new, --rollback puts the last backup back, --gui does the same in a small tkinter window. The folder, remote and
branch are remembered in dev_build.json's "update".

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Member

Possibly related, for context:

  • PR #1802 refactor(dev): docs, tools and process revamp: one dev.py, dev.py ab, one dev folder, a short PR template, faster dev builds — Introduces the dev.py/devtools architecture this builds on
Possibly related, for context: - PR #1802 refactor(dev): docs, tools and process revamp: one dev.py, dev.py ab, one dev folder, a short PR template, faster dev builds — Introduces the dev.py/devtools architecture this builds on
BeanBot left a comment

Recommendation: Request changes. Rollback and recovery can leave a game folder with mismatched build files or restore the wrong folder, and the running-game and concurrent-update guards are incomplete. The feature also has not yet completed a real build on either supported OS.

This adds a command and window to follow a branch, build a game folder, and restore a backup. The intended convenience comes with data-integrity risks in rollback and recovery, and the claimed reuse of the target commit’s build environment does not hold for commits predating this command.

Does it help: Unproven. The reported Windows tests use a stand-in builder; Check and opening the window were exercised, but no real update, incremental rebuild, or Stop was completed. This is not a game performance change.
Other systems: Windows launcher-built folders can store the game and libraries in bin/, which the backup omits. Linux process detection can miss games started with relative paths. Both OSes share the recovery and concurrent-update risks. The real builder also writes files and metadata beyond the backup list; its installed-file manifest can then disagree with restored files. Linux and Windows real builds and GUI Stop remain untested.
Switches: Adds --game, --remote, --branch, --check, --rollback, --gui, --force and internal --build-here/--commit options. Remote defaults to origin, branch to main, and force is off; the chosen game and branch settings are remembered. It sets LONGSHOT_KEEP_BUILD_FILES=1 for builds; this is appropriate for incremental updates, but their behavior is not yet demonstrated with a real build.

Reviewed: 10b32ae4fd against 3df5c13ed2: Read AGENTS.md, CONTRIBUTING.md, the PR template, standards, the diff, scripts/devtools/update.py, scripts/dev.py, scripts/devtools/common.py and tests/test_dev_update.py. Read relevant builder, process and queue paths; skimmed the changed documentation and test references. docs/review-checklist.md and ../Tooling/AGENTS.md were not present. No recorded runs, translations or generated files were changed. No earlier comments or reviews were supplied; overlapping PRs could not be checked with the network closed.; nothing run (a code review).
Checked and fine:

  • The change is one topic, documents the command, uses standard-library Python, and records AI assistance in the commit.
  • No game files, generated output or third_party files appear in the diff.
  • The stand-in tests cover ordinary successful updates, unchanged commits, failure, recovery, rollback and settings.

Blocking (to change before merge)

  1. scripts/devtools/update.py:161: The backup and restore lists omit bin/ and other builder outputs and metadata. For a launcher-built Windows folder, an update can replace bin/longshot.exe and its libraries while rollback restores only root files; the installed-file manifest can also retain the newer build's hashes. Back up and restore the complete set of files the builder can modify, including their previous absence and associated metadata, and test a launcher-shaped folder and a partial finish.
  2. scripts/devtools/update.py:255: Rollback selects the newest backup globally but checks whether the currently selected game is running. After updating folder A and selecting folder B, rollback silently overwrites A, even if A is running. Select backups by the requested game and check the actual destination before restoring.
  3. scripts/devtools/update.py:128: argv[0] is resolved relative to the updater's working directory, not the game's. On Linux, starting the game as ./longshot from its folder can therefore evade the running check when the updater is launched elsewhere; launcher-built games in bin/ also fail the parent-directory comparison. Identify the actual executable path and account for bin/ before updating or restoring.
  4. scripts/devtools/update.py:243: recover() and creation of pending.json are not protected by a lock. Two invocations can both pass recovery, change the shared worktree and overwrite the pending record before either build starts; the queue only serializes the later build step. Hold a cross-process lock across recovery, worktree selection, backup, build and finalization.
  5. scripts/devtools/update.py:188: Recovery treats the top-level updater's exit as proof the build has stopped. On Linux, killing that process alone can leave its child queue runner and builder alive, so the next command may restore the backup while the builder is still writing it. Track and terminate or wait for the entire build process tree before restoring, including abnormal termination.
  6. scripts/devtools/update.py:231: When the target commit predates update.py, the fallback uses this checkout's build.environment() and tools.lock rather than the target tree's environment. This is the normal case for current main until this PR lands, and can build an older commit with incompatible tools. Obtain the environment from the target tree independently of whether it has the new update command, and test that fallback.

Suggestions (the author may take or leave)

  • Extend recovery tests to cover files absent before a build, builder metadata, concurrent invocations and a surviving child process.
  • Record a real first build and incremental update on Windows and Linux, and exercise GUI Stop and rollback on each.
  • Report the tool's actual output or timing as required by the tools measurement rule; the current statement that there is nothing to measure does not demonstrate the incremental-build claim.

Testing: Review only; no commands from the project or tests were run. The author reports 15 stand-in tests passing on Windows, plus Check and window opening; the real builds and Linux run remain outstanding. Full test and lint results and CI on the head are not established.
Overlaps and merge order: Not checked: network access is closed.


Automated code review by BeanBot (gpt-6.1-terra), on the pull request's opening. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** Rollback and recovery can leave a game folder with mismatched build files or restore the wrong folder, and the running-game and concurrent-update guards are incomplete. The feature also has not yet completed a real build on either supported OS. This adds a command and window to follow a branch, build a game folder, and restore a backup. The intended convenience comes with data-integrity risks in rollback and recovery, and the claimed reuse of the target commit’s build environment does not hold for commits predating this command. **Does it help:** Unproven. The reported Windows tests use a stand-in builder; Check and opening the window were exercised, but no real update, incremental rebuild, or Stop was completed. This is not a game performance change. **Other systems:** Windows launcher-built folders can store the game and libraries in bin/, which the backup omits. Linux process detection can miss games started with relative paths. Both OSes share the recovery and concurrent-update risks. The real builder also writes files and metadata beyond the backup list; its installed-file manifest can then disagree with restored files. Linux and Windows real builds and GUI Stop remain untested. **Switches:** Adds --game, --remote, --branch, --check, --rollback, --gui, --force and internal --build-here/--commit options. Remote defaults to origin, branch to main, and force is off; the chosen game and branch settings are remembered. It sets LONGSHOT_KEEP_BUILD_FILES=1 for builds; this is appropriate for incremental updates, but their behavior is not yet demonstrated with a real build. **Reviewed:** 10b32ae4fd9c against 3df5c13ed2ec: Read AGENTS.md, CONTRIBUTING.md, the PR template, standards, the diff, scripts/devtools/update.py, scripts/dev.py, scripts/devtools/common.py and tests/test_dev_update.py. Read relevant builder, process and queue paths; skimmed the changed documentation and test references. docs/review-checklist.md and ../Tooling/AGENTS.md were not present. No recorded runs, translations or generated files were changed. No earlier comments or reviews were supplied; overlapping PRs could not be checked with the network closed.; nothing run (a code review). **Checked and fine:** - The change is one topic, documents the command, uses standard-library Python, and records AI assistance in the commit. - No game files, generated output or third_party files appear in the diff. - The stand-in tests cover ordinary successful updates, unchanged commits, failure, recovery, rollback and settings. **Blocking** (to change before merge) 1. scripts/devtools/update.py:161: The backup and restore lists omit bin/ and other builder outputs and metadata. For a launcher-built Windows folder, an update can replace bin/longshot.exe and its libraries while rollback restores only root files; the installed-file manifest can also retain the newer build's hashes. Back up and restore the complete set of files the builder can modify, including their previous absence and associated metadata, and test a launcher-shaped folder and a partial finish. 2. scripts/devtools/update.py:255: Rollback selects the newest backup globally but checks whether the currently selected game is running. After updating folder A and selecting folder B, rollback silently overwrites A, even if A is running. Select backups by the requested game and check the actual destination before restoring. 3. scripts/devtools/update.py:128: argv[0] is resolved relative to the updater's working directory, not the game's. On Linux, starting the game as ./longshot from its folder can therefore evade the running check when the updater is launched elsewhere; launcher-built games in bin/ also fail the parent-directory comparison. Identify the actual executable path and account for bin/ before updating or restoring. 4. scripts/devtools/update.py:243: recover() and creation of pending.json are not protected by a lock. Two invocations can both pass recovery, change the shared worktree and overwrite the pending record before either build starts; the queue only serializes the later build step. Hold a cross-process lock across recovery, worktree selection, backup, build and finalization. 5. scripts/devtools/update.py:188: Recovery treats the top-level updater's exit as proof the build has stopped. On Linux, killing that process alone can leave its child queue runner and builder alive, so the next command may restore the backup while the builder is still writing it. Track and terminate or wait for the entire build process tree before restoring, including abnormal termination. 6. scripts/devtools/update.py:231: When the target commit predates update.py, the fallback uses this checkout's build.environment() and tools.lock rather than the target tree's environment. This is the normal case for current main until this PR lands, and can build an older commit with incompatible tools. Obtain the environment from the target tree independently of whether it has the new update command, and test that fallback. **Suggestions** (the author may take or leave) - Extend recovery tests to cover files absent before a build, builder metadata, concurrent invocations and a surviving child process. - Record a real first build and incremental update on Windows and Linux, and exercise GUI Stop and rollback on each. - Report the tool's actual output or timing as required by the tools measurement rule; the current statement that there is nothing to measure does not demonstrate the incremental-build claim. **Testing:** Review only; no commands from the project or tests were run. The author reports 15 stand-in tests passing on Windows, plus Check and window opening; the real builds and Linux run remain outstanding. Full test and lint results and CI on the head are not established. **Overlaps and merge order:** Not checked: network access is closed. --- <sub>Automated code review by BeanBot (gpt-6.1-terra), on the pull request's opening. Nothing was run; a maintainer decides.</sub>
@ -0,0 +125,4 @@
want = os.path.normcase(os.path.abspath(game))
for pid, exe in procs.exes().items():
if exe.lower() != GAME_EXE:
continue
Member

A Linux game launched as ./longshot is resolved against the updater's cwd here, and a launcher-built game's executable can be in bin/. Both can evade this check. Please resolve the actual executable path and recognize the folder's bin/ game.

A Linux game launched as ./longshot is resolved against the updater's cwd here, and a launcher-built game's executable can be in bin/. Both can evade this check. Please resolve the actual executable path and recognize the folder's bin/ game.
@ -0,0 +158,4 @@
return d
def put_back(d):
Member

The builder can replace bin/longshot.exe and libraries in launcher-built folders, as well as other outputs and its installed-file manifest. Restoring only this list can leave a mixed build or stale manifest. Please restore the complete builder-managed state, including files that were previously absent, and test a partial finish.

The builder can replace bin/longshot.exe and libraries in launcher-built folders, as well as other outputs and its installed-file manifest. Restoring only this list can leave a mixed build or stale manifest. Please restore the complete builder-managed state, including files that were previously absent, and test a partial finish.
@ -0,0 +185,4 @@
p = json.load(f)
except (OSError, ValueError):
return
start = procs.proc_start(p.get("pid", 0))
Member

The updater PID can exit while its Linux child queue runner and builder remain alive. A subsequent command can then restore the backup while that builder is still writing. Please ensure the entire build tree has stopped before recovery.

The updater PID can exit while its Linux child queue runner and builder remain alive. A subsequent command can then restore the backup while that builder is still writing. Please ensure the entire build tree has stopped before recovery.
@ -0,0 +228,4 @@
log = part("build-%s.log" % commit[:8])
if os.path.isfile(os.path.join(tree, "scripts", "devtools", "update.py")) and \
os.path.normcase(os.path.realpath(tree)) != os.path.normcase(os.path.realpath(ROOT)):
return subprocess.call([sys.executable, "-I", os.path.join(tree, "scripts", "dev.py"), "update", "--build-here",
Member

For a target commit without update.py, this fallback uses the current checkout's build environment and tools.lock. That includes current main before this PR lands and can select incompatible tools. Please construct the environment from the target tree in this case too.

For a target commit without update.py, this fallback uses the current checkout's build environment and tools.lock. That includes current main before this PR lands and can select incompatible tools. Please construct the environment from the target tree in this case too.
@ -0,0 +240,4 @@
if a.gui:
return gui()
if a.build_here: # (the newer tree's own build step: run_build)
return _build_here(a)
Member

Two update processes can both pass recover() before either writes pending.json, then race on the shared worktree and pending record. Please lock the complete update and recovery transaction across processes.

Two update processes can both pass recover() before either writes pending.json, then race on the shared worktree and pending record. Please lock the complete update and recovery transaction across processes.
@ -0,0 +252,4 @@
die("there is no backup to put back")
if running_in(game):
die("the game in %s is running: close it first" % game)
put_back(b[0])
Member

Backups are global, but the running check uses the selected game. If A was updated and the user selects B, this restores A without checking whether A is running. Please select a backup for the requested folder and check its actual destination.

Backups are global, but the running check uses the selected game. If A was updated and the user selects B, this restores A without checking whether A is running. Please select a backup for the requested folder and check its actual destination.
--pick builds the folder's commit with only the named pull requests merged since (cherry-picked in their order; one that
needs a pull request left out is refused and named; every one picked is the newest commit itself). --logs zips the
folder's logs, crash records and settings, never bug-reports/local-only or profiles. The window lists the pull requests
merged since the folder's build, colour-coded by kind and ticked to pick, beside the build log in colour, with a Gather
logs button.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
docs(dev): dev.py update's --pick and --logs in Keep a game on main
Some checks failed
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
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 10s
PR description / Description follows the template (pull_request_target) Successful in 14s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 16s
CI / Workflow lint (actionlint) (pull_request) Successful in 16s
Third-party parts / As their notes say (pull_request) Successful in 18s
CI / Website build and checks (pull_request) Has been cancelled
d14f4fe388
Assisted-by: Claude Code

Co-Authored-By: Claude Opus 5.5 <[email protected]>
GummiNaomi changed title from WIP: feat(dev): dev.py update keeps a game folder you play on main's newest commit, with a window (--gui) to WIP: feat(dev): dev.py update keeps a game folder you play on main's newest commit, picks its merged PRs, gathers logs (--gui) 2026-11-20 22:52:32 +00:00
GummiNaomi force-pushed feat/dev-update from d14f4fe388
Some checks failed
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
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 10s
PR description / Description follows the template (pull_request_target) Successful in 14s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 16s
CI / Workflow lint (actionlint) (pull_request) Successful in 16s
Third-party parts / As their notes say (pull_request) Successful in 18s
CI / Website build and checks (pull_request) Has been cancelled
to ee08cc5635
Some checks failed
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
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 8s
PR description / Description follows the template (pull_request_target) Successful in 10s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 12s
CI / Workflow lint (actionlint) (pull_request) Successful in 12s
Third-party parts / As their notes say (pull_request) Successful in 14s
CI / Website build and checks (pull_request) Has been cancelled
2026-11-20 23:23:17 +00:00
Compare
--with 1913,1925 fetches each open pull request's head (refs/pull/N/head) and merges it onto the build, after the main
commit or the picks; one that conflicts stops it, named with its files, before the folder is touched. The open ones in a
build are written beside its commit, the next check marks them, and an update without --with leaves them out (said).
The open pull requests are read from the remote's forge without signing in (Forgejo or Gitea's /api/v1, or GitHub's).
The window gets a second section, open pull requests (ticked to merge on top, drafts and WIPs greyed), and a search box
over both sections: a number matches the pull requests whose number holds it, other text the titles and authors.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
docs(dev): dev.py update's --with and the window's search in Keep a game on main
Some checks failed
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
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 12s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 17s
CI / Workflow lint (actionlint) (pull_request) Successful in 18s
Third-party parts / As their notes say (pull_request) Successful in 18s
PR description / Description follows the template (pull_request_target) Failing after 9s
CI / Website build and checks (pull_request) Failing after 19s
da884c1a3d
Assisted-by: Claude Code

Co-Authored-By: Claude Opus 5.5 <[email protected]>
GummiNaomi changed title from WIP: feat(dev): dev.py update keeps a game folder you play on main's newest commit, picks its merged PRs, gathers logs (--gui) to WIP: feat(dev): dev.py update keeps a game folder on main's newest, picks merged PRs, merges open ones on top, gathers logs (--gui) 2026-11-20 23:58:36 +00:00
HumanBean changed title from WIP: feat(dev): dev.py update keeps a game folder on main's newest, picks merged PRs, merges open ones on top, gathers logs (--gui) to feat(dev): dev.py update keeps a game folder on main's newest, picks merged PRs, merges open ones on top, gathers logs (--gui) 2026-11-21 00:02:56 +00:00
HumanBean deleted branch feat/dev-update 2026-11-21 00:03:10 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 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!1932
No description provided.