Use onedir PyInstaller bundles for faster macOS launch#2765
Open
Collinw24 wants to merge 1 commit into
Open
Conversation
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.
Summary
This changes the macOS PyInstaller bundle from onefile to onedir.
The current onefile app has a large amount of work before pyfa itself starts. On macOS that makes the packaged app look like it is hanging for a long time before any window appears. With onedir, the bundled files live inside the app bundle instead of being unpacked into a temp directory on every launch.
This keeps the output as
pyfa.appand does not change pyfa startup/runtime code.The packaging script now uses
zip -yso macOS bundle symlinks are stored as symlinks in the release archive instead of being followed and duplicated.Refs #1605.
Measurements
Measured on:
scripts/osx-setup.shscripts/osx-package.shupstream/masterata46ad2b81I also used a temporary instrumented build to split out the pre-Python time. That instrumentation is not included in this PR. With the onedir bundle, the median timing was:
MainFrame.Show(): 1.48sTradeoff
The installed app bundle is larger and contains more files, but preserving symlinks in the zip keeps the release archive close to the current onefile size:
QA
python scripts/compile_lang.pypython db_update.pyPYFA_VERSION=qa-pyi62-onedir-symlinkzip bash scripts/osx-package.shusing PyInstaller 6.2.0/usr/bin/unzipand verified it preserved 94 symlinkscodesign --verify --deep --strict --verbose=2on the extracted appgit diff --checkLocal pytest note: I did not treat pytest as the validation path for this packaging-only change. In this checkout, current local collection fails before tests run due existing test setup/import issues (
saveddata.dbpath on normal run, thenIPortUserimport underTRAVIS=true).