WIP: feat(build)!: Longshot Launcher 2: versions built by longshot-builder, profiles and saves, a clean break from make_game.py releases #259
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!259
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/LongshotLauncher:feat/longshot-build"
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?
Longshot's builder is rewritten in Rust as one program,
longshot-builder(Longshot #2286). It is a clean break frommake_game.py: other options, JSON events instead of@@lines, a game that reads its files from the player's .nup in place, and a release that ships only one self-contained file per system. The launcher has to build the releases that ship it, and keep building every older release the way it does now.It must ship with a Longshot #2286 that has the flags (
--cache,--builder-exe,--ngx-sdk): the launcher passes its settings as those flags, which an earlierlongshot-builderdoes not know.What changed
Core/Builders.cs):IBuildercovers build, check, how its output reads, which upscalers it builds, and whether its game reads the .nup in place.MakeGameBuilderwraps the existingMakeGameCommand,MakeGameProtocolandMakeGameRun, unchanged.LongshotBuilder(Core/LongshotBuilder.cs) runslongshot-builder.MakeGameBuilderand what only it uses.Core/LongshotBuildRelease.cs). The release ships, per system:longshot-builder-<version>-<system>(.exeon windows-x64): builder, sources, prebuilt objects, compilers and libraries in one file;longshot-builder-<version>-<system>.json, the manifest.SHA256SUMSmakes the release this kind, whatever its version (ReleaseInfo.BuilderManifests). Any other release goes the old way, unchanged.Toolchains.InstallLongshotBuildAsync, fromToolsSource):fromversion's file this PC keeps, its bytes hashed tofrom_sha256. It is downloaded and applied byApp/ZstdPatcher.cs.toolchains/<tag>/(staged, then renamed) and made executable on Linux. Its record keeps its SHA-256 (the next delta's base) and the manifest'sstamps.App/ZstdPatcher.cs): applied with ZstdSharp, MIT, Zstandard's own code in C#, so it works on both systems with no native library.zstd -d --patch-fromdoes: the base is the frame's prefix (ZSTD_DCtx_refPrefix).LongshotBuildRelease.DeltaWindowLog(30, as #2286'sdev releasemakes them).LongshotBuildRelease.Keep, inPruneTools): every installed version's file, plus the 2 newest otherlongshot-builderfiles per channel. A version taken off the list still serves as the next update's base; older ones go. They have their own row on the Storage page.stamps(ShaderCaches.Stamp, from the version's record), as #257 did with--stampsfor the old builder. A new-kind stamp never equals an old one. The shader caches and the shader store are kept while a build runs, andLONGSHOT_SHADER_STOREis passed to the builder.Core/PerfReports.cs): a version of the new kind sends withlongshot-builder perf-report <folder> --send --json --cache <cache>, started detached as before. Older versions runperf_report.pyas before.EMSDK,RX_CPM,LONGSHOT_SYSROOTor--rootare given, andLONGSHOT_TOOLSis left out.build --game <.nup> --out <folder> --work <folder> --cache <cache> --builder-exe <launcher> --json [--jobs N] [--language ..] --upscaler dlss,fsr4|none [--accept-licenses ..] [--no-prepare-shaders]update <folder> --work <folder> --cache <cache> --builder-exe <launcher> --json ...check --game <.nup> --cache <cache> --json<build files folder>/longshot-builder, which joinsDisk.WorkParts, so Storage, Keep build files, the cold build and Remove everything cover it.Core/BuildEvents.cs): versioned JSON Lines (v1), read into the existingBuildProgressandBuildClock, so the bar, the stage rows, the time left and the details work as before.shaders_not_preparedskips the shaders' row and says why.errorkeeps its code. Another version's event, an unknown type or an unknown field is passed over.translation_damagedin the launcher's words.Problems.FromCode): the important codes get the launcher's own translatable texts and fixes; any other code shows the builder's own text.nup_moved/nup_missing/game_not_found: Pick the .nup again.not_a_nup,work_folder_busy,game_folder_busy,game_files_overlap,dump_damaged, the game folder's refusals,tools_incomplete: each has its own entry.unsupported_build, the incomplete-dump codes,disk_full,game_running: the existing problems,game_running,game_not_foundanddisk_fullin longshot-builder's own words.LongshotBuilder.ReadCheck).docs/dev/reference/build-events.md(tests/fixtures/longshot-builder/codes.md, a copy thattests/test_launcher_core.pycompares with a Longshot checkout's).NupInPlace.longshot_builder.json. When its .nup is gone, Play starts a rebuild of that version, and step 1 says why and asks for the .nup where it is now.nup_movedoffers to pick it again.--accept-licensesnames only the vendors whose licence the player accepted, onbuildandupdatealike (LongshotBuilder.Licences).nvidiafor DLSS's SDK;amdfor FSR 4's runtime andintelfor XeSS's library, both on Windows only.license_not_accepted, the problem page offers Read the licence: the prompt for the vendor the error names, and on yes the licence is kept and the build starts again.longshot-builder, which downloads their files itself.longshot-builderand itsperf-reportstart with everyLONGSHOT_*,RX_*andA64_*variable of the PC removed, by prefix (LongshotBuilder.Dropped,MakeGameCommand.DroppedPrefixes). The launcher's own are then set again:LONGSHOT_SHADER_STORE,LONGSHOT_MEM_LIMIT_GB, and Intel'sRX_VK_switches.make_game.py's environment is as it was.LongshotBuilder.Nameislongshot-builder, its release fileslongshot-builder-<v>-<system>and its manifest likewise. Deltas arelongshot-builder-<from>-to-<v>-<system>.zst-patch, named by the manifest. Detection is by a manifest's exact name only, never by a name holding "Builder": the old Windows app wasLongshotBuilder.exe.longshot,longshot.exe, any case) is seen running; the builder is not.What the review round changed
build,updateandcheckget--cacheand--builder-exein place ofLONGSHOT_CACHEandLONGSHOT_BUILDER_EXE. DLSS uses the builder's own pinned SDK: no--ngx-sdkis passed, so an SDK an older launcher fetched never reaches it.LONGSHOT_MEM_LIMIT_GB;LONGSHOT_SHADER_STOREis kept, so the game's pipelines come from the launcher's store.--work <build files>/longshot-builder/work/launcher-<row id>), so an update finds the row's lift and objects and stays warm. Each row that exists before this update has one cold update, as its work folder is new.tools_incompletesays to restore it from the antivirus's quarantine.build-events.md(the copy and its test above);drive_erroris the PC's, not the file's; exit 2 has its own line;busyis a build's lock.How it relates to #257
#257 is superseded by this pull request. #257 had the old builder install its own tools, via
builder.json,make_game.py --tools-only, a shared tools store and--stampsfor the shader caches.A release of the new kind carries its tools inside its one file, so there is no tools stage left to move. Older releases keep the launcher's existing flow, unchanged. The one piece of #257 still needed, shader caches keyed by the builder's stamps, is here, from the manifest. #257 is not closed: that is for its author to decide.
Testing
Tested, on Linux (CachyOS), with tests only, on the first version:
dotnet build LongshotLauncher.slnx: 0 warnings.tests/test_launcher_core.py's build and run): 2802 checks pass.tests/launcher_app): pass.LongshotBuildReleaseChecks.cs, with a stand-in patcher and fetcher: the manifest read, and refused for each reason; the delta chosen by the bases kept; installs by full file, by delta, and from a delta that made other bytes (falls back to the full file); a base whose file changed; a full file of other bytes (refused, nothing left); a manifest SHA256SUMS does not sign; executable on Linux; the stamps; the bases a prune keeps and deletes; a release with and without a signed manifest.tests/launcher_app:ZstdPatcherovertests/fixtures/longshot-builder/delta, a 2 KB delta made by the zstd CLI (zstd -19 --patch-from=base.bin --long=27), gives the target byte for byte; another base does not.LongshotBuildChecks.cs: events from recorded synthetic lines (one whole build and one stopped onnup_moved); the code mapping; the check's answers; the builder chosen by kind; the command lines and their environment; the .nup record.The review round adds
BuilderStorageChecks.cs(the work folder per row, the disk needs, Storage's rows, the bases, Remove everything,perf-report's cache), the manifest's channel, the codes againstbuild-events.md, the flags, Build memory, the shader store and the unplugged drive inLongshotBuildChecks.cs, and the running-game names in the saves checks. On the headqsytpsmy(after the review round), on Linux: the App builds with no warnings and the wholepython -I tests/test_launcher_core.pypasses, 2897 checks, the translation check included.Not tested against a real Longshot release: none ships a manifest yet; that waits on Longshot #2286. The launcher UI was not started with a longshot-builder release.
Still to do
qsytpsmy), by hand.make_game.pypath, unchanged.share.This is the gate before it leaves WIP.
Risks
--cacheand--builder-exe, which alongshot-builderfrom before them does not know. Release both together.Measurements
The launcher's start does not change. An update of the new kind downloads a delta, a few MB, instead of the builder and its tools (about 500 MB before; 110 to 160 MB for a full file of the new kind). Applying it reads the base into memory, about 150 MB, for a few seconds. The launcher's download grows by ZstdSharp, about 0.5 MB.
make_game.pybuilds take the same path as before.🤖 Generated with Claude Code
https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Possibly related, for context:
Pushed
rrxtwzkz(bc55011a) andtlmmtnwt(d066db91). #2286 now ships a release as one self-containedlongshot-buildfile per system, plus zstd deltas and a manifest, so the launcher follows:longshot-build-<v>-<system>.json, not a search inside the builder files.LongshotBuildRelease.DeltaWindowLog.stamps.Tests were added for each part. The description also says #257 is superseded.
Pushed a new commit: performance statistics for a version of the new kind. Longshot #2286 deleted
perf_report.py, soPerfReportsnow runs that version's ownlongshot-build perf-report <folder> --send --json, detached as before. Versions withperf_report.pyare unchanged.perf-report --json's one event is parsed intoPerfReports.State, andStateCommandasks for the state without sending.longshot_perf.ini.tests/fixtures/longshot-build/perf-report.jsonl) and check the commands. The core checks pass: 2787.b9c5d940eca78d73f1aePushed
tsqkuxnn(a78d73f1). It fixes two problems with howlongshot-buildis started:--accept-licenses, solongshot-buildrefused withlicense_not_acceptedwhenever a vendor's files had to be downloaded.nvidia,amdandintelfrom the licences the player accepted, onbuildandupdate. The existing prompts in the settings step still come first.license_not_acceptedstop offers Read the licence: the prompt for the vendor the error names, and on yes the build starts again.longshot-buildand itsperf-reportstart without any of the PC'sLONGSHOT_*,RX_*andA64_*variables, removed by prefix. The launcher's own (LONGSHOT_CACHE,LONGSHOT_BUILDER_EXE, an NGX SDK of its cache, Intel'sRX_VK_switches) are set again after.LONGSHOT_ROOT,RX_CPM,A64_*orLONGSHOT_STOREdoesn't reach the builder orperf-report, and thatmake_game.py's environment is unchanged.Also in this commit:
LongshotBuilder.Name(longshot-builder), withFormerNamemanifests still found. Detection is by a manifest's exact name only, never by a name holding "Builder".license_not_acceptedevent lines, the licences per platform, and the new and former manifest names. Core checks: 2801 pass; app-level checks pass.Pushed a new commit: the launcher now uses Longshot #2286's rename everywhere.
longshot-builder(.exeon Windows), one constant,LongshotBuilder.Name;longshot-builder-<v>-<platform>.json;longshot-builder-<from>-to-<v>-<platform>.zst-patch, whose names the launcher takes from the manifest;longshot_builder.json;<build files folder>/longshot-builder, passed asLONGSHOT_CACHE;longshot-build, so support for that name is removed. A test checks that a manifest under it is not taken.Pushed a new commit: the shader caches and the shader store are no longer deleted while a build runs.
What was wrong:
Saves.Runningalready lowercases the process names before mapping them, so Windows'Longshot.exeand Linux'slongshot(the game, and the builder's shader preparation driver) were both counted. The real gap waslongshot-builderitself, which no check counted.What changed:
ShaderCaches.Busycounts Longshot's game in any case, or the builder. It is used byClear,ClearStoreand the cold build, and so by Storage's Free up space.Saves.BuilderAmong:longshot-builder,longshot-builder.exeorlongshot-builder-<v>-<platform>, in any case. It is not added toSaves.Running, so saves imports never wait for a build.RemoveEverything.Runtakes abuildingcheck, which the two callers in the window pass, and refuses while a build runs, the shader store included.StoreFilesstill countsspirv.pack.*/spirv.idx.*, so the per-userspirv.pack.programs-<stamp>andspirv.idx.programs-<stamp>go with the store. A test now pins that.Tests: fake process lists are checked: Windows
Longshot.exe,longshot-builder.exe, andLongshotLauncher.exeandLongshotBuilder.exenot busy; Linuxlongshot,longshot-builder, a release file name and an AppImage. Remove everything is refused while a build runs and touches nothing. Core checks 2815 pass.Twelve catalogs (de, es, fr, it, ja, ko, nl, pl, pt-BR, ru, zh-Hans, zh-Hant) still held four texts the launcher no longer shows ("Details" and three about the old folder layout), which scripts/translations.py refuses. Only those entries are taken out; every other line is as it was. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1SkKpc592GgxftLP8occ1f86cd485f48fca885WIP: feat(build): build a release that ships longshot-build with it, the .nup kept in place; older releases as beforeto WIP: feat(build)!: Longshot Launcher 2: versions built by longshot-builder, profiles and saves, a clean break from make_game.py releasesView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.