feat(linux): install the Linux builder's build tools from the tools.lock inside its AppImage #4

Merged
HumanBean merged 1 commit from HumanBean/LongshotLauncher:linux-tools-lock into main 2026-11-13 04:37:47 +00:00
Owner

Why

Longshot's Linux AppImage is dropping its bundled build tools, so the launcher has to install them itself. Without this change, a Linux build started from the launcher would find no compiler (MagicBeanDev/Longshot#113).

What changed

  • Core/Toolchains.cs, InstallAppImageAsync: after unpacking the AppImage, it reads usr/share/longshot/tools.lock inside it and installs its linux-x64 lines (InstallTools). The file is covered by the AppImage's checksum in the signed SHA256SUMS.
    • Each tool is either kept from another installed version (Reuse: hard links, as on Windows) or downloaded from its first URL that gives the right size and SHA-256, then unpacked at its dest beside the AppImage (Unpack: modes and relative links).
    • Each tool is recorded in toolchain.json, so the next version can reuse it.
    • The bar runs 0 to 0.4 for the AppImage, then to 1 by the tools' bytes.
    • A tool whose dest already exists is skipped.
    • An older AppImage with no tools.lock inside installs nothing more, as before.
  • Core/MakeGameCommand.cs: on Linux, LONGSHOT_SDL2 is usr/lib/longshot/sdl2/libSDL2-2.0.so.0 when that folder exists (tools.lock's sdl2), else the old usr/lib/longshot/libSDL2-2.0.so.0. The other variables already point at the tools' dests: emsdk, sysroot and ffmpeg in usr/lib/longshot/, and the headers in usr/share/longshot/cpm, which nx2/build.py finds by itself.
  • Comments in ToolsLock.cs, ToolsSource.cs and PartsManifest.cs.
  • docs/releases.md, RELEASING.md: byte-identical with MagicBeanDev/Longshot#113. They cover the Linux tools in tools.lock, the tools as generic packages, and the optional profile. The 5 shared files are identical across the two branches (cmp).

Flags and settings

None.

Measurements

No runtime change to measure. The sizes involved (an AppImage of 94.6 MB instead of 244.7 MB, plus 170.4 MB of tools downloaded once and shared across versions) are in MagicBeanDev/Longshot#113.

Testing

Tested:

  • python3 -I tests/test_launcher_core.py --strict --longshot <Longshot's PR branch> in mcr.microsoft.com/dotnet/sdk:10.0: 524 checks passed. New checks in ScreenChecks.cs, using authored zips and a fake forge:
    • the AppImage's tools.lock tools are unpacked beside it, and the Windows line is not taken;
    • the mirror is used when the first link is gone;
    • a symbolic link and an executable's mode are kept;
    • the progress bar never goes back;
    • make_game.py gets EMSDK and the new LONGSHOT_SDL2;
    • the next version keeps the unchanged SDL2 and downloads the changed clang;
    • a tool whose bytes differ installs nothing and leaves no .part folder.
  • tests/test_release.py: OK.
  • dotnet build App -c Release: 0 warnings, 0 errors.

Not tested: the launcher's window with a real Longshot release of the new AppImage: none is released yet.

Needs other testers:

  • Linux: once Longshot's PR is in a nightly, build that nightly with this launcher. Expect the step 1 bar to download the AppImage and then its tools, and the build to finish (request to open).

Screenshots

Nothing on screen (the step 1 bar's texts only).

Risk and rollback

Only the Linux install of a version with a tools.lock inside its AppImage changes. Reverting is enough. This must be released before Longshot ships an AppImage without its tools.

Checklist

  • One topic.
  • The title is a Conventional Commit.
  • Rebased on current main.
  • Tests run and passing.
  • Docs updated (the shared files are identical to Longshot's).
## Why Longshot's Linux AppImage is dropping its bundled build tools, so the launcher has to install them itself. Without this change, a Linux build started from the launcher would find no compiler (MagicBeanDev/Longshot#113). ## What changed - **`Core/Toolchains.cs`, `InstallAppImageAsync`**: after unpacking the AppImage, it reads `usr/share/longshot/tools.lock` inside it and installs its `linux-x64` lines (`InstallTools`). The file is covered by the AppImage's checksum in the signed `SHA256SUMS`. - Each tool is either kept from another installed version (`Reuse`: hard links, as on Windows) or downloaded from its first URL that gives the right size and SHA-256, then unpacked at its `dest` beside the AppImage (`Unpack`: modes and relative links). - Each tool is recorded in `toolchain.json`, so the next version can reuse it. - The bar runs 0 to 0.4 for the AppImage, then to 1 by the tools' bytes. - A tool whose dest already exists is skipped. - An older AppImage with no `tools.lock` inside installs nothing more, as before. - **`Core/MakeGameCommand.cs`**: on Linux, `LONGSHOT_SDL2` is `usr/lib/longshot/sdl2/libSDL2-2.0.so.0` when that folder exists (tools.lock's `sdl2`), else the old `usr/lib/longshot/libSDL2-2.0.so.0`. The other variables already point at the tools' dests: emsdk, sysroot and ffmpeg in `usr/lib/longshot/`, and the headers in `usr/share/longshot/cpm`, which `nx2/build.py` finds by itself. - **Comments** in `ToolsLock.cs`, `ToolsSource.cs` and `PartsManifest.cs`. - **`docs/releases.md`, `RELEASING.md`**: byte-identical with MagicBeanDev/Longshot#113. They cover the Linux tools in `tools.lock`, the tools as generic packages, and the optional profile. The 5 shared files are identical across the two branches (`cmp`). ## Flags and settings None. ## Measurements No runtime change to measure. The sizes involved (an AppImage of 94.6 MB instead of 244.7 MB, plus 170.4 MB of tools downloaded once and shared across versions) are in MagicBeanDev/Longshot#113. ## Testing **Tested:** - `python3 -I tests/test_launcher_core.py --strict --longshot <Longshot's PR branch>` in `mcr.microsoft.com/dotnet/sdk:10.0`: 524 checks passed. New checks in `ScreenChecks.cs`, using authored zips and a fake forge: - the AppImage's tools.lock tools are unpacked beside it, and the Windows line is not taken; - the mirror is used when the first link is gone; - a symbolic link and an executable's mode are kept; - the progress bar never goes back; - `make_game.py` gets `EMSDK` and the new `LONGSHOT_SDL2`; - the next version keeps the unchanged SDL2 and downloads the changed clang; - a tool whose bytes differ installs nothing and leaves no `.part` folder. - `tests/test_release.py`: OK. - `dotnet build App -c Release`: 0 warnings, 0 errors. **Not tested:** the launcher's window with a real Longshot release of the new AppImage: none is released yet. **Needs other testers:** - Linux: once Longshot's PR is in a nightly, build that nightly with this launcher. Expect the step 1 bar to download the AppImage and then its tools, and the build to finish (request to open). ## Screenshots Nothing on screen (the step 1 bar's texts only). ## Risk and rollback Only the Linux install of a version with a `tools.lock` inside its AppImage changes. Reverting is enough. This must be released before Longshot ships an AppImage without its tools. ## Checklist - [x] One topic. - [x] The title is a Conventional Commit. - [x] Rebased on current `main`. - [x] Tests run and passing. - [x] Docs updated (the shared files are identical to Longshot's).
feat(linux): install the Linux builder's build tools from the tools.lock inside its AppImage
All checks were successful
CI / Conventional Commit title (pull_request) Successful in 2s
CI / Compile and test (pull_request) Successful in 1m9s
b80dea7601
Longshot's Linux AppImage no longer carries its build tools: they are linux-x64 lines of the tools.lock inside it. After
unpacking the AppImage, the launcher installs each of them beside it at its dest, checked by its size and SHA-256 or
kept from another installed version, as on Windows. An older AppImage, with no tools.lock inside, needs none.
HumanBean deleted branch linux-tools-lock 2026-11-13 04:37:47 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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!4
No description provided.