Check at startup that the launcher's Python can read zstd files, and say how to fix it when it cannot.

Run from a checkout, the launcher uses the Python that started it. A Python older than 3.14 without the zstandard
package got through the first-run screen and stopped at Gather Build Tools with only "No module named 'zstandard'",
after the packages were downloaded. toolchain.zstd_missing now looks for compression.zstd or zstandard when the
launcher starts. Without either, the log and the first screen name the Python and give the pip line for
tools/requirements-launcher.txt, and Gather Build Tools stops with the same message before it unpacks anything. A
release's own Python always has the package; if it ever lacks it, the message says to reinstall NX2navi.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-12 07:16:14 -05:00
parent ee46a19ede
commit d2ab9a00be
6 changed files with 48 additions and 0 deletions

View File

@@ -29,6 +29,10 @@ class Context:
self._file = None
self.log(f'--- NX2navi launcher {self.version} ({"checkout" if self.layout.dev else "release"}) in '
f'{self.layout.root}')
from .toolchain import zstd_missing
self.zstd_missing = zstd_missing(self.layout)
if self.zstd_missing:
self.log(self.zstd_missing)
if self.settings.unreadable:
self.log(f'{self.layout.settings} is not valid JSON: the settings start from their defaults; the file as '
'it was is kept as launcher.json.bad')