Repository navigation
Replace the PowerShell build script with a cross-platform Python driver - #12
Merged
Merged
Conversation
packaging/build.py drives the build on every platform in two phases so a signed build is possible: exe (PyInstaller, one-folder or --onefile), installer (Inno Setup on Windows; --sign-tool NAME has Inno sign the installer and the uninstaller), all (both, unsigned), and verify (asserts a code signature is present and valid, Authenticode or codesign). Signing belongs between the phases, and all refuses --sign-tool so an unsigned executable cannot ship inside a signed installer. The spec reads ONEFILE from the GLEAPP_ONEFILE environment variable. The old script rewrote that line in the tracked spec on every run, so a build dirtied the tree and the committed default depended on who built last. clr becomes a Windows-only hidden import; on macOS and Linux it logged an ERROR on every build for a module that cannot exist there. installer.iss takes the version from /DAppVer and refuses to compile without it, and the driver reads it from gleapp/__init__.py as text, so the installer and the app cannot report different versions. PyInstaller is pinned to 6.22.2 in the [build] extra, which phase 1 installs. packaging/entrypoint.py answers --version before the desktop shell is imported, so a frozen build can be smoke-tested without a window. desktop.main() never handled it despite a comment saying it does. test_builds.yml builds on Windows, macOS and Linux, checks --version and a real --texworker decode inside the frozen bundle, builds the installer on Windows, and uploads the artifacts. Advisory, so it keeps a paths filter. Proven on macOS: phase 1 through the driver builds against the edited spec, --version and --texworker both answer headless, --onefile produces one file, and the clr ERROR is gone. The driver build is larger than the baseline because it bundles pywebview from the [build] extra, which the baseline environment did not have. Not done here: on macOS and Linux the one-file and one-folder outputs are both dist/GLEAPP and collide (--clean avoids it; a rename touches the installer's folder expectation), and the repo mixes CRLF and LF. Co-Authored-By: Claude Fable 5.1 <[email protected]>
abrignoni
added a commit
that referenced
this pull request
Sep 3, 2026
p = pathlib.Path("/tmp/pr12body.txt"); s = p.read_text()
foot = "🤖 Generated with [Claude Code](https://claude.com/claude-code)"
assert foot in s
para = ("Second commit: the lint job now installs the dev extras. `tests/test_build_driver.py` imports `pytest` "
"for a `skipif`, and the job installed only `requirements.txt`, so pylint reported `import-error`. A new file "
"has no baseline, so that counted as introduced. Reproduced locally by removing pytest and confirmed cleared "
"by reinstalling it.\n\n")
p.write_text(s.replace(foot, para + foot, 1)); print("PR body: paragraph inserted before the footer")
PY
gh pr edit 12 --body-file /tmp/pr12body.txt > /dev/null && rm -f /tmp/pr12body.txt && echo "PR #12 body updated"
Install the dev extras in the lint job so new test files resolve pytest
pylint resolves imports against the job's environment, and the test files
import pytest, which lives in the dev extra rather than requirements.txt.
A new test file has no baseline in the merge-base comparison, so an
import it cannot resolve counts as introduced and fails the job.
tests/test_build_driver.py hit it; test_pipeline.py never did because its
import predates the job and is pre-existing on both sides. Reproduced by
removing pytest locally (1 import-error) and reinstalling it (0).
Installs pytest and piexif, the same dev extras test_cases.yml installs.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
pylint resolves imports against the job's environment, and the test files import pytest, which lives in the dev extra rather than requirements.txt. A new test file has no baseline in the merge-base comparison, so an import it cannot resolve counts as introduced and fails the job. tests/test_build_driver.py hit it; test_pipeline.py never did because its import predates the job and is pre-existing on both sides. Reproduced by removing pytest locally (1 import-error) and reinstalling it (0). Installs pytest and piexif, the same dev extras test_cases.yml installs. Co-Authored-By: Claude Fable 5.1 <[email protected]>
abrignoni
force-pushed
the
chore/build-script
branch
from
September 3, 2026 04:05
43fadcb to
fc0194c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces
build_exe.ps1withpackaging/build.py, one driver for Windows, macOS, Linux and ARM, in two phases so a signed build is possible.exeruns PyInstaller, one-folder or--onefile.installerruns Inno Setup on Windows;--sign-tool <name>has Inno sign the installer and its uninstaller.alldoes both, unsigned.verifyasserts a signature is present and valid, Authenticode or codesign, with--subjectto check the signer. Signing goes between the phases, andallrefuses--sign-tool, so an unsigned exe cannot ship inside a signed installer.ONEFILEfromGLEAPP_ONEFILEinstead of being rewritten by every build.clris now a Windows-only hidden import; on macOS and Linux it logged an ERROR on every build.gleapp/__init__.pythrough/DAppVer, andinstaller.issrefuses to compile without it, so the two cannot drift. PyInstaller is pinned to 6.22.2 in the[build]extra.packaging/entrypoint.pyanswers--versionbefore the desktop shell loads, so a frozen build can be smoke-tested headless.desktop.main()never handled it, though the comment on itsimport webviewline says it exists for that; I left the comment alone since it is not my file.test_builds.ymlbuilds on all three platforms, checks--versionand a real--texworkerdecode inside the frozen bundle, builds the installer on Windows, and uploads artifacts. Advisory.Proven on macOS: phase 1 through the driver builds against the edited spec,
--versionand--texworkerboth answer headless and exit 0,--onefileproduces a single file, theclrerror is gone. The driver build is larger than my baseline because it bundles pywebview from the[build]extra, which the baseline environment did not have.Two follow-ups, not done here. On macOS and Linux the one-file and one-folder outputs are both
dist/GLEAPPand collide;--cleanavoids it, and a rename touches the installer's folder expectation. The repo mixes CRLF and LF; a.gitattributeswould settle it.Second commit: the lint job now installs the dev extras.
tests/test_build_driver.pyimportspytestfor askipif, and the job installed onlyrequirements.txt, so pylint reportedimport-error. A new file has no baseline in the merge-base comparison, so that counted as introduced. Reproduced locally by removing pytest and confirmed cleared by reinstalling it.🤖 Generated with Claude Code