fix(linux): the AppImage carries zbic's zstd sources, so a build with NVIDIA DLSS compiles #4

Merged
HumanBean merged 1 commit from HumanBean/Longshot:fix-appimage-zbic-sources into main 2026-11-12 21:57:32 +00:00
Owner

Every Linux build with NVIDIA DLSS ticked in the builder stops before the link with FileNotFoundError: .../third_party/zbic/zstd.h, because the AppImage leaves out the zstd sources that build compiles. A player hit it on v2.2.0-rc.1.

Why

The AppImage's prebuilt Vulkan back end has no DLSS, so with LONGSHOT_NGX_SDK set, prebuilt_renderer() returns "" and nx2/build.py compiles gpu/vk from the AppImage's own tree. That compile builds third_party/zbic/zstd.c and reads zstd.h and zstd_errors.h (nx2/build.py, the program cache's zstd; vk_progcache.cpp includes zstd.h). But scripts/linux/appimage.sh copied only zbic.so, LICENSE and PROVENANCE.md from third_party/zbic.

check_player_build.sh and tests/test_appimage_player_build.py only covered the prebuilt path, so CI stayed green. #1567 slipped through the same way.

Change

  • scripts/linux/appimage.sh: also copies zstd.c, zstd.h and zstd_errors.h.
  • tests/test_appimage_player_build.py: a new dry run from the packaged tree with LONGSHOT_NGX_SDK set (a stand-in SDK and header folders), so the from-source back end is checked as the prebuilt one is. A stand-in clang++ joins the stand-in clang.

Tested

  • Before the fix, the new test fails with the player's exact error:
    File ".../AppDir/usr/share/longshot/nx2/build.py", line 1246, in main
      zstd_deps = b"".join(open(os.path.join(zbic, f), "rb").read() for f in ("zstd.h", "zstd_errors.h"))
    FileNotFoundError: [Errno 2] No such file or directory: '.../AppDir/usr/share/longshot/third_party/zbic/zstd.h'
    
    After it: Ran 6 tests ... OK.
  • python -I -B tests/run_all.py (Linux): 450 passed, 7 failed, 71 skipped. The same 7 fail on main without this change (test_control, test_program_cache_*, test_longshot_ctl, …; this machine's sandbox).
  • Real AppImage built from this branch: check_player_build.sh passes, and with DLSS on the dry run from the image finds 0 of 400 files missing; with the three zstd files removed it fails with the player's error (details in the comment below). Not run: a full DLSS build with a game dump and NVIDIA's SDK, or the game itself.

🤖 Generated with Claude Code

Every Linux build with **NVIDIA DLSS** ticked in the builder stops before the link with `FileNotFoundError: .../third_party/zbic/zstd.h`, because the AppImage leaves out the zstd sources that build compiles. A player hit it on v2.2.0-rc.1. ## Why The AppImage's prebuilt Vulkan back end has no DLSS, so with `LONGSHOT_NGX_SDK` set, `prebuilt_renderer()` returns `""` and `nx2/build.py` compiles `gpu/vk` from the AppImage's own tree. That compile builds `third_party/zbic/zstd.c` and reads `zstd.h` and `zstd_errors.h` (`nx2/build.py`, the program cache's zstd; `vk_progcache.cpp` includes `zstd.h`). But `scripts/linux/appimage.sh` copied only `zbic.so`, `LICENSE` and `PROVENANCE.md` from `third_party/zbic`. `check_player_build.sh` and `tests/test_appimage_player_build.py` only covered the prebuilt path, so CI stayed green. #1567 slipped through the same way. ## Change - `scripts/linux/appimage.sh`: also copies `zstd.c`, `zstd.h` and `zstd_errors.h`. - `tests/test_appimage_player_build.py`: a new dry run from the packaged tree with `LONGSHOT_NGX_SDK` set (a stand-in SDK and header folders), so the from-source back end is checked as the prebuilt one is. A stand-in `clang++` joins the stand-in `clang`. ## Tested - Before the fix, the new test fails with the player's exact error: ``` File ".../AppDir/usr/share/longshot/nx2/build.py", line 1246, in main zstd_deps = b"".join(open(os.path.join(zbic, f), "rb").read() for f in ("zstd.h", "zstd_errors.h")) FileNotFoundError: [Errno 2] No such file or directory: '.../AppDir/usr/share/longshot/third_party/zbic/zstd.h' ``` After it: `Ran 6 tests ... OK`. - `python -I -B tests/run_all.py` (Linux): 450 passed, 7 failed, 71 skipped. The same 7 fail on `main` without this change (`test_control`, `test_program_cache_*`, `test_longshot_ctl`, …; this machine's sandbox). - **Real AppImage built from this branch:** `check_player_build.sh` passes, and with DLSS on the dry run from the image finds 0 of 400 files missing; with the three zstd files removed it fails with the player's error (details in the comment below). **Not run:** a full DLSS build with a game dump and NVIDIA's SDK, or the game itself. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(linux): the AppImage carries zbic's zstd sources, so a build with NVIDIA DLSS compiles
Some checks failed
PR title / Conventional Commit title (pull_request_target) Has been cancelled
Linux AppImage / appimage (pull_request) Has been cancelled
Linux AppImage / Release asset (pull_request) Has been cancelled
Game-free source regressions / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (windows-2022, part 1/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (windows-2022, part 2/2) (pull_request) Has been cancelled
Game-free source regressions / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
Game-free source regressions / Workflow lint (actionlint) (pull_request) Has been cancelled
Windows builder / Longshot Builder package and setup (pull_request) Has been cancelled
Windows builder / Windows Vulkan back end (llvm-mingw) (pull_request) Has been cancelled
Windows builder / dav1d for Windows (llvm-mingw) (pull_request) Has been cancelled
Windows builder / Release assets (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request_target) Has been skipped
d2eb8a7233
With DLSS ticked in the Linux builder, the prebuilt Vulkan back end is not used (it has no DLSS) and nx2/build.py
compiles gpu/vk from the AppImage's tree. That compile builds third_party/zbic/zstd.c and reads zstd.h and
zstd_errors.h, but appimage.sh copied only zbic.so, LICENSE and PROVENANCE.md from that folder, so every such build
stopped at FileNotFoundError: .../third_party/zbic/zstd.h.

appimage.sh now copies zstd.c, zstd.h and zstd_errors.h too. tests/test_appimage_player_build.py gains a dry run
with LONGSHOT_NGX_SDK set, so the from-source path is checked from the packaged tree as the prebuilt one already is.

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

Tested on a real AppImage built from this branch

I built the AppImage with scripts/linux/docker.sh (Ubuntu 22.04 container, as CI; host networking because this PC's Docker bridge has no DNS). It finished with Longshot-...-gd2eb8a72-x86_64.AppImage: 234M. The back end compiled in 153 s with 0 failed, zstd.c included. The image's usr/share/longshot/third_party/zbic/ now holds zstd.c, zstd.h, zstd_errors.h, zbic.so, LICENSE and PROVENANCE.md.

1. A normal player's build, scripts/linux/check_player_build.sh (as CI runs it): passes.

the Vulkan back end: .../usr/lib/longshot/longshot_vk.so, as built
dry run: 194 files to compile besides the lift's, 0 missing
a player's build starts from the AppImage's tree

2. The player's case: the same image, AppRun's environment, NVIDIA DLSS on (LONGSHOT_NGX_SDK, a stand-in SDK folder; Vulkan, SPIR-V and VMA headers are the image's own cpm/): the back end is compiled from the image's tree, and nothing is missing.

the Vulkan back end: with NVIDIA DLSS (NVIDIA's NGX SDK in .../ngx)
dry run: 400 files to compile besides the lift's, 0 missing
exit 0

Control: the same run after moving the three zstd files out of the extracted image (what v2.2.0-rc.1 shipped) fails with the reported error:

FileNotFoundError: [Errno 2] No such file or directory: '.../usr/share/longshot/third_party/zbic/zstd.h'
exit 1

Still not done: a full DLSS build with a game dump and NVIDIA's real SDK, then running it in the game. The dry run stops where the lifted game is first needed. Leaving this as a draft until someone with an NVIDIA card does that.

## Tested on a real AppImage built from this branch I built the AppImage with `scripts/linux/docker.sh` (Ubuntu 22.04 container, as CI; host networking because this PC's Docker bridge has no DNS). It finished with `Longshot-...-gd2eb8a72-x86_64.AppImage: 234M`. The back end compiled in 153 s with 0 failed, `zstd.c` included. The image's `usr/share/longshot/third_party/zbic/` now holds `zstd.c`, `zstd.h`, `zstd_errors.h`, `zbic.so`, `LICENSE` and `PROVENANCE.md`. **1. A normal player's build, `scripts/linux/check_player_build.sh` (as CI runs it):** passes. ``` the Vulkan back end: .../usr/lib/longshot/longshot_vk.so, as built dry run: 194 files to compile besides the lift's, 0 missing a player's build starts from the AppImage's tree ``` **2. The player's case: the same image, AppRun's environment, NVIDIA DLSS on** (`LONGSHOT_NGX_SDK`, a stand-in SDK folder; Vulkan, SPIR-V and VMA headers are the image's own `cpm/`): the back end is compiled from the image's tree, and nothing is missing. ``` the Vulkan back end: with NVIDIA DLSS (NVIDIA's NGX SDK in .../ngx) dry run: 400 files to compile besides the lift's, 0 missing exit 0 ``` **Control:** the same run after moving the three zstd files out of the extracted image (what v2.2.0-rc.1 shipped) fails with the reported error: ``` FileNotFoundError: [Errno 2] No such file or directory: '.../usr/share/longshot/third_party/zbic/zstd.h' exit 1 ``` **Still not done:** a full DLSS build with a game dump and NVIDIA's real SDK, then running it in the game. The dry run stops where the lifted game is first needed. Leaving this as a draft until someone with an NVIDIA card does that.
HumanBean changed title from WIP: fix(linux): the AppImage carries zbic's zstd sources, so a build with NVIDIA DLSS compiles to fix(linux): the AppImage carries zbic's zstd sources, so a build with NVIDIA DLSS compiles 2026-11-12 21:52:17 +00:00
HumanBean deleted branch fix-appimage-zbic-sources 2026-11-12 21:57:32 +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/Longshot!4
No description provided.