fix(build): package scripts/ in the Linux AppImage, so NVIDIA DLSS can be fetched #1748

Merged
lucasknutr merged 2 commits from fix-linux-appimage-missing-ngx-scripts into main 2026-11-10 17:10:51 +00:00
lucasknutr commented 2026-11-10 15:25:24 +00:00 (Migrated from github.com)

What's broken

The Linux AppImage never carries scripts/, so nx2/make_game.py's ngx_script()
(scripts/ngx_sdk.py, loaded by path at HOOKSHOT_NGX_SDK/--fetch-ngx-sdk time)
can't be found. NVIDIA DLSS can't be built from any released Linux AppImage, only
from a source checkout — scripts/linux/ngx-sdk.sh and the README's Linux DLSS
section are unreachable from a release.

The copy block's own comment already says it carries "the sources the player's
build compiles, and the scripts" — scripts was just left out of the cp -a
line itself.

Reproduced directly against a built release AppImage:

FileNotFoundError: [Errno 2] No such file or directory: '.../usr/share/hookshot/scripts/ngx_sdk.py'

Fix

One line in scripts/linux/appimage.sh:

-cp -a nx2 host LICENSE readme.md assets "$T/"
+cp -a nx2 host scripts LICENSE readme.md assets "$T/"

Test

tests/test_appimage_scripts.py, in the same style as test_appimage_licenses.py:
runs the real copy block of appimage.sh into a temp folder and checks
scripts/ngx_sdk.py and scripts/linux/ngx-sdk.sh land byte-identical to the
source. Confirmed it fails on the original line and passes with the fix.

python -I -B tests/test_appimage_scripts.py
## What's broken The Linux AppImage never carries `scripts/`, so `nx2/make_game.py`'s `ngx_script()` (`scripts/ngx_sdk.py`, loaded by path at `HOOKSHOT_NGX_SDK`/`--fetch-ngx-sdk` time) can't be found. NVIDIA DLSS can't be built from any released Linux AppImage, only from a source checkout — `scripts/linux/ngx-sdk.sh` and the README's Linux DLSS section are unreachable from a release. The copy block's own comment already says it carries "the sources the player's build compiles, and the scripts" — `scripts` was just left out of the `cp -a` line itself. Reproduced directly against a built release AppImage: ``` FileNotFoundError: [Errno 2] No such file or directory: '.../usr/share/hookshot/scripts/ngx_sdk.py' ``` ## Fix One line in `scripts/linux/appimage.sh`: ```diff -cp -a nx2 host LICENSE readme.md assets "$T/" +cp -a nx2 host scripts LICENSE readme.md assets "$T/" ``` ## Test `tests/test_appimage_scripts.py`, in the same style as `test_appimage_licenses.py`: runs the real copy block of `appimage.sh` into a temp folder and checks `scripts/ngx_sdk.py` and `scripts/linux/ngx-sdk.sh` land byte-identical to the source. Confirmed it fails on the original line and passes with the fix. ``` python -I -B tests/test_appimage_scripts.py ```
hckrman101 (Migrated from github.com) approved these changes 2026-11-10 16:41:00 +00:00
hckrman101 (Migrated from github.com) left a comment

Looks good. The one-line fix is right: the comment above the copy already says scripts belong there, and nx2/make_game.py loads scripts/ngx_sdk.py by path. The test runs the real copy block and compares the files byte for byte, and it skips itself off Linux, so it is fine for Windows runners.

Nit: the test only checks two files. That's enough for this bug, so I wouldn't change it.

Looks good. The one-line fix is right: the comment above the copy already says scripts belong there, and nx2/make_game.py loads scripts/ngx_sdk.py by path. The test runs the real copy block and compares the files byte for byte, and it skips itself off Linux, so it is fine for Windows runners. Nit: the test only checks two files. That's enough for this bug, so I wouldn't change it.
Commenting is not possible because the repository is archived.
No description provided.