feat(builder)!: the builder's protocol 2 command line, one launch path, launcher-owned Steam tiles #353

Merged
HumanBean merged 2 commits from HumanBean/LongshotLauncher:feat/builder-cli-v2 into main 2026-11-28 21:51:34 +00:00
Owner

The builder's new command line (protocol 2, Longshot #2762) takes its places from the environment and its settings from the profile, and drops the flags the launcher passed. This moves the launcher to it: one function makes every builder command, Play is one path everywhere, and Steam tiles start the launcher.

Depends on Longshot #2762 (the builder side), and is stacked on launcher #352 (src/game/builder_cli.rs comes from there). Merge #352 first; until then this diff shows #352's commits too. Only the top commit is this PR's.

What changed

  • One place for builder commands. builder_cli::invoke(ctx, exe, Invoke::…) makes every builder process: check, build, play, info, fetch, from-source, verify, extract-romfs, perf-report, mod. Each gets --output json, --profile <dir> where it takes one, and its places in the environment (LONGSHOT_CACHE, LONGSHOT_STORE, LONGSHOT_SHADER_STORE, LONGSHOT_BUILDER_EXE). Context::configure and every hand-built builder command line in info.rs, reuse.rs, romfs.rs, sharing.rs, steam.rs, versions.rs, wizard.rs, releases.rs and process.rs are gone.
  • Protocol check. info's protocol is read once per builder (remembered by its path, size and time). Anything but 2 is refused before any other command (OldBuilder).
  • One launch path. Home, Versions, the wizard's play-after-build and shortcuts all run play --profile <dir> through invoke (Invoke::Play { own_windows }). From the window: --output json, and the Launch page shows the builder's progress events. From a shortcut (--play, Steam tiles, desktop shortcuts): --output user, so the launcher stays out of sight. The builder's own progress window shows a rebuild or a shader preparation alone (both go through play's ensure_built → shown_build; the game's start-up screen is used only with json), and its message box shows a failure. LaunchMode now differs only in Steam routing and whether the window's job owns the process.
  • Settings → "Add Longshot Launcher to Steam". Adds or removes one tile that opens the launcher normally (no --play), with the launcher's Steam artwork, through add_tile/remove_tile. Its checkbox is read from whether that tile is in the library. It says "Restart Steam" when Steam is running, as the shortcut writes do.
  • First screen. check --game → build --profile with its settings (--prepare-shaders on|off, no separate shader call) → play when asked.
  • Steam. The launcher writes shortcuts.vdf itself (the builder's steam crate's VDF reader and writer, ported into src/game/steam/vdf.rs, plus add and remove in library.rs). Every tile starts the launcher (--play <version> --profile <folder> --launcher-home <folder>). Migration and every shortcut write move a tile that starts a builder to the launcher, keeping its Steam id. The steam-shortcut builder call is gone.
  • Docs. New docs/builder.md (the command line, old builders, play, Steam tiles). docs/paths.md and README.md updated to match.

Behaviour changes

  1. Builders get no --cache, --store, --work, --root, --profile-id, --no-self-update, --builder-exe or --no-prepare-shaders. LONGSHOT_DATA is no longer set. LONGSHOT_BUILDER_EXE is set to the launcher.
  2. A version whose builder reports no protocol, or one other than 2, can't be played, rebuilt or used by the Mods tab. The error says to choose Update on the Versions page, and the row shows Needs an update (new string, translated in all 9 catalogs) once that builder has been asked. A protocol above 2 says to update the launcher.
  3. Shortcuts on every platform now use --output user (it was Windows only; Linux used json and showed nothing). The builder's progress window shows rebuilds and shader preparation, and its message boxes show failures. Exit codes 120, 121 and 123 get no second launcher dialog (ShortcutReported); for any other failure the launcher's dialog shows the builder's error text.
  4. New Settings checkbox, "Add Longshot Launcher to Steam" (translated in all 9 catalogs, listed in scripts/translations.py). If the launcher has moved, its tile is written again with a new id.
  5. A play from the window goes through Steam (on Linux, for a version with a tile) only when nothing needs building. Otherwise it stays in the window so its progress shows.
  6. Play takes its upscalers from the profile. The launcher writes the version's modules into the profile's upscalers before each play (and the licence receipts, as before). Switching versions with different modules therefore rewrites profile.json's upscalers.
  7. launcher-instance.json is no longer written. Existing ones are left in place and nothing reads them. The wizard no longer writes upscalers into the profile after a build: build --profile does.
  8. Steam tiles always start the launcher. New tiles get the launcher's Exe, StartDir and options. Existing builder tiles are retargeted, keeping their Steam id, art and play time. The builder's _icon.ico grid icon is no longer written (the four PNGs still are). The library is backed up once as shortcuts.vdf.bak-longshot. "Restart Steam" is said when a running Steam process is found.
  9. RomFS export picks a builder by protocol 2, not by its --help text.
  10. fetch runs from the first installed builder that speaks protocol 2. Older installed versions can still be its delta bases (--from).

Not run

Per the brief, nothing was run except cargo check --locked --tests, cargo clippy --locked --all-targets -- -D warnings and cargo fmt --check, all passing on Linux:

  • No unit tests: new or updated ones in builder_cli.rs, steam/vdf.rs, steam/library.rs, wizard.rs and process.rs were written but not run. tests/test_launcher_core.py, the translations check and Tooling's release tests were not run either.
  • No game, build or play run, and no Steam run (the builder's --output user windows from a Steam tile and the Settings Steam tile are unverified). No Windows compile: the #[cfg(windows)] paths in versions.rs, process.rs and steam.rs are only reviewed.
  • Not run against a real #2762 builder: the event shapes (play_plan, game_starting, info.build.up_to_date, protocol) are taken from its docs and source.

Checklist

  • Tested in the launcher with a #2762 builder (Home Play, Versions Play, a Steam tile, a desktop shortcut with a stale game folder, an old-protocol version) — not done
  • Unit tests and tests/test_launcher_core.py pass — not run
  • Clippy, fmt, cargo check --tests (Linux)
  • Docs updated

🤖 Generated with Claude Code

The builder's new command line (protocol 2, Longshot [#2762](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2762)) takes its places from the environment and its settings from the profile, and drops the flags the launcher passed. This moves the launcher to it: one function makes every builder command, Play is one path everywhere, and Steam tiles start the launcher. **Depends on** Longshot [#2762](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2762) (the builder side), and is **stacked on** launcher [#352](https://git.magicbean.dev/MagicBeanDev/LongshotLauncher/pulls/352) (`src/game/builder_cli.rs` comes from there). Merge #352 first; until then this diff shows #352's commits too. Only the top commit is this PR's. ## What changed - **One place for builder commands.** `builder_cli::invoke(ctx, exe, Invoke::…)` makes every builder process: `check`, `build`, `play`, `info`, `fetch`, `from-source`, `verify`, `extract-romfs`, `perf-report`, `mod`. Each gets `--output json`, `--profile <dir>` where it takes one, and its places in the environment (`LONGSHOT_CACHE`, `LONGSHOT_STORE`, `LONGSHOT_SHADER_STORE`, `LONGSHOT_BUILDER_EXE`). `Context::configure` and every hand-built builder command line in `info.rs`, `reuse.rs`, `romfs.rs`, `sharing.rs`, `steam.rs`, `versions.rs`, `wizard.rs`, `releases.rs` and `process.rs` are gone. - **Protocol check.** `info`'s `protocol` is read once per builder (remembered by its path, size and time). Anything but 2 is refused before any other command (`OldBuilder`). - **One launch path.** Home, Versions, the wizard's play-after-build and shortcuts all run `play --profile <dir>` through `invoke` (`Invoke::Play { own_windows }`). From the window: `--output json`, and the Launch page shows the builder's progress events. From a shortcut (`--play`, Steam tiles, desktop shortcuts): `--output user`, so the launcher stays out of sight. The builder's own progress window shows a rebuild or a shader preparation alone (both go through play's `ensure_built` → `shown_build`; the game's start-up screen is used only with json), and its message box shows a failure. `LaunchMode` now differs only in Steam routing and whether the window's job owns the process. - **Settings → "Add Longshot Launcher to Steam".** Adds or removes one tile that opens the launcher normally (no `--play`), with the launcher's Steam artwork, through `add_tile`/`remove_tile`. Its checkbox is read from whether that tile is in the library. It says "Restart Steam" when Steam is running, as the shortcut writes do. - **First screen.** `check --game` → `build --profile` with its settings (`--prepare-shaders on|off`, no separate shader call) → `play` when asked. - **Steam.** The launcher writes `shortcuts.vdf` itself (the builder's `steam` crate's VDF reader and writer, ported into `src/game/steam/vdf.rs`, plus add and remove in `library.rs`). Every tile starts the launcher (`--play <version> --profile <folder> --launcher-home <folder>`). Migration and every shortcut write move a tile that starts a builder to the launcher, keeping its Steam id. The `steam-shortcut` builder call is gone. - **Docs.** New `docs/builder.md` (the command line, old builders, play, Steam tiles). `docs/paths.md` and `README.md` updated to match. ## Behaviour changes 1. Builders get no `--cache`, `--store`, `--work`, `--root`, `--profile-id`, `--no-self-update`, `--builder-exe` or `--no-prepare-shaders`. `LONGSHOT_DATA` is no longer set. `LONGSHOT_BUILDER_EXE` is set to the launcher. 2. A version whose builder reports no protocol, or one other than 2, can't be played, rebuilt or used by the Mods tab. The error says to choose **Update** on the Versions page, and the row shows **Needs an update** (new string, translated in all 9 catalogs) once that builder has been asked. A protocol above 2 says to update the launcher. 3. Shortcuts on every platform now use `--output user` (it was Windows only; Linux used json and showed nothing). The builder's progress window shows rebuilds and shader preparation, and its message boxes show failures. Exit codes 120, 121 and 123 get no second launcher dialog (`ShortcutReported`); for any other failure the launcher's dialog shows the builder's error text. 4. New Settings checkbox, "Add Longshot Launcher to Steam" (translated in all 9 catalogs, listed in `scripts/translations.py`). If the launcher has moved, its tile is written again with a new id. 5. A play from the window goes through Steam (on Linux, for a version with a tile) only when nothing needs building. Otherwise it stays in the window so its progress shows. 6. Play takes its upscalers from the profile. The launcher writes the version's modules into the profile's `upscalers` before each play (and the licence receipts, as before). Switching versions with different modules therefore rewrites `profile.json`'s `upscalers`. 7. `launcher-instance.json` is no longer written. Existing ones are left in place and nothing reads them. The wizard no longer writes `upscalers` into the profile after a build: `build --profile` does. 8. Steam tiles always start the launcher. New tiles get the launcher's Exe, StartDir and options. Existing builder tiles are retargeted, keeping their Steam id, art and play time. The builder's `_icon.ico` grid icon is no longer written (the four PNGs still are). The library is backed up once as `shortcuts.vdf.bak-longshot`. "Restart Steam" is said when a running Steam process is found. 9. RomFS export picks a builder by protocol 2, not by its `--help` text. 10. `fetch` runs from the first installed builder that speaks protocol 2. Older installed versions can still be its delta bases (`--from`). ## Not run Per the brief, nothing was run except `cargo check --locked --tests`, `cargo clippy --locked --all-targets -- -D warnings` and `cargo fmt --check`, all passing on Linux: - No unit tests: new or updated ones in `builder_cli.rs`, `steam/vdf.rs`, `steam/library.rs`, `wizard.rs` and `process.rs` were written but not run. `tests/test_launcher_core.py`, the translations check and Tooling's release tests were not run either. - No game, build or play run, and no Steam run (the builder's `--output user` windows from a Steam tile and the Settings Steam tile are unverified). No Windows compile: the `#[cfg(windows)]` paths in `versions.rs`, `process.rs` and `steam.rs` are only reviewed. - Not run against a real #2762 builder: the event shapes (`play_plan`, `game_starting`, `info.build.up_to_date`, `protocol`) are taken from its docs and source. ## Checklist - [ ] Tested in the launcher with a #2762 builder (Home Play, Versions Play, a Steam tile, a desktop shortcut with a stale game folder, an old-protocol version) — not done - [ ] Unit tests and `tests/test_launcher_core.py` pass — not run - [x] Clippy, fmt, `cargo check --tests` (Linux) - [x] Docs updated 🤖 Generated with [Claude Code](https://claude.com/claude-code)
versions.json is read once, written into each folder's record with the same ids,
and kept as versions.json.backup. The default choice lives in library.json,
which can be rebuilt. Copies of one release are separate versions, each with
its own id. Retired folders and rollback records are gone.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
No staging folder, swap or rollback. The builder's command line is built in one
place, game/builder_cli.rs. A cancelled or failed update leaves the game
it had for Play to rebuild. The update is refused while the version or its
profile is in use, and a Windows file lock gives a message and a retry.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
docs(paths): version.json, library.json and the update in place
Some checks failed
CI / What the change needs (pull_request) Successful in 6s
PR title / Conventional Commit title (pull_request) Successful in 8s
CI / Lint (actionlint, ShellCheck, gitleaks) (pull_request) Successful in 13s
CI / Rust formatting, lint and tests (pull_request) Has been cancelled
CI / Release packages and stable upgrades (pull_request) Has been cancelled
9a016b63fb
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
feat(builder)!: the builder's protocol 2 command line, one launch path and launcher-owned Steam tiles
Some checks failed
CI / What the change needs (pull_request) Successful in 10s
PR title / Conventional Commit title (pull_request) Successful in 11s
CI / Lint (actionlint, ShellCheck, gitleaks) (pull_request) Successful in 18s
CI / Rust formatting, lint and tests (pull_request) Has been cancelled
CI / Release packages and stable upgrades (pull_request) Has been cancelled
4af76e5d38
Every builder command is made by builder_cli::invoke: the places in the
environment (LONGSHOT_CACHE, LONGSHOT_STORE, LONGSHOT_SHADER_STORE,
LONGSHOT_BUILDER_EXE), --profile <dir> and --output json, and no
--cache/--store/--work/--root/--profile-id/--no-self-update/--builder-exe.
A builder whose info says another protocol is refused with a message to
update the version, and the Versions list shows it as Needs an update.

Play is play --profile everywhere; a shortcut whose game must be rebuilt
or have its shaders prepared opens the launcher's window to show it.
Steam tiles start the launcher and are written by the launcher itself;
tiles that start a builder are moved to the launcher.

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

Possibly related, for context:

  • PR MagicBeanDev/Longshot#2762 WIP: feat(builder)!: build and play share one path, the launcher owns updates, and the fast check stops rebuilding — Builder protocol 2 contract this launcher change depends on
  • issue #160 Idea: build the Steam tile's capsule art from the player's own game art (.longshot_icon.jpg) at install time — Steam tile artwork behavior relates to launcher-owned tile changes
Possibly related, for context: - PR MagicBeanDev/Longshot#2762 WIP: feat(builder)!: build and play share one path, the launcher owns updates, and the fast check stops rebuilding — Builder protocol 2 contract this launcher change depends on - issue #160 Idea: build the Steam tile's capsule art from the player's own game art (.longshot_icon.jpg) at install time — Steam tile artwork behavior relates to launcher-owned tile changes
feat(builder): shortcuts let the builder show its own windows; Settings adds the launcher to Steam
Some checks failed
CI / What the change needs (pull_request) Successful in 8s
CI / Lint (actionlint, ShellCheck, gitleaks) (pull_request) Successful in 13s
PR title / Conventional Commit title (pull_request) Successful in 7s
CI / Rust formatting, lint and tests (pull_request) Has been cancelled
CI / Release packages and stable upgrades (pull_request) Has been cancelled
dba7666667
A --play shortcut runs play --profile --output user and keeps the launcher
out of sight: the builder's progress window shows a rebuild or a shader
preparation and its message box a failure. The info pre-check, the Launch
page for stale tiles and the headless fallback are gone; plays from the
window keep --output json and the Launch page.

Settings' "Add Longshot Launcher to Steam" adds or removes one tile that
opens the launcher, with its artwork.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
HumanBean force-pushed feat/builder-cli-v2 from dba7666667
Some checks failed
CI / What the change needs (pull_request) Successful in 8s
CI / Lint (actionlint, ShellCheck, gitleaks) (pull_request) Successful in 13s
PR title / Conventional Commit title (pull_request) Successful in 7s
CI / Rust formatting, lint and tests (pull_request) Has been cancelled
CI / Release packages and stable upgrades (pull_request) Has been cancelled
to 77d39abf51
Some checks failed
CI / What the change needs (pull_request) Successful in 7s
CI / Lint (actionlint, ShellCheck, gitleaks) (pull_request) Successful in 13s
PR title / Conventional Commit title (pull_request) Successful in 6s
CI / Release packages and stable upgrades (pull_request) Failing after 1m9s
CI / Rust formatting, lint and tests (pull_request) Failing after 6m49s
2026-11-28 21:51:03 +00:00
Compare
HumanBean changed title from WIP: feat(builder)!: the builder's protocol 2 command line, one launch path, launcher-owned Steam tiles to feat(builder)!: the builder's protocol 2 command line, one launch path, launcher-owned Steam tiles 2026-11-28 21:51:30 +00:00
HumanBean deleted branch feat/builder-cli-v2 2026-11-28 21:51:35 +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/LongshotLauncher!353
No description provided.