From 1d77d6327f59168eae0301e631959d51b072851a Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Mon, 28 Oct 2024 10:11:10 +0800 Subject: [PATCH] Force loading the native sysconfigdata in distutils.sysconfig --- patch/Python/sitecustomize.iOS.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/patch/Python/sitecustomize.iOS.py b/patch/Python/sitecustomize.iOS.py index ccc291f..51403cc 100644 --- a/patch/Python/sitecustomize.iOS.py +++ b/patch/Python/sitecustomize.iOS.py @@ -101,6 +101,9 @@ def link(*args, **kwargs): for tool in ["ar", "as", "cc", "cxx", "ld"]: os.environ[tool.upper()] = DISABLED_COMPILER_ERROR.replace(" ", "_") +# Although we're building for {{os}}, we need to tell distutils.sysconfig +# to load the *native* sysconfigdata. +os.environ["_PYTHON_SYSCONFIGDATA_NAME"] = "_sysconfigdata__darwin_darwin" # Call the next sitecustomize script if there is one # (https://nedbatchelder.com/blog/201001/running_code_at_python_startup.html).