[New-bugs-announce] [issue45949] Provide pure-Python implementation of Programs/_freeze_module for cross building

Christian Heimes report at bugs.python.org
Wed Dec 1 10:34:28 EST 2021


New submission from Christian Heimes <lists at cheimes.de>:

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:
- Use Programs/_freeze_module to create Python/frozen_modules/importlib._bootstrap.h and Python/frozen_modules/importlib._bootstrap_external.h
- build _bootstrap_python
- use new tool "./_bootstrap_python Tools/scripts/freezemodule.py" to create remaining Python/frozen_modules/*.h

Proposal for cross builds:
- use user-provider Python interpreter (./configure --with-build-python) to generate all Python/frozen_modules/*.h with new freezemodule.py tool.

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.

----------
assignee: christian.heimes
components: Build, Cross-Build
messages: 407459
nosy: Alex.Willmer, christian.heimes, gvanrossum
priority: normal
severity: normal
status: open
title: Provide pure-Python implementation of Programs/_freeze_module for cross building
type: enhancement
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45949>
_______________________________________


More information about the New-bugs-announce mailing list