chore(builder): the Builder is command-line only; the launcher is the app #181
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/upscaling
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
testing wanted
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!181
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:chore/builder-cli"
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?
Why
Players should only need the Longshot Launcher. The Builder's own windows (the WPF app on Windows, the Tk window in the Linux AppImage) were a second app to keep working beside the launcher, while the launcher only takes each version's Builder for its Python, its tools and
make_game.py. This makes the Builder a command-line package: the launcher and RecompLauncher see the same entry points, arguments,@@lines and exit codes as before, and started by hand it says to get the launcher.What changed
What the launcher runs, checked in MagicBeanDev/LongshotLauncher's
Core/: neverLongshotBuilder.exeorAppRun. It runs the release's own Python onmake_game.pydirectly (Core/MakeGameCommand.cs;Core/Toolchains.cs:LongshotBuilder/tools/python/python.exeandLongshotBuilder/tools/nx2/make_game.pyon Windows,usr/python/bin/python3andusr/share/longshot/nx2/make_game.pyfrom the unpacked AppImage on Linux, which must holdAppRunandusr/share/longshot/tools.lock). None of those paths change, andnx2/make_game.pyis untouched. The Builder entry points are RecompLauncher's (recomplauncher.json):--cli --prepare --game {game}and--play {home}/Games/Longshot, onLongshotBuilder.exe(the setup) andLongshot.AppImage.Windows Builder (
builder/LongshotBuilder): no WPF any more.MainWindow.xaml(.cs),App.xaml(.cs),Strings.cs,Glass.cs,Finder.cs,Disk.cs,Storage.cs,ShaderStep.cs,BuilderSettings.cs,BuildWorkers.cs,Updater.cs, the Inter fonts and the image. AlsoPortableArchive.cs, which nothing called.Program.cs.--cliisApp.Climoved over: the same home check first, the sameTools.Find, the same lines to stdout and the sameerrorline and exit code. The one change inCli:failure == "cancelled"is gone, because nothing can cancel a--clirun. Anything else (a double-click) shows the launcher message and its link (https://longshot.magicbean.dev/download) in a message box, also on stderr, and exits 1.Runner.cs: what--cliused, with its environment unchanged. That meansPYTHONIOENCODING, the home,LONGSHOT_BUILDER_EXE,LONGSHOT_NGX_SDK/LONGSHOT_FFX_SDKremoved,EMSDK/RX_CPM/WGPU_NATIVE, andLONGSHOT_JOBS/LONGSHOT_MEM_LIMIT_GBas inherited.CheckandCancel(window only) are gone.BuilderHome.cslosesDefaultGame,SavePathandLoadPath(window only).LongshotBuilder.csproj: stillWinExe, so it opens no console window under the setup or RecompLauncher, and stillnet8.0-windowsself-contained, but withoutUseWPF. The published folder goes from 243 files (147 MB) to 186 (72 MB).Windows setup (
builder/setup/setup.c): kept. It is the zip'sLongshotBuilder.exe, which RecompLauncher runs with--cliand--play, andmake_game.pycopies it into every game folder aslongshot.exe, including the launcher's builds.--cli,--playand a game folder'slongshot.exeare unchanged.builder_readyno longer requires WPF's files.--repairis gone, in a later commit (below).Linux AppImage (
builder/linux):longshot_builder.py(the Tk window),linux_update.py(its version buttons),play-diagnostics.sh(its Play), andlinux_tools.py --gui's Tk download window.AppRun:--cli,--playand<folder>are unchanged.--clistill runslinux_tools.py env --installwith no other argument.--launch <folder>now plays that folder throughlongshot-launch, for a game folder'slongshot(longshot-folder) when--clibuilt it. Anything else prints the launcher message on stderr, plus a zenity/kdialog box when started outside a terminal with a display, and exits 1.longshot-launchandlongshot-foldername the launcher in their messages..desktopentry stays, because the AppImage format needs one.Packaging and CI:
scripts/check_windows_files.pyexpects no WPF and fails on one.scripts/builder_package.pyandbuild-windows.ymlcomments.ci.yml's worker check is nowtests/builder_cli(below).Tests:
test_builder_details_hitbox.pyandbuilder_details_hitbox_test.cstest_builder_dlss_update.py,test_builder_update_back.pytest_builder_scale.py,test_builder_free_space.py,test_builder_log_read_only.pytest_desktop_exec.pytest_linux_builder_clock.py,test_linux_builder_jobs.py,test_linux_builder_stop_reason.pytest_linux_play_diagnostics.py,test_linux_play_scope.pytest_portable_archive.pytest_builder_status.py,test_disk_warning.py,test_ffx_sdk.py,test_make_game_ngx.pytest_pipeline_share.py,test_prepare_at_build.pytest_linux_update.py,test_linux_downgrade.py(now the folder launcher's dispatch only)test_builder_own_python.py,test_builder_xml_valid.pytest_portable_builder_home.pywithportable_builder_home_test.cs,test_portable_builder_startup.pytest_no_release_lookup.pynow also checks that the windows are gone.tests/builder_workersbecametests/builder_cli. It runs the actualRunneragainst an authoredmake_game.pyand checks the arguments, the environment it passes on, the inherited workers and memory, the SDK folders dropped, the lines in order, and each way a run ends: done,@@error, silent failure, no Python, the package's Python removed.test_linux_tools.pygains--launchand the no-window message.Docs:
docs/windows-portable-builder.md: now for--portable --cli.docs/windows-builder-runtime.md,docs/development.md,docs/forgejo-runners.md, RELEASING.md (the Windows tester's steps).docs/releases.md, which is byte-identical with the launcher's: 3 lines. The launcher's copy needs the same edit.Follow-ups after review (new commits on top; the first two are unchanged):
d956c9ea), which brings in #176, #178 and #179.build(linux)):deps.shno longer builds Tk with Xft.appimage.shno longer copieslibtcl9tk9.0.so, libXft, libXrender or their licences._tkinter,tkinterand turtle are deleted. Its mark changes, so an existingbuild-linux/depsinstalls it again.libxft-devandlibfontconfig1-devleavebuild-linux.ymland the Dockerfile, whichtest_linux_docker_packages.pykeeps the same.test_appimage_licenses.pynow checks that none of this comes back.longshot.exestartsbin\longshot.exeitself.launch_installedis gone (it opened an installed Builder with--launch), and so are the setup's--launchand--repair, the old window's Repair..longshot_builder_home,builder_local=1): only that Builder launch read it. It is gone fromportable_home.h(hb_home_game,HB_GAME_HOME) and frommake_game.py(portable_game_home,write_game_home), withtest_portable_game_home.py.--launchis gone.longshot-launch: no folder now means~/Games/Longshotinstead of the old window'sbuilder.ini. It starts onlybin/longshot, never the folder'slongshot(the folder launcher, which would start it again).make_game.reported(), which only the Linux window read, goes with its test.docs/common-issues.md, the README and the website's antivirus guide:%LOCALAPPDATA%\LongshotLauncher(withtoolchains) and%LOCALAPPDATA%\Programs\LongshotLauncher, orLongshotLauncher-datafor the portable launcher (Core/LauncherHome.cs,LauncherLayout.cs).toolchainsfolder if a file is still missing.tests/builder_dlss_update_test.cs, the fixture of the deletedtest_builder_dlss_update.py. #179 fixed it on main.scripts/ngx_sdk.py's mention of the Builder's DLSS tick.#recomplauncher-longshot, already broken on main.init_home.BuilderHome.cs's "ZIP fallback" comment.Flags and settings
linux_tools.py env --gui(the AppImage's Tk download window), the setup's--repairand--launch, the Windows Builder's--launch. The Builders'--update <folder>without--clinow gives the launcher message;--cli --update <folder>does what it didMeasurements
main:
d956c9ea(2026-11-13; the first two commits were measured againstc67cd4a0, the main they were made on)this PR: chore/builder-cli @
35eabb8e(the suite ran at7cbb2168;35eabb8echanges only a README anchor, a comment and setup.c, which Linux does not compile in the suite)Hardware: Ryzen desktop, CachyOS Linux (game-free checks and cross-built Windows files only)
Scene: none, no game run
Method:
python -I -B tests/run_all.py --jobs 6undernice -n 19, once on each side.build-windows.ymlbuilds them (dotnet publish -r win-x64 -p:EnableWindowsTargeting=true, with SDK 10 here targeting net8.0), thenbuilder_package.py package/zipwith the same setup exe on both sides, thencheck_windows_files.py.scripts/linux/deps.shinto a scratch folder. Its Tk share was measured on the same python-build-standalone download,tar | zstd -19for the compressed size. main's own Tk build (from source, with Debian's libXft) could not be repeated here, so itslibtcl9tk9.0.so, libXft and libXrender are not counted.jj diff --stat.Nothing here is a performance change.
How to reproduce: the same commands in a checkout of each commit
d956c9ea35eabb8ed956c9ea)LongshotBuilder-<v>-windows-x64.zipc67cd4a0)9f0a3aa8; unchanged since in what the zip holds)usr/python: Tcl/Tk,_tkinter, tkinter, turtleTesting
Tested:
--cli, on Linux. Its framework-dependent Debug build ran underdotnet(roll-forward to .NET 10), withtools/the repository and the PC's Python, against the realmake_game.py:--cli --check --nup <missing>:@@error, then oneerrorline on stdout and stderr, exit 1.--cli --prepare --game <missing>: make_game's ownerrorline passed through once, exit 1.--cliwith no tools beside it: exit 1, with the righterrorline.--cliwith a bad home: exit 1, with the righterrorline.--update x: the launcher message, exit 1.tests/builder_cliasci.ymlruns it: 187 assertions pass.check_windows_files.py.setup.ccompiles with tools.lock's llvm-mingw, CI's flags and-Wall, with no warnings. Every Windows-only setup check compiles with llvm-mingw, though none can run here:test_setup_runtime.py,test_setup_runtime_paths.py,test_portable_setup_paths.py,test_portable_setup_transaction.py,test_portable_setup_start.pyandtests/portable_setup_home_test.c.deps.sh:import tkinterfails.make_game.py --helpandlinux_tools.py --helprun.AppRunin a stand-in image (test_linux_tools.py):--clistops without the tools, and runsmake_game.pyonce they are found.--playand--launchneed no build tool.longshot-launch(test_longshot_launch.py):bin/longshot, and only that.~/Games/Longshot.bin/longshotis refused.tests/test_launcher_core.py --strict --longshot <this branch>, 632 checks pass. They readmake_game.py, which changed.Not tested:
--cliinstall and build, its message box, a game folder'slongshot.exe, andcheck_windows_files.py --wine.appimage.shandcheck_player_build.shneed the build tools and the Vulkan back end.Needs other testers:
LongshotBuilder.exe --cli --prepare --game <your copy>installs the tools, builds and exits 0, the folder'slongshot.exestarts the game, and double-clickingLongshotBuilder.exeorLongshotBuilder\LongshotBuilder.exeshows only the launcher message, with no console window and nothing installed (T-TS6P).--cli --prepare --game <copy>, then start the folder'slongshot, expecting the build and the game, with no Tk error (T-ZMS7).Screenshots
Nothing on screen, apart from the new message box and dialog, which were not captured.
Risk and rollback
longshot.exestill opens an installed Builder with--launch, which now gives the message. Folders made from now on start their game themselves.longshot-folderstill starts itsbuilder=with--launch: the launcher, or the AppImage for a--clibuild, which plays it.longshotitself (nobin/) is no longer started by--play.--portable --cli) build no longer ties the game folder to that Builder. Nothing reads the tie any more.tkinterwould fail; nothing in the repository does.Reviewer notes
Start with
builder/LongshotBuilder/Program.csagainst the oldApp.xaml.cs, thenbuilder/linux/AppRunandsetup.c'swWinMain.Other PRs:
tests/builder_dlss_update_test.cs. This PR deletes that fixture, andtest_builder_dlss_update.pywith it, because they checked the WPF window's update decision. The merge commit brings #179 in, so there is no conflict.gpu/vk/vk_main.cpp, which this PR does not touch.Strings.cs,MainWindow.xaml(.cs)andlongshot_builder.pygo with those files. Itsrecomplauncher.jsonandmake_game.pychanges stay.docs/builder-no-window, makes the samedocs/releases.mdedit (cmp-identical). Merge them together.Kept on purpose (borderline):
--portable --cli,.longshot-portable,BuilderHome.cs,portable_home.h). RecompLauncher never asks for it, but it still works headless.AppRun --launch: a Linux game folder built with--clinames the AppImage as itsbuilder=.make_game.py's clean-up of a folder from before thebin/layout (old DLLs beside the launcher). It runs in the launcher's--updateof such a folder.make_game.py's antivirus messages, which name "the Longshot Builder folder" and "the zip". They are@@errortext the launcher shows, so they are left as they were.ngx_built()inmake_game.py, which nothing calls. It was already so on main.Issues
None.
Checklist
For everyone
type(scope): description).main.python -I -B tests/run_all.pyrun and passing (any failure that also fails onmainis named above).third_party/untouched (a new folder with aPROVENANCE.mdinstead).If applicable
Assisted-by:/Co-Authored-By:trailers.tests/that reads changed source updated in this PR, not weakened.WIP: chore(builder): the Builder is command-line only; the launcher is the appto chore(builder): the Builder is command-line only; the launcher is the appNew commits (on top of
9f0a3aa8; main merged in at2d604928, with #176, #178 and #179):c404e5ae: the AppImage's Python ships without Tcl/Tk: about 9.7 MB less in usr/python, and libXft/libXrender are gone too.14b9a8b5: drops everything that was kept only for the 2.x Builder (a game folder's longshot.exe starts bin/longshot.exe itself; no --launch, no --repair, no portable game-home link).7bcb46ad: the antivirus advice names the launcher's folders.7cbb2168: the window's last leftovers.35eabb8e: fixes from self-review (a broken README anchor that is also broken on main, a dead lookup, a stale comment).Companion PR: MagicBeanDev/LongshotLauncher#34 (docs/releases.md stays identical in both repos). Test requests: T-TS6P (Windows), T-ZMS7 (Linux).
Guep referenced this pull request2026-11-13 12:49:22 +00:00
Guep referenced this pull request2026-11-13 12:49:24 +00:00
Guep referenced this pull request2026-11-13 12:49:27 +00:00