diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 44609a7a..6befbc46 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,10 +1,6 @@ name: CI on: pull_request: - push: - branches: - - main - - 3.* workflow_call: inputs: build-number: @@ -114,6 +110,9 @@ jobs: # Appending -dev ensures that we can always build the dev release. # It's a no-op for versions that have been published. python-version: ${{ needs.config.outputs.PYTHON_VER }}-dev + # Ensure that we *always* use the latest build, not a cached version. + # It's an edge case, but when a new alpha is released, we need to use it ASAP. + check-latest: true - name: Build ${{ matrix.target }} run: | @@ -121,7 +120,7 @@ jobs: make ${{ matrix.target }} BUILD_NUMBER=${{ needs.config.outputs.BUILD_NUMBER }} - name: Upload build artefacts - uses: actions/upload-artifact@v4.6.0 + uses: actions/upload-artifact@v4.6.1 with: name: Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz path: dist/Python-${{ needs.config.outputs.PYTHON_VER }}-${{ matrix.target }}-support.${{ needs.config.outputs.BUILD_NUMBER }}.tar.gz diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4c0a16a4..61da403c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -40,14 +40,14 @@ jobs: needs: [ config, ci ] steps: - name: Get build artifacts - uses: actions/download-artifact@v4.1.8 + uses: actions/download-artifact@v4.1.9 with: pattern: Python-* path: dist merge-multiple: true - name: Create Release - uses: ncipollo/release-action@v1.15.0 + uses: ncipollo/release-action@v1.16.0 with: name: ${{ needs.ci.outputs.PYTHON_VER }}-${{ needs.config.outputs.BUILD_NUMBER }} tag: ${{ needs.ci.outputs.PYTHON_VER }}-${{ needs.config.outputs.BUILD_NUMBER }} diff --git a/Makefile b/Makefile index 66179ff2..ebebe027 100644 --- a/Makefile +++ b/Makefile @@ -426,6 +426,7 @@ PYTHON_FRAMEWORK-$(sdk)=$$(PYTHON_INSTALL-$(sdk))/Python.framework PYTHON_INSTALL_VERSION-$(sdk)=$$(PYTHON_FRAMEWORK-$(sdk))/Versions/$(PYTHON_VER) PYTHON_LIB-$(sdk)=$$(PYTHON_INSTALL_VERSION-$(sdk))/Python PYTHON_INCLUDE-$(sdk)=$$(PYTHON_INSTALL_VERSION-$(sdk))/include/python$(PYTHON_VER) +PYTHON_MODULEMAP-$(sdk)=$$(PYTHON_INCLUDE-$(sdk))/module.modulemap PYTHON_STDLIB-$(sdk)=$$(PYTHON_INSTALL_VERSION-$(sdk))/lib/python$(PYTHON_VER) else @@ -436,6 +437,7 @@ else # The non-macOS frameworks don't use the versioning structure. PYTHON_INSTALL-$(sdk)=$(PROJECT_DIR)/install/$(os)/$(sdk)/python-$(PYTHON_VERSION) +PYTHON_MODULEMAP-$(sdk)=$$(PYTHON_INCLUDE-$(sdk))/module.modulemap PYTHON_FRAMEWORK-$(sdk)=$$(PYTHON_INSTALL-$(sdk))/Python.framework PYTHON_LIB-$(sdk)=$$(PYTHON_FRAMEWORK-$(sdk))/Python PYTHON_BIN-$(sdk)=$$(PYTHON_INSTALL-$(sdk))/bin @@ -466,8 +468,14 @@ $$(PYTHON_INCLUDE-$(sdk))/pyconfig.h: $$(PYTHON_LIB-$(sdk)) # Copy headers as-is from the first target in the $(sdk) SDK cp -r $$(PYTHON_INCLUDE-$$(firstword $$(SDK_TARGETS-$(sdk)))) $$(PYTHON_INCLUDE-$(sdk)) - # Copy in the modulemap file - cp -r patch/Python/module.modulemap $$(PYTHON_INCLUDE-$(sdk)) + # Create the modulemap file + cp -r patch/Python/module.modulemap.prefix $$(PYTHON_MODULEMAP-$(sdk)) + echo "" >> $$(PYTHON_MODULEMAP-$(sdk)) + cd $$(PYTHON_SRCDIR-$$(firstword $$(SDK_TARGETS-$(sdk))))/Include && \ + find cpython -name "*.h" | sort | sed -e 's/^/ exclude header "/' | sed 's/$$$$/"/' >> $$(PYTHON_MODULEMAP-$(sdk)) && \ + echo "" >> $$(PYTHON_MODULEMAP-$(sdk)) && \ + find internal -name "*.h" | sort | sed -e 's/^/ exclude header "/' | sed 's/$$$$/"/' >> $$(PYTHON_MODULEMAP-$(sdk)) + echo "\n}" >> $$(PYTHON_MODULEMAP-$(sdk)) # Link the PYTHONHOME version of the headers mkdir -p $$(PYTHON_INSTALL-$(sdk))/include @@ -583,8 +591,14 @@ $$(PYTHON_XCFRAMEWORK-$(os))/Info.plist: \ # Rewrite the framework to make it standalone patch/make-relocatable.sh $$(PYTHON_INSTALL_VERSION-macosx) 2>&1 > /dev/null - # Copy in the modulemap file - cp -r patch/Python/module.modulemap $$(PYTHON_FRAMEWORK-macosx)/Headers + # Create the modulemap file + cp -r patch/Python/module.modulemap.prefix $$(PYTHON_MODULEMAP-macosx) + echo "" >> $$(PYTHON_MODULEMAP-macosx) + cd $$(PYTHON_INCLUDE-macosx) && \ + find cpython -name "*.h" | sort | sed -e 's/^/ exclude header "/' | sed 's/$$$$/"/' >> $$(PYTHON_MODULEMAP-macosx) && \ + echo "" >> $$(PYTHON_MODULEMAP-macosx) && \ + find internal -name "*.h" | sort | sed -e 's/^/ exclude header "/' | sed 's/$$$$/"/' >> $$(PYTHON_MODULEMAP-macosx) + echo "\n}" >> $$(PYTHON_MODULEMAP-macosx) # Re-apply the signature on the binaries. codesign -s - --preserve-metadata=identifier,entitlements,flags,runtime -f $$(PYTHON_LIB-macosx) \ diff --git a/patch/Python/Python.patch b/patch/Python/Python.patch index b6777235..bc2c2c57 100644 --- a/patch/Python/Python.patch +++ b/patch/Python/Python.patch @@ -1,3 +1,52 @@ +diff --git a/Doc/c-api/init_config.rst b/Doc/c-api/init_config.rst +index cd78fe18e35..612aa2aa711 100644 +--- a/Doc/c-api/init_config.rst ++++ b/Doc/c-api/init_config.rst +@@ -1271,17 +1271,6 @@ + + Default: ``1`` in Python config and ``0`` in isolated config. + +- .. c:member:: int use_system_logger +- +- If non-zero, ``stdout`` and ``stderr`` will be redirected to the system +- log. +- +- Only available on macOS 10.12 and later, and on iOS. +- +- Default: ``0`` (don't use system log). +- +- .. versionadded:: 3.13.2 +- + .. c:member:: int user_site_directory + + If non-zero, add the user site directory to :data:`sys.path`. +diff --git a/Doc/using/ios.rst b/Doc/using/ios.rst +index aa43f75ec35..dff694941d0 100644 +--- a/Doc/using/ios.rst ++++ b/Doc/using/ios.rst +@@ -296,8 +296,6 @@ + * Buffered stdio (:c:member:`PyConfig.buffered_stdio`) is *disabled*; + * Writing bytecode (:c:member:`PyConfig.write_bytecode`) is *disabled*; + * Signal handlers (:c:member:`PyConfig.install_signal_handlers`) are *enabled*; +- * System logging (:c:member:`PyConfig.use_system_logger`) is *enabled* +- (optional, but strongly recommended); + * ``PYTHONHOME`` for the interpreter is configured to point at the + ``python`` subfolder of your app's bundle; and + * The ``PYTHONPATH`` for the interpreter includes: +diff --git a/Include/cpython/initconfig.h b/Include/cpython/initconfig.h +index 20f5c9ad9bb..5da5ef9e543 100644 +--- a/Include/cpython/initconfig.h ++++ b/Include/cpython/initconfig.h +@@ -179,9 +179,6 @@ + int use_frozen_modules; + int safe_path; + int int_max_str_digits; +-#ifdef __APPLE__ +- int use_system_logger; +-#endif + + int cpu_count; + #ifdef Py_GIL_DISABLED diff --git a/Lib/platform.py b/Lib/platform.py index 8895177e326..eab586011ed 100755 --- a/Lib/platform.py @@ -131,6 +180,63 @@ index 7bcb737ff2c..9cac5d7d807 100644 else: import _osx_support osname, release, machine = _osx_support.get_platform_osx( +diff --git a/Lib/test/test__colorize.py b/Lib/test/test__colorize.py +index 056a5306ced..42ee7b50a2a 100644 +--- a/Lib/test/test__colorize.py ++++ b/Lib/test/test__colorize.py +@@ -10,7 +10,7 @@ + @contextlib.contextmanager + def clear_env(): + with EnvironmentVarGuard() as mock_env: +- for var in "FORCE_COLOR", "NO_COLOR", "PYTHON_COLORS": ++ for var in "FORCE_COLOR", "NO_COLOR", "PYTHON_COLORS", "TERM": + mock_env.unset(var) + yield mock_env + +diff --git a/Lib/test/test_apple.py b/Lib/test/test_apple.py +index ab5296afad1..f14db75e2f2 100644 +--- a/Lib/test/test_apple.py ++++ b/Lib/test/test_apple.py +@@ -1,10 +1,10 @@ + import unittest + from _apple_support import SystemLog +-from test.support import is_apple ++from test.support import is_apple_mobile + from unittest.mock import Mock, call + +-if not is_apple: +- raise unittest.SkipTest("Apple-specific") ++if not is_apple_mobile: ++ raise unittest.SkipTest("iOS-specific") + + + # Test redirection of stdout and stderr to the Apple system log. +diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py +index ed459794952..a354f856c80 100644 +--- a/Lib/test/test_embed.py ++++ b/Lib/test/test_embed.py +@@ -627,8 +627,6 @@ + CONFIG_COMPAT.update({ + 'legacy_windows_stdio': 0, + }) +- if support.is_apple: +- CONFIG_COMPAT['use_system_logger'] = False + + CONFIG_PYTHON = dict(CONFIG_COMPAT, + _config_init=API_PYTHON, +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 46a37ded970..7636c6d9823 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -2060,7 +2060,7 @@ + # a full Xcode install that has an iPhone SE (3rd edition) simulator available. + # This must be run *after* a `make install` has completed the build. The + # `--with-framework-name` argument *cannot* be used when configuring the build. +-XCFOLDER:=iOSTestbed.$(MULTIARCH).$(shell date +%s) ++XCFOLDER:=iOSTestbed.$(MULTIARCH).$(shell date +%s).$$PPID + .PHONY: testios + testios: + @if test "$(MACHDEP)" != "ios"; then \ diff --git a/Misc/platform_triplet.c b/Misc/platform_triplet.c index ec0857a4a99..2350e9dc821 100644 --- a/Misc/platform_triplet.c @@ -162,6 +268,134 @@ index ec0857a4a99..2350e9dc821 100644 // Older macOS SDKs do not define TARGET_OS_OSX # elif !defined(TARGET_OS_OSX) || TARGET_OS_OSX PLATFORM_TRIPLET=darwin +diff --git a/Python/initconfig.c b/Python/initconfig.c +index 5746416c826..201f457bb09 100644 +--- a/Python/initconfig.c ++++ b/Python/initconfig.c +@@ -129,9 +129,6 @@ + #ifdef Py_DEBUG + SPEC(run_presite, WSTR_OPT), + #endif +-#ifdef __APPLE__ +- SPEC(use_system_logger, BOOL), +-#endif + + {NULL, 0, 0}, + }; +@@ -748,9 +745,6 @@ + assert(config->cpu_count != 0); + // config->use_frozen_modules is initialized later + // by _PyConfig_InitImportConfig(). +-#ifdef __APPLE__ +- assert(config->use_system_logger >= 0); +-#endif + #ifdef Py_STATS + assert(config->_pystats >= 0); + #endif +@@ -853,9 +847,6 @@ + config->_is_python_build = 0; + config->code_debug_ranges = 1; + config->cpu_count = -1; +-#ifdef __APPLE__ +- config->use_system_logger = 0; +-#endif + #ifdef Py_GIL_DISABLED + config->enable_gil = _PyConfig_GIL_DEFAULT; + #endif +@@ -884,9 +875,6 @@ + #ifdef MS_WINDOWS + config->legacy_windows_stdio = 0; + #endif +-#ifdef __APPLE__ +- config->use_system_logger = 0; +-#endif + } + + +@@ -922,9 +910,6 @@ + #ifdef MS_WINDOWS + config->legacy_windows_stdio = 0; + #endif +-#ifdef __APPLE__ +- config->use_system_logger = 0; +-#endif + } + + +diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c +index ba835ef4c84..f31e3267f52 100644 +--- a/Python/pylifecycle.c ++++ b/Python/pylifecycle.c +@@ -47,20 +47,15 @@ + # include + # include + // The os_log unified logging APIs were introduced in macOS 10.12, iOS 10.0, +-// tvOS 10.0, and watchOS 3.0; ++// tvOS 10.0, and watchOS 3.0; we enable the use of the system logger ++// automatically on non-macOS platforms. + # if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE +-# define HAS_APPLE_SYSTEM_LOG 1 +-# elif defined(TARGET_OS_OSX) && TARGET_OS_OSX +-# if defined(MAC_OS_X_VERSION_10_12) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12 +-# define HAS_APPLE_SYSTEM_LOG 1 +-# else +-# define HAS_APPLE_SYSTEM_LOG 0 +-# endif ++# define USE_APPLE_SYSTEM_LOG 1 + # else +-# define HAS_APPLE_SYSTEM_LOG 0 ++# define USE_APPLE_SYSTEM_LOG 0 + # endif + +-# if HAS_APPLE_SYSTEM_LOG ++# if USE_APPLE_SYSTEM_LOG + # include + # endif + #endif +@@ -92,7 +87,7 @@ + #ifdef __ANDROID__ + static PyStatus init_android_streams(PyThreadState *tstate); + #endif +-#if defined(__APPLE__) && HAS_APPLE_SYSTEM_LOG ++#if defined(__APPLE__) && USE_APPLE_SYSTEM_LOG + static PyStatus init_apple_streams(PyThreadState *tstate); + #endif + static void wait_for_thread_shutdown(PyThreadState *tstate); +@@ -1280,12 +1275,10 @@ + return status; + } + #endif +-#if defined(__APPLE__) && HAS_APPLE_SYSTEM_LOG +- if (config->use_system_logger) { +- status = init_apple_streams(tstate); +- if (_PyStatus_EXCEPTION(status)) { +- return status; +- } ++#if defined(__APPLE__) && USE_APPLE_SYSTEM_LOG ++ status = init_apple_streams(tstate); ++ if (_PyStatus_EXCEPTION(status)) { ++ return status; + } + #endif + +@@ -2957,7 +2950,7 @@ + + #endif // __ANDROID__ + +-#if defined(__APPLE__) && HAS_APPLE_SYSTEM_LOG ++#if defined(__APPLE__) && USE_APPLE_SYSTEM_LOG + + static PyObject * + apple_log_write_impl(PyObject *self, PyObject *args) +@@ -3018,7 +3011,7 @@ + return status; + } + +-#endif // __APPLE__ && HAS_APPLE_SYSTEM_LOG ++#endif // __APPLE__ && USE_APPLE_SYSTEM_LOG + + + static void diff --git a/configure b/configure index 1cd1f690f7b..34922ae651e 100755 --- a/configure @@ -1270,10 +1504,72 @@ index c3e261ecd9e..26ef7a95de4 100644 iPhoneOS diff --git a/iOS/testbed/__main__.py b/iOS/testbed/__main__.py -index b4499f5ac17..d12a5ab065b 100644 +index b4499f5ac17..b436c9af99d 100644 --- a/iOS/testbed/__main__.py +++ b/iOS/testbed/__main__.py -@@ -82,19 +82,29 @@ +@@ -1,11 +1,14 @@ + import argparse + import asyncio ++import fcntl + import json ++import os + import plistlib + import re + import shutil + import subprocess + import sys ++import tempfile + from contextlib import asynccontextmanager + from datetime import datetime + from pathlib import Path +@@ -36,6 +39,46 @@ + pass + + ++class SimulatorLock: ++ # An fcntl-based filesystem lock that can be used to ensure that ++ def __init__(self, timeout): ++ self.filename = Path(tempfile.gettempdir()) / "python-ios-testbed" ++ self.timeout = timeout ++ ++ self.fd = None ++ ++ async def acquire(self): ++ # Ensure the lockfile exists ++ self.filename.touch(exist_ok=True) ++ ++ # Try `timeout` times to acquire the lock file, with a 1 second pause ++ # between each attempt. Report status every 10 seconds. ++ for i in range(0, self.timeout): ++ try: ++ fd = os.open(self.filename, os.O_RDWR | os.O_TRUNC, 0o644) ++ fcntl.flock(fd, fcntl.LOCK_EX | fcntl.LOCK_NB) ++ except OSError: ++ os.close(fd) ++ if i % 10 == 0: ++ print("... waiting", flush=True) ++ await asyncio.sleep(1) ++ else: ++ self.fd = fd ++ return ++ ++ # If we reach the end of the loop, we've exceeded the allowed number of ++ # attempts. ++ raise ValueError("Unable to obtain lock on iOS simulator creation") ++ ++ def release(self): ++ # If a lock is held, release it. ++ if self.fd is not None: ++ # Release the lock. ++ fcntl.flock(self.fd, fcntl.LOCK_UN) ++ os.close(self.fd) ++ self.fd = None ++ ++ + # All subprocesses are executed through this context manager so that no matter + # what happens, they can always be cancelled from another task, and they will + # always be cleaned up on exit. +@@ -82,22 +125,32 @@ # Return a list of UDIDs associated with booted simulators async def list_devices(): @@ -1315,8 +1611,41 @@ index b4499f5ac17..d12a5ab065b 100644 + raise - async def find_device(initial_devices): -@@ -230,33 +240,69 @@ +-async def find_device(initial_devices): ++async def find_device(initial_devices, lock): + while True: + new_devices = set(await list_devices()).difference(initial_devices) + if len(new_devices) == 0: +@@ -105,15 +158,16 @@ + elif len(new_devices) == 1: + udid = new_devices.pop() + print(f"{datetime.now():%Y-%m-%d %H:%M:%S}: New test simulator detected") +- print(f"UDID: {udid}") ++ print(f"UDID: {udid}", flush=True) ++ lock.release() + return udid + else: + exit(f"Found more than one new device: {new_devices}") + + +-async def log_stream_task(initial_devices): ++async def log_stream_task(initial_devices, lock): + # Wait up to 5 minutes for the build to complete and the simulator to boot. +- udid = await asyncio.wait_for(find_device(initial_devices), 5 * 60) ++ udid = await asyncio.wait_for(find_device(initial_devices, lock), 5 * 60) + + # Stream the iOS device's logs, filtering out messages that come from the + # XCTest test suite (catching NSLog messages from the test method), or +@@ -161,7 +215,7 @@ + + async def xcode_test(location, simulator, verbose): + # Run the test suite on the named simulator +- print("Starting xcodebuild...") ++ print("Starting xcodebuild...", flush=True) + args = [ + "xcodebuild", + "test", +@@ -230,33 +284,69 @@ shutil.copytree(source, target, symlinks=True) print(" done") @@ -1393,7 +1722,43 @@ index b4499f5ac17..d12a5ab065b 100644 for app_src in apps: print(f" Installing app {app_src.name!r}...", end="", flush=True) -@@ -372,8 +418,8 @@ +@@ -285,7 +375,17 @@ + location = Path(__file__).parent + print("Updating plist...", end="", flush=True) + update_plist(location, args) +- print(" done.") ++ print(" done.", flush=True) ++ ++ # We need to get an exclusive lock on simulator creation, to avoid issues ++ # with multiple simulators starting and being unable to tell which ++ # simulator is due to which testbed instance. See ++ # https://github.com/python/cpython/issues/130294 for details. Wait up to ++ # 10 minutes for a simulator to boot. ++ print("Obtaining lock on simulator creation...", flush=True) ++ simulator_lock = SimulatorLock(timeout=10*60) ++ await simulator_lock.acquire() ++ print("Simulator lock acquired.", flush=True) + + # Get the list of devices that are booted at the start of the test run. + # The simulator started by the test suite will be detected as the new +@@ -294,13 +394,15 @@ + + try: + async with asyncio.TaskGroup() as tg: +- tg.create_task(log_stream_task(initial_devices)) ++ tg.create_task(log_stream_task(initial_devices, simulator_lock)) + tg.create_task(xcode_test(location, simulator=simulator, verbose=verbose)) + except* MySystemExit as e: + raise SystemExit(*e.exceptions[0].args) from None + except* subprocess.CalledProcessError as e: + # Extract it from the ExceptionGroup so it can be handled by `main`. + raise e.exceptions[0] ++ finally: ++ simulator_lock.release() + + + def main(): +@@ -372,8 +474,8 @@ if context.subcommand == "clone": clone_testbed( @@ -1404,6 +1769,28 @@ index b4499f5ac17..d12a5ab065b 100644 framework=Path(context.framework).resolve() if context.framework else None, apps=[Path(app) for app in context.apps], ) +diff --git a/iOS/testbed/iOSTestbedTests/iOSTestbedTests.m b/iOS/testbed/iOSTestbedTests/iOSTestbedTests.m +index 6db38253396..d417b4cd63e 100644 +--- a/iOS/testbed/iOSTestbedTests/iOSTestbedTests.m ++++ b/iOS/testbed/iOSTestbedTests/iOSTestbedTests.m +@@ -28,7 +28,7 @@ + // Xcode log can't display color. Stdout will report that it is *not* a + // TTY. + setenv("NO_COLOR", "1", true); +- setenv("PY_COLORS", "0", true); ++ setenv("PYTHON_COLORS", "0", true); + + // Arguments to pass into the test suite runner. + // argv[0] must identify the process; any subsequent arg +@@ -53,8 +53,6 @@ + // Enforce UTF-8 encoding for stderr, stdout, file-system encoding and locale. + // See https://docs.python.org/3/library/os.html#python-utf-8-mode. + preconfig.utf8_mode = 1; +- // Use the system logger for stdout/err +- config.use_system_logger = 1; + // Don't buffer stdio. We want output to appears in the log immediately + config.buffered_stdio = 0; + // Don't write bytecode; we can't modify the app bundle --- /dev/null +++ b/tvOS/README.rst @@ -0,0 +1,108 @@ diff --git a/patch/Python/module.modulemap b/patch/Python/module.modulemap deleted file mode 100644 index 12503f1e..00000000 --- a/patch/Python/module.modulemap +++ /dev/null @@ -1,157 +0,0 @@ -module Python { - umbrella header "Python.h" - export * - link "Python" - - exclude header "datetime.h" - exclude header "dynamic_annotations.h" - exclude header "errcode.h" - exclude header "frameobject.h" - exclude header "marshal.h" - exclude header "opcode_ids.h" - exclude header "opcode.h" - exclude header "osdefs.h" - exclude header "py_curses.h" - exclude header "pyconfig-arm32_64.h" - exclude header "pyconfig-arm64.h" - exclude header "pyconfig-x86_64.h" - exclude header "pydtrace.h" - exclude header "pyexpat.h" - exclude header "structmember.h" - - exclude header "cpython/frameobject.h" - exclude header "cpython/pthread_stubs.h" - exclude header "cpython/pyatomic_msc.h" - exclude header "cpython/pyatomic_std.h" - exclude header "cpython/pystats.h" - - exclude header "internal/mimalloc/mimalloc.h" - exclude header "internal/mimalloc/mimalloc/atomic.h" - exclude header "internal/mimalloc/mimalloc/internal.h" - exclude header "internal/mimalloc/mimalloc/prim.h" - exclude header "internal/mimalloc/mimalloc/track.h" - exclude header "internal/mimalloc/mimalloc/types.h" - - exclude header "internal/pycore_abstract.h" - exclude header "internal/pycore_asdl.h" - exclude header "internal/pycore_ast_state.h" - exclude header "internal/pycore_ast.h" - exclude header "internal/pycore_atexit.h" - exclude header "internal/pycore_backoff.h" - exclude header "internal/pycore_bitutils.h" - exclude header "internal/pycore_blocks_output_buffer.h" - exclude header "internal/pycore_brc.h" - exclude header "internal/pycore_bytes_methods.h" - exclude header "internal/pycore_bytesobject.h" - exclude header "internal/pycore_call.h" - exclude header "internal/pycore_capsule.h" - exclude header "internal/pycore_cell.h" - exclude header "internal/pycore_ceval_state.h" - exclude header "internal/pycore_ceval.h" - exclude header "internal/pycore_code.h" - exclude header "internal/pycore_codecs.h" - exclude header "internal/pycore_compile.h" - exclude header "internal/pycore_complexobject.h" - exclude header "internal/pycore_condvar.h" - exclude header "internal/pycore_context.h" - exclude header "internal/pycore_critical_section.h" - exclude header "internal/pycore_crossinterp.h" - exclude header "internal/pycore_descrobject.h" - exclude header "internal/pycore_dict_state.h" - exclude header "internal/pycore_dict.h" - exclude header "internal/pycore_dtoa.h" - exclude header "internal/pycore_emscripten_signal.h" - exclude header "internal/pycore_emscripten_trampoline.h" - exclude header "internal/pycore_exceptions.h" - exclude header "internal/pycore_faulthandler.h" - exclude header "internal/pycore_fileutils_windows.h" - exclude header "internal/pycore_fileutils.h" - exclude header "internal/pycore_floatobject.h" - exclude header "internal/pycore_flowgraph.h" - exclude header "internal/pycore_format.h" - exclude header "internal/pycore_frame.h" - exclude header "internal/pycore_freelist.h" - exclude header "internal/pycore_function.h" - exclude header "internal/pycore_gc.h" - exclude header "internal/pycore_genobject.h" - exclude header "internal/pycore_getopt.h" - exclude header "internal/pycore_gil.h" - exclude header "internal/pycore_global_objects_fini_generated.h" - exclude header "internal/pycore_global_objects.h" - exclude header "internal/pycore_global_strings.h" - exclude header "internal/pycore_hamt.h" - exclude header "internal/pycore_hashtable.h" - exclude header "internal/pycore_identifier.h" - exclude header "internal/pycore_import.h" - exclude header "internal/pycore_importdl.h" - exclude header "internal/pycore_initconfig.h" - exclude header "internal/pycore_instruction_sequence.h" - exclude header "internal/pycore_instruments.h" - exclude header "internal/pycore_interp.h" - exclude header "internal/pycore_intrinsics.h" - exclude header "internal/pycore_jit.h" - exclude header "internal/pycore_list.h" - exclude header "internal/pycore_llist.h" - exclude header "internal/pycore_lock.h" - exclude header "internal/pycore_long.h" - exclude header "internal/pycore_memoryobject.h" - exclude header "internal/pycore_mimalloc.h" - exclude header "internal/pycore_modsupport.h" - exclude header "internal/pycore_moduleobject.h" - exclude header "internal/pycore_namespace.h" - exclude header "internal/pycore_object_alloc.h" - exclude header "internal/pycore_object_stack.h" - exclude header "internal/pycore_object_state.h" - exclude header "internal/pycore_object.h" - exclude header "internal/pycore_obmalloc_init.h" - exclude header "internal/pycore_obmalloc.h" - exclude header "internal/pycore_opcode_metadata.h" - exclude header "internal/pycore_opcode_utils.h" - exclude header "internal/pycore_optimizer.h" - exclude header "internal/pycore_parking_lot.h" - exclude header "internal/pycore_parser.h" - exclude header "internal/pycore_pathconfig.h" - exclude header "internal/pycore_pyarena.h" - exclude header "internal/pycore_pyatomic_ft_wrappers.h" - exclude header "internal/pycore_pybuffer.h" - exclude header "internal/pycore_pyerrors.h" - exclude header "internal/pycore_pyhash.h" - exclude header "internal/pycore_pylifecycle.h" - exclude header "internal/pycore_pymath.h" - exclude header "internal/pycore_pymem_init.h" - exclude header "internal/pycore_pymem.h" - exclude header "internal/pycore_pystate.h" - exclude header "internal/pycore_pystats.h" - exclude header "internal/pycore_pythonrun.h" - exclude header "internal/pycore_pythread.h" - exclude header "internal/pycore_qsbr.h" - exclude header "internal/pycore_range.h" - exclude header "internal/pycore_runtime_init_generated.h" - exclude header "internal/pycore_runtime_init.h" - exclude header "internal/pycore_runtime.h" - exclude header "internal/pycore_semaphore.h" - exclude header "internal/pycore_setobject.h" - exclude header "internal/pycore_signal.h" - exclude header "internal/pycore_sliceobject.h" - exclude header "internal/pycore_stackref.h" - exclude header "internal/pycore_strhex.h" - exclude header "internal/pycore_structseq.h" - exclude header "internal/pycore_symtable.h" - exclude header "internal/pycore_sysmodule.h" - exclude header "internal/pycore_time.h" - exclude header "internal/pycore_token.h" - exclude header "internal/pycore_traceback.h" - exclude header "internal/pycore_tracemalloc.h" - exclude header "internal/pycore_tstate.h" - exclude header "internal/pycore_tuple.h" - exclude header "internal/pycore_typeobject.h" - exclude header "internal/pycore_typevarobject.h" - exclude header "internal/pycore_ucnhash.h" - exclude header "internal/pycore_unicodeobject_generated.h" - exclude header "internal/pycore_unicodeobject.h" - exclude header "internal/pycore_unionobject.h" - exclude header "internal/pycore_uop_ids.h" - exclude header "internal/pycore_uop_metadata.h" - exclude header "internal/pycore_warnings.h" - exclude header "internal/pycore_weakref.h" -} diff --git a/patch/Python/module.modulemap.prefix b/patch/Python/module.modulemap.prefix new file mode 100644 index 00000000..e3b3aafb --- /dev/null +++ b/patch/Python/module.modulemap.prefix @@ -0,0 +1,20 @@ +module Python { + umbrella header "Python.h" + export * + link "Python" + + exclude header "datetime.h" + exclude header "dynamic_annotations.h" + exclude header "errcode.h" + exclude header "frameobject.h" + exclude header "marshal.h" + exclude header "opcode_ids.h" + exclude header "opcode.h" + exclude header "osdefs.h" + exclude header "py_curses.h" + exclude header "pyconfig-arm32_64.h" + exclude header "pyconfig-arm64.h" + exclude header "pyconfig-x86_64.h" + exclude header "pydtrace.h" + exclude header "pyexpat.h" + exclude header "structmember.h"