Repository navigation
Commit efb4220
committed
Build recipe for the standalone pyobs-gui binary
pysidedeploy.spec targets pyobs_gui/__main__.py (the interactive-login
entry point) in --mode=standalone with clang pinned, matching the
gui-widget-plugins-and-packaging.md packaging plan.
Compiling the real app under Nuitka hit a genuine, unresolved upstream
limitation: astropy's unit-string parser (astropy.units.format.generic)
builds its PLY grammar via sys._getframe() stack-walking to
auto-discover its own tokens/p_* locals, and Nuitka-compiled function
frames don't populate f_locals the way CPython's do -- so the very
first `import astropy.units` (pulled in unconditionally by
pyobs-core's pyobs.utils.enums) crashed with
"YaccError: Unable to build parser". See
astropy/astropy#15069 and
Nuitka/Nuitka#2313 -- both still open as of
2026-07. pyobs_gui/_nuitka_astropy_patch.py works around it by
rebuilding the same grammar (copied verbatim from astropy's source) in
a plain namespace object and feeding it to
astropy.extern.ply.yacc/lex via their frame-introspection-free
`module=` path, installed as a fallback in
get_caller_module_dict itself (patching Generic._parser/_lexer
directly deadlocks: importing astropy.units.core/format.generic to
build the patch is what triggers the crash in the first place, before
the patch could be installed). Wired in at the top of
pyobs_gui/__init__.py, since that runs before anything else in the
package.
Scoped to the generic unit format only -- the one astropy hits
unconditionally at startup. cds/ogip/vounit and
astropy.coordinates.angles use the same PLY pattern and would need
identical treatment if the compiled binary ever exercises them.1 parent 4d20a29 commit efb4220
5 files changed
Lines changed: 563 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
7 | 11 | | |
8 | 12 | | |
9 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | | - | |
12 | | - | |
| 10 | + | |
| 11 | + | |
13 | 12 | | |
| 13 | + | |
| 14 | + | |
14 | 15 | | |
15 | | - | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
0 commit comments