From a6b50b5b2a73771fd55a56e0cfbe9bfaa03fed7e Mon Sep 17 00:00:00 2001 From: Brigs Date: Mon, 10 Aug 2026 20:25:12 -0400 Subject: [PATCH] fix: bundle stdlib that only artifacts import into frozen builds Same frozen-build defect class as ALEAPP #1097, RLEAPP #407 and VLEAPP #124: artifacts are bundled as data files and imported from disk at runtime, so PyInstaller never sees their imports, and it prunes stdlib it cannot see used. DLEAPP's third-party coverage was already complete (bs4, pytz and simplekml ride the graph via ilapfuncs), but plistlib, email.utils and xml.etree.ElementTree are imported only by artifacts (the roblox modules among others) and were absent; base64 and struct added alongside for the same reason. The existing 'mailbox' entry was this exact fix applied once by hand. Verified by building dleapp_macOS.spec on Python 3.14 and running the frozen CLI end to end: 88 modules loaded, exit 0. Co-Authored-By: Claude Fable 5 --- scripts/pyinstaller/dleapp.spec | 9 +++++++++ scripts/pyinstaller/dleappGUI.spec | 9 +++++++++ scripts/pyinstaller/dleappGUI_macOS.spec | 9 +++++++++ scripts/pyinstaller/dleapp_macOS.spec | 9 +++++++++ 4 files changed, 36 insertions(+) diff --git a/scripts/pyinstaller/dleapp.spec b/scripts/pyinstaller/dleapp.spec index 21b1c9a..2419510 100755 --- a/scripts/pyinstaller/dleapp.spec +++ b/scripts/pyinstaller/dleapp.spec @@ -12,6 +12,15 @@ a = Analysis(['..\\..\\dleapp.py'], binaries=[], datas=[('..\\', '.\\scripts')], hiddenimports=[ + # Stdlib that only artifacts import. Artifacts are bundled as data + # files and imported from disk at runtime, so PyInstaller's + # import-graph analysis never sees these, and it prunes stdlib it + # cannot see used (mailbox below is the same case, added earlier). + 'base64', + 'email.utils', + 'plistlib', + 'struct', + 'xml.etree.ElementTree', 'bencoding', 'fitz', 'ijson', diff --git a/scripts/pyinstaller/dleappGUI.spec b/scripts/pyinstaller/dleappGUI.spec index 04a714b..4a2816b 100755 --- a/scripts/pyinstaller/dleappGUI.spec +++ b/scripts/pyinstaller/dleappGUI.spec @@ -12,6 +12,15 @@ a = Analysis(['..\\..\\dleappGUI.py'], binaries=[], datas=[('..\\', '.\\scripts'), ('..\\..\\assets', '.\\assets')], hiddenimports=[ + # Stdlib that only artifacts import. Artifacts are bundled as data + # files and imported from disk at runtime, so PyInstaller's + # import-graph analysis never sees these, and it prunes stdlib it + # cannot see used (mailbox below is the same case, added earlier). + 'base64', + 'email.utils', + 'plistlib', + 'struct', + 'xml.etree.ElementTree', 'bencoding', 'fitz', 'ijson', diff --git a/scripts/pyinstaller/dleappGUI_macOS.spec b/scripts/pyinstaller/dleappGUI_macOS.spec index ae29b4e..567202f 100755 --- a/scripts/pyinstaller/dleappGUI_macOS.spec +++ b/scripts/pyinstaller/dleappGUI_macOS.spec @@ -11,6 +11,15 @@ a = Analysis( binaries=[], datas=[('../', 'scripts'), ('../../assets', 'assets')], hiddenimports=[ + # Stdlib that only artifacts import. Artifacts are bundled as data + # files and imported from disk at runtime, so PyInstaller's + # import-graph analysis never sees these, and it prunes stdlib it + # cannot see used (mailbox below is the same case, added earlier). + 'base64', + 'email.utils', + 'plistlib', + 'struct', + 'xml.etree.ElementTree', 'bencoding', 'fitz', 'ijson', diff --git a/scripts/pyinstaller/dleapp_macOS.spec b/scripts/pyinstaller/dleapp_macOS.spec index ca06c4e..73ef0b6 100644 --- a/scripts/pyinstaller/dleapp_macOS.spec +++ b/scripts/pyinstaller/dleapp_macOS.spec @@ -11,6 +11,15 @@ a = Analysis( binaries=[], datas=[('../', 'scripts')], hiddenimports=[ + # Stdlib that only artifacts import. Artifacts are bundled as data + # files and imported from disk at runtime, so PyInstaller's + # import-graph analysis never sees these, and it prunes stdlib it + # cannot see used (mailbox below is the same case, added earlier). + 'base64', + 'email.utils', + 'plistlib', + 'struct', + 'xml.etree.ElementTree', 'bencoding', 'fitz', 'ijson',