https://github.com/python/cpython/commit/5684b3a04c6985e48b9a3d5394e3b7878901d6aa
commit: 5684b3a04c6985e48b9a3d5394e3b7878901d6aa
branch: main
author: Russell Keith-Magee <[email protected]>
committer: freakboy3742 <[email protected]>
date: 2026-03-27T09:56:49+08:00
summary:

gh-146498: Ensure binary content is correctly processed in multi-arch iOS 
XCframeworks (#146499)

Ensure that multi-arch libpython dylibs aren't copied into the app, and the
standard lib is always found for framework post-processing.

files:
A Misc/NEWS.d/next/Build/2026-03-27-06-55-10.gh-issue-146498.uOiCab.rst
M Apple/testbed/Python.xcframework/build/utils.sh

diff --git a/Apple/testbed/Python.xcframework/build/utils.sh 
b/Apple/testbed/Python.xcframework/build/utils.sh
index e7155d8b30e213..e54471f68b7cb2 100755
--- a/Apple/testbed/Python.xcframework/build/utils.sh
+++ b/Apple/testbed/Python.xcframework/build/utils.sh
@@ -42,11 +42,11 @@ install_stdlib() {
     # If the XCframework has a shared lib folder, then it's a full framework.
     # Copy both the common and slice-specific part of the lib directory.
     # Otherwise, it's a single-arch framework; use the "full" lib folder.
+    # Don't include any libpython symlink; that can't be included at runtime
     if [ -d "$PROJECT_DIR/$PYTHON_XCFRAMEWORK_PATH/lib" ]; then
-        rsync -au --delete "$PROJECT_DIR/$PYTHON_XCFRAMEWORK_PATH/lib/" 
"$CODESIGNING_FOLDER_PATH/python/lib/"
-        rsync -au 
"$PROJECT_DIR/$PYTHON_XCFRAMEWORK_PATH/$SLICE_FOLDER/lib-$ARCHS/" 
"$CODESIGNING_FOLDER_PATH/python/lib/"
+        rsync -au --delete "$PROJECT_DIR/$PYTHON_XCFRAMEWORK_PATH/lib/" 
"$CODESIGNING_FOLDER_PATH/python/lib/" --exclude 'libpython*.dylib'
+        rsync -au 
"$PROJECT_DIR/$PYTHON_XCFRAMEWORK_PATH/$SLICE_FOLDER/lib-$ARCHS/" 
"$CODESIGNING_FOLDER_PATH/python/lib/" --exclude 'libpython*.dylib'
     else
-        # A single-arch framework will have a libpython symlink; that can't be 
included at runtime
         rsync -au --delete 
"$PROJECT_DIR/$PYTHON_XCFRAMEWORK_PATH/$SLICE_FOLDER/lib/" 
"$CODESIGNING_FOLDER_PATH/python/lib/" --exclude 'libpython*.dylib'
     fi
 }
@@ -140,7 +140,7 @@ install_python() {
     shift
 
     install_stdlib $PYTHON_XCFRAMEWORK_PATH
-    PYTHON_VER=$(ls -1 "$CODESIGNING_FOLDER_PATH/python/lib")
+    PYTHON_VER=$(ls -1 "$CODESIGNING_FOLDER_PATH/python/lib" | grep -E 
"^python3\.\d+$")
     echo "Install Python $PYTHON_VER standard library extension modules..."
     process_dylibs $PYTHON_XCFRAMEWORK_PATH python/lib/$PYTHON_VER/lib-dynload
 
diff --git 
a/Misc/NEWS.d/next/Build/2026-03-27-06-55-10.gh-issue-146498.uOiCab.rst 
b/Misc/NEWS.d/next/Build/2026-03-27-06-55-10.gh-issue-146498.uOiCab.rst
new file mode 100644
index 00000000000000..35deccd89761a3
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2026-03-27-06-55-10.gh-issue-146498.uOiCab.rst
@@ -0,0 +1,3 @@
+The iOS XCframework build script now ensures libpython isn't included in
+installed app content, and is more robust in identifying standard library
+binary content that requires processing.

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to