bpo-45950: Introduce Bootstrap Python again (#29859)

The build system now uses a :program:`_bootstrap_python` interpreter for
freezing and deepfreezing again. To speed up build process the build tools
:program:`_bootstrap_python` and :program:`_freeze_module` are no longer
build with LTO.

Cross building depends on a build Python interpreter, which must have same
version and bytecode as target host Python.
This commit is contained in:
Christian Heimes 2021-12-03 17:01:11 +02:00 committed by GitHub
parent ccb73a0d50
commit 84ca1232b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 185 additions and 71 deletions

View file

@ -1,3 +1,8 @@
"""Deep freeze
The script is executed by _bootstrap_python interpreter. Shared library
extension modules are not available.
"""
import argparse
import ast
import builtins
@ -8,7 +13,6 @@ import re
import sys
import time
import types
import unicodedata
from typing import Dict, FrozenSet, Tuple, TextIO
import umarshal

View file

@ -589,7 +589,7 @@ def regen_makefile(modules):
])
deepfreezerules.append(f'{cfile}: {frozen_header} $(DEEPFREEZE_DEPS)')
deepfreezerules.append(
f"\t$(PYTHON_FOR_REGEN) "
f"\t$(PYTHON_FOR_FREEZE) "
f"$(srcdir)/Tools/scripts/deepfreeze.py "
f"{frozen_header} -m {src.frozenid} -o {cfile}")
deepfreezerules.append('')