Skip to content

building: limit package import in binary dependency analysis to Windows - #7698

Merged
rokm merged 1 commit into
pyinstaller:developfrom
rokm:binary-dependency-no-import-on-nonwindows
Jun 10, 2023
Merged

rokm merged 1 commit into
pyinstaller:developfrom
rokm:binary-dependency-no-import-on-nonwindows

Conversation

@rokm

@rokm rokm commented Jun 10, 2023

Copy link
Copy Markdown
Member

Limit the collected package import in the binary dependency analysis subprocess (performed prior to the actual analysis) to Windows.

Windows is the only platform where the packages' initialization code can modify shared library search paths (either by modifying PATH environment variables, or by calling os.add_dll_search_path), so importing the collected packages to initialize the environment makes sense only there.

Furthermore, non-deterministic package import order may cause issues with particular package combinations and import orders, so it is better to avoid it where we do not need it (i.e., on non-Windows platforms).

Closes #7695.

Limit the collected package import in the binary dependency analysis
subprocess (performed prior to the actual analysis) to Windows.

Windows is the only platform where the packages' initialization
code can modify shared library search paths (either by modifying
`PATH` environment variables, or by calling `os.add_dll_search_path`),
so importing the collected packages to initialize the environment
makes sense only there.

Furthermore, non-deterministic package import order may cause issues
with particular package combinations and import orders, so it is
better to avoid it where we do not need it (i.e., on non-Windows
platforms).
@rokm
rokm merged commit b9ddc35 into pyinstaller:develop Jun 10, 2023
@rokm
rokm deleted the binary-dependency-no-import-on-nonwindows branch June 10, 2023 21:51
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

run pyinstaller -D -w xxx.py errors

2 participants