"""Build the standalone CLI and carry interpreter/bootloader notices with it.""" from importlib import metadata from pathlib import Path import shutil import struct import sys import sysconfig def clear_linux_runtime_execstack(library): # The bundled standalone CPython can request an executable stack. Newer # glibc refuses to dlopen it, even though CPython works with a normal stack. # The supported Linux bundle architectures use little-endian ELF64. with library.open('r+b') as binary: header = binary.read(64) if header[:6] != b'\x7fELF\x02\x01': raise RuntimeError(f'Expected a little-endian ELF64 Python runtime: {library}') table_offset = struct.unpack_from('