]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-146498: Ensure binary content is correctly processed in multi-arch iOS XCframework...
authorRussell Keith-Magee <russell@keith-magee.com>
Fri, 27 Mar 2026 01:56:49 +0000 (09:56 +0800)
committerGitHub <noreply@github.com>
Fri, 27 Mar 2026 01:56:49 +0000 (09:56 +0800)
Ensure that multi-arch libpython dylibs aren't copied into the app, and the
standard lib is always found for framework post-processing.

Apple/testbed/Python.xcframework/build/utils.sh
Misc/NEWS.d/next/Build/2026-03-27-06-55-10.gh-issue-146498.uOiCab.rst [new file with mode: 0644]

index e7155d8b30e213ab56c7d4bf2bfda8ba42409e6b..e54471f68b7cb2ced6a780f3f22d087bfaa47696 100755 (executable)
@@ -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 (file)
index 0000000..35deccd
--- /dev/null
@@ -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.