Repository navigation
Conversation
…assets from _MEIPASS PyInstaller CLI/GUI builds from main were broken: 1. leapp_functions not bundled. The apple_atx_images artifact imports leapp_functions.parsers.apple_atx; since artifacts load dynamically, PyInstaller never sees it, so the plugin loader crashed at startup with ModuleNotFoundError. Added leapp_functions to datas + a hidden import and put the repo root on pathex, on all six specs. 2. Report assets unreachable. report.py resolved assets/tabler_icons and scripts/data/*.json via Path.cwd(), which only works when run from the repo. A packaged binary launched elsewhere logged 'file not found' and produced a report with no icons. It now resolves from sys._MEIPASS when frozen. The CLI specs also did not bundle assets/ at all; added it (GUI specs already did). 3. Size. Excluded scipy, matplotlib and pyarrow (pulled in transitively via pandas but imported by zero iLEAPP files) to shrink the binaries. Verified: built the macOS CLI from ileapp_macOS.spec, loaded all 295 artifacts with no import error, and ran a full parse from an unrelated working directory with icons rendered and no missing-asset errors. The other five specs received the analogous change (not built here).
|
Closing as superseded. The spec-file half of this landed on The The only piece not applied is |
Level the applicable ALEAPP abrignoni#1646 fixes with regression coverage. Co-Authored-By: OpenAI Codex (GPT-6) <[email protected]>
Problem
Building the CLI from
scripts/pyinstaller/ileapp_macOS.specon currentmainproduces a broken binary. Two independent bugs, plus a size issue:1.
leapp_functionsis not bundled → plugin loader crashes on startupscripts/artifacts/apple_atx_images.pydoes:Artifacts are loaded dynamically (
plugin_loader.py), so PyInstaller's static analysis never seesleapp_functionsand doesn't bundle it. Running the packaged binary:This aborts the whole run (the loader imports every artifact at startup).
2. Report assets are resolved from
Path.cwd()→ no icons in a packaged binaryscripts/report.pyloads its Tabler icons and correction JSON with paths relative to the current working directory:That only works when iLEAPP is launched from the repo root. A packaged binary run from anywhere else logs:
and generates a report with missing icons. The three CLI specs also never bundled
assets/at all (the GUI specs already do).3. Size — unused heavy libs bundled
scipy,matplotlib, andpyarroware imported by zero iLEAPP files (they come in transitively viapandas). They add a lot to the binary for nothing.Fix
scripts/report.py— resolveassets/andscripts/data/fromsys._MEIPASSwhen frozen, falling back tocwdfrom source (no behavior change when run from source). New_base_dir()helper.ileapp[_macOS/_Linux].spec,ileappGUI[_macOS/_Linux].spec) — addleapp_functionstodatas+ a hidden import forleapp_functions.parsers.apple_atx, and put the repo root onpathexso analysis can find it.assets/(the GUI specs already did).scipy,matplotlib,pyarrowtoexcludes.Testing
Built the macOS CLI (
ileapp_macOS.spec) and verified end-to-end:apple_atx_images, with no import error.The other five specs received the analogous change but were not built in this environment (no Windows/Linux here). They share the identical gaps, so the same fix applies.