Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid duplication of "pure" scripts, for onedir mode with multiple executables #8424

Open
thisismypassport opened this issue Apr 22, 2024 · 1 comment
Labels
feature Feature request

Comments

@thisismypassport
Copy link

thisismypassport commented Apr 22, 2024

Is your feature request related to a problem? Please describe.
Currently, if you create a folder with several executable, each executable contains duplication of various pure python scripts - both a ton of stuff from the standard library (bz2 as one example) and scripts used in your project by both executables.
This adds unnecessary file size.

Describe the solution you'd like
It would be great if there was a good & documented way to avoid this duplication.
After some asking around and investigation (took me a while since I was under the mistaken impression that MERGE should've solved this), I found https://github.com/orgs/pyinstaller/discussions/5393 which describes the same issue. and suggests using noarchive.

However, this dumps the pyc files and folders containing those into the output directory, while it would probably be much better if they'd be packaged in a single resource file, and this ability would be documented in the section on creating multi-package bundles. (Since - IMO - this is wanted the majority of times when you use multi-package bundles - since even if the packages are 100% different, there's still a lot of duplicated data from the standard library and common packages)

As an alternative to packing it in a single resource file, it could also perhaps be packaged in the first exe, with the other exes loading the files from the first exe (Which is what I initially mistakenly thought MERGE would do)
(A disadvantage of this sub-approach is that it creates a dependency between exes, though this is what MERGE does as well)

@thisismypassport thisismypassport added feature Feature request triage Please triage and relabel this issue labels Apr 22, 2024
@rokm
Copy link
Member

rokm commented Apr 22, 2024

Yes, eventually the multipackage part will be revised to provide support for a shared external PYZ archive (for onedir builds) and for shared external PKG archive (for onefile builds, as replacement for MERGE).

@rokm rokm removed the triage Please triage and relabel this issue label Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request
Projects
None yet
Development

No branches or pull requests

2 participants