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

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

Merged

Conversation

rokm
Copy link
Member

@rokm rokm commented Jun 10, 2023

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
18 checks passed
@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