Stop a launcher release and a build kit on an nx2navi_dlssg.dll that lacks an export runtime/dlssg/nx2_sl.h declares, before they download anything.

The review found that nothing on the release path ran the new export check: tools/make_launcher.py build_app and
tools/make_kit.py copied whatever --dlssg DLL they were given, and the release script still named the DLL of 0.8.0,
which lacks nx2sl_reflex2. Shipped that way, Reflex would never hold the frame limit while players still got this
branch's other changes. make_launcher.py check_dlssg and make_kit.py main now run build_dlssg.check on the --dlssg DLL
beside the translator's check, before anything is resolved, downloaded or deleted; build_dlssg.check also stops on a
missing file and on a file that is no DLL, with a message instead of a traceback. tests/dlssg_exports_check.py adds a
DLL with every declared export (it passes), the two-export DLL, a missing file and two files that are no DLL (they
stop, naming why), make_launcher.check_dlssg on both DLLs, and that both scripts' main makes the check before
streamline_pin.resolve and shutil.rmtree; it fails when the call is taken out of make_launcher.py main. The DLL built
from this branch passes make_launcher.check_dlssg; the DLL of 0.8.0 is refused, naming nx2sl_reflex2.
docs/launcher.md and docs/building.md "Checks" say so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-13 19:23:03 -05:00
parent 9f4f51f010
commit 0131b1b263
6 changed files with 87 additions and 11 deletions

View File

@@ -12,7 +12,8 @@ tools/make_game.py place_dlssg puts them beside the game.
The built DLL must export every function runtime/dlssg/nx2_sl.h declares (each PFN_nx2sl_<name> is the export
nx2sl_<name>), or the build fails naming the ones it lacks: the runtime takes a missing optional export for an older
DLL and leaves its feature out without an error. --check makes the same check of a DLL built before, such as the one
a release is about to ship.
a release is about to ship; tools/make_launcher.py and tools/make_kit.py make it on their --dlssg DLL first and stop
on one that fails.
"""
import argparse
import os
@@ -83,8 +84,14 @@ def missing_exports(dll, header=HEADER):
def check(dll):
"""Exit naming the exports nx2_sl.h declares that dll lacks."""
missing = missing_exports(dll)
"""Exit naming the exports nx2_sl.h declares that dll lacks, or saying that dll is missing or no PE file.
tools/make_launcher.py and tools/make_kit.py run it on their --dlssg DLL before anything is downloaded or built."""
if not Path(dll).is_file():
sys.exit(f'{dll} is missing')
try:
missing = missing_exports(dll)
except (ValueError, TypeError, struct.error) as e: # pe_exports: no PE signature, or a table outside the file
sys.exit(f'{dll} is no DLL that can be read ({e})')
if missing:
sys.exit(f'{dll} lacks exports runtime/dlssg/nx2_sl.h declares: {", ".join(missing)} '
'(a DLL built from older sources: build it again)')