WIP: feat(tools): a builder that owns its build tools gets them itself; install from an offline builder #257
No reviewers
Labels
No labels
area/build
area/install
area/saves
area/tooling
area/ui
area/updates
ci: approved
good first issue
gpu/amd
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
platform/linux
platform/steam-deck
platform/windows
priority
critical
priority
high
priority
low
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/LongshotLauncher!257
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/LongshotLauncher:feat/builder-owns-tools"
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
The Launcher side of Longshot's #2295, where the builder
now owns its build tools. Up to now the Launcher installed every
tools.locktool itself and rebuilt the builder'senvironment by hand, so each tool change needed a matching Launcher change. Now:
Core/BuilderTools.cs): a builder withbuilder.json({"tools": "builder", "protocol": 1})beside its
tools.lockowns its tools.make_game.py --tools-onlywithLONGSHOT_TOOLS_STORE=<home>/tools, a store shared by every version. Its@@stage,@@progressand lines drive the wizard's bar.make_game.py --stampsintoolchain.json.(
Core/MakeGameCommand.cs).Core/ShaderCaches.cs). An oldversion and a new one never share a key, so the first update across the change prepares the programs once more.
tools_store.py gc --keep <each installed version's tools.lock>.LongshotBuilder-<v>-windows-x64-offline.ziporLongshot-<v>-offline-x86_64.AppImage, with therelease's
SHA256SUMSandSHA256SUMS.sigbeside it.Core/OfflineBuilder.cschecks the signature against the Launcher's release keys, then the file's SHA-256 against thesigned list, which also gives the version.
usr/lib/longshot/llvmis givenLONGSHOT_LLVM; one with emsdkstill gets
EMSDK.Replaces #256.
Read first:
Core/BuilderTools.cs,Core/Toolchains.cs(Prepare,CollectStoreAsync, the two path choices),Core/MakeGameCommand.cs,Core/OfflineBuilder.cs.Testing
Tested:
dotnet build LongshotLauncher.slnx(0 warnings) and the core checks compiled, on Linux (CachyOS). Not run:no checks run on this PC (the maintainer's rule), and the app hasn't been started. Longshot's side ran on this PC: the
tools stage installs into an empty store and finds them with no connection the second time, and the offline AppImage's
--tools-onlydownloads nothing.Still to test:
plays.
Risks
shared by every later version.
🤖 Generated with Claude Code
Longshot's builders now find or install their own build tools (make_game.py's tools stage, scripts/tools_store.py) and say so in builder.json. After unpacking a builder the launcher reads it (Core/BuilderTools.cs): with {"tools": "builder", "protocol": 1} it installs no tools.lock part, runs make_game.py --tools-only with LONGSHOT_TOOLS_STORE=<home>/tools before the version counts as installed (its lines on the wizard's bar), keeps make_game.py --stamps in toolchain.json for the shader caches' key, gives builds the store and no tool variable, and has the store collected by the newest such builder's tools_store.py gc after pruning. A builder without it, every release before, is installed exactly as before. A pull request over such a nightly may bring its own tools.lock; its tools stage and stamps run again. Offline builders now carry their tools at their dests and are installed as such a builder; the tools/<sha256>.zip handling is gone. The store counts with the builders in Storage. Co-Authored-By: Claude Opus 5.5 <[email protected]>@review
Recommendation: Request changes. A pull request’s builder can be recorded as installed before its tools are ready, and choosing an offline builder can still join an online download. The new installation paths also need end-to-end runs on both supported platforms.
The launcher delegates tool installation to compatible builders, shares their tools, and adds an offline-builder import. This removes launcher-specific tool installation work, but adds a preparation lifecycle and a second source for installs that need stronger coordination.
Blocking (1): must change before merging.
App/LauncherService.cs:204: Registering the selected offline builder does not replace a prefetch already running for that version. (more on the line) Do: Cancel and replace the matching online prefetch when an offline builder is selected, and wait for its staging cleanup before starting the offline install.Should fix (3): not blocking, but worth doing before merging.
Core/PullRequestSource.cs:50: The pull request is published as an installed toolchain before its tools stage finishes. (more on the line) Do: Keep the mirrored pull request in staging until preparation and record writing succeed, then publish it atomically.App/ViewModels/HomeViewModel.cs:762: Checking an offline builder leaves the other build commands enabled, and its completion unconditionally opens another wizard. (more on the line) Do: Include the import in the shared build-start busy state, or discard its completion if the player has navigated to another workflow.Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
@fixcan do L1, L2, L3 and L4.Questions (1) (not confirmed from the code; they don't hold the recommendation)
More: does it help, other systems, switches, what was read
Does it help: Unproven. The description reports a successful Linux builder tools stage and offline AppImage tools stage, but no launcher install or playable build was run on either platform.
Other systems: The change affects Windows and Linux installations, pull-request builds, shader-cache reuse, pruning, and offline builds. The new core checks use simulated builders; they do not demonstrate those paths with released builders or a playable game.
Switches: LONGSHOT_TOOLS_STORE is newly set to /tools for compatible builders and builds. Tool-specific environment variables are removed for those builders; Linux legacy builds now select LONGSHOT_LLVM when the llvm directory exists, otherwise EMSDK. The store default is consistent with the intended shared installation, but its behavior with real builders remains unverified.
Reviewed:
7ae3df4cd8against6887d57c4f: Read the repository rules and commit messages, the changed core installation paths, the new builder and offline checks, and the diff. Read relevant portions of the surrounding launcher, prefetch, command, release and cache code; the larger changed app and test files were skimmed rather than read in full. No review checklist or pull-request template was present at the named paths.; nothing run (a code review).Checked and fine:
Testing: No commands from the project or tests were run, as requested. The pull request reports a Linux solution build and direct Longshot tools-stage checks.
Overlaps and merge order: Longshot #2295 supplies the builder protocol and offline packages; its compatible release needs to be available before end-to-end validation.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@ -194,0 +201,4 @@public async Task<OfflineBuilder> ImportOfflineAsync(string file, CancellationToken cancel = default){var builder = await Task.Run(() => OfflineBuilder.OpenAsync(file, Platform, ReleaseKeys.Current(), cancel), cancel).ConfigureAwait(false);offline[builder.Tag] = builder;L2 (blocking): Registering the selected offline builder does not replace a prefetch already running for that version.
When: If the automatic online prefetch for the same tag is still running when the player selects the offline file, the wizard joins that existing fetch. It continues using the online source and can fail when the connection is unavailable, despite the verified offline builder being present.
Do: Cancel and replace the matching online prefetch when an offline builder is selected, and wait for its staging cleanup before starting the offline install.
@ -746,0 +759,4 @@if (await host.PickFileAsync(Tr.F("The offline builder, {0} (with SHA256SUMS and SHA256SUMS.sig beside it)",OfflineBuilder.FileName("<version>", Service.Platform)),windows ? new[] { "*.zip" } : new[] { "*.AppImage" }) is not { } picked) return;importingOffline = true;L3 (should fix): Checking an offline builder leaves the other build commands enabled, and its completion unconditionally opens another wizard.
When: While a large builder is being hashed, a player can start a different build; when hashing finishes, StartWizard navigates away from that wizard and replaces it.
Do: Include the import in the shared build-start busy state, or discard its completion if the player has navigated to another workflow.
@ -48,6 +48,21 @@ public static class PullRequestSourcevar archive = await ReleaseManifest.FetchUncheckedAsync(chains.Fetcher, ArchiveUrl(pr.Head), MaxArchive, cancel).ConfigureAwait(false);var files = Files(archive, pr.Head);var made = await Task.Run(() => chains.InstallPullRequest(tag, tools, files, releases.Platform, cancel), cancel).ConfigureAwait(false);L1 (should fix): The pull request is published as an installed toolchain before its tools stage finishes.
When: If the launcher or PC stops after InstallPullRequest moves the folder into place but before PrepareAsync finishes, the catch cannot remove it. On the next attempt Find accepts its toolchain.json and skips preparation, so a build can need downloads unexpectedly and the recorded shader stamps remain absent.
Do: Keep the mirrored pull request in staging until preparation and record writing succeed, then publish it atomically.
Thanks. Fixed in
573ba98a:Core/ToolsPrefetch.csStopAsync,App/LauncherService.csImportOfflineAsync: picking an offline builder cancels that version's running online fetch and waits for its staging cleanup. The next fetch installs from the file.Core/Toolchains.csInstallPullRequestAsync: a pull request's builder runs--tools-onlyand--stampsin its staging folder, beforetoolchain.jsonis written and the folder is moved into place. A failure or a stop leaves nothing installed.App/ViewModels/HomeViewModel.cs: the import is part ofCanStartBuild's busy state. If the player has left Home by the time it finishes, a notice says so and no wizard opens.Checks:
tests/launcher_core/BuilderToolsChecks.cs(L1, L2) andtests/launcher_app/Program.cs(L3), compiled, not run here. The "player moved on" branch has no deterministic check: the hash finishes before a check could navigate away.Superseded by #259, the launcher's side of Longshot #2286: longshot-builder installs its own tools, so the launcher no longer does. Closing in its favour.
Pull request closed