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
Provide pure-Python implementation of Programs/_freeze_module for cross building #90107
Comments
As of today 3.11-dev requires Programs/_freeze_module to compile Python code to byte code. The dependency on an extra and special tool makes cross building more complicated. The _freeze_module is trivial and can be easily implemented in pure Python code. The re-introduction of _bootstrap_python helper would allow us to use a pure Python freeze_module for all modules except two importlib bootstrap modules. I have a proof of concept implementation that works for me. Proposal for standard builds:
Proposal for cross builds:
When cross building the user must already provide a Python interpreter with same version and bytecode version as the build target. Users would no longer need to provide a _freeze_module binary with ./configure --with-freeze-module. |
IIRC, Programs/_freeze_module.c was originally a C implementation of the basic functionality in Tools/freeze/freeze.py. |
Ideally we would not have two scripts that do the same thing. |
Eric, could you review my PR, please? It simplifies cross building to other platforms. I took a look at Tools/freeze/freeze.py. The freeze tool creates different output than Program/_freeze_module.c. |
In his code review Eric made a point that the relationship of variables and their impact on normal and cross builds are not obvious. I'm going to introduce new variables for freezing and freezing dependencies. Bonus: Cross builds no longer build non-functional _bootstrap_python and Programs/_freeze_module. Normal build: PYTHON_FOR_FREEZE=./_bootstrap_python Cross build: PYTHON_FOR_FREEZE=/path/to/build/python |
Thanks for your review, Eric! |
You're welcome! Thanks for doing the work! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: