From ee677eb217434d3aa1beda5d03c6093a6e8223a2 Mon Sep 17 00:00:00 2001 From: Ferdinando Ametrano Date: Tue, 17 Nov 2026 00:40:02 +0100 Subject: [PATCH] gh-162034: Quote paths in the Apple testbed's utils.sh install_python left several paths unquoted. A space in a package path or in the XCframework path split it, so modules were left unconverted or the build failed. Brackets in the build path broke the prefix strip, so all modules went into one misnamed framework. read without -r dropped a backslash from the build path, so mv failed. Quote these paths and the variables used as patterns in ${...}, and use read -r. --- ...026-11-17-00-39-51.gh-issue-162034.FmiuNi.rst | 2 ++ .../testbed/Python.xcframework/build/utils.sh | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 Misc/NEWS.d/next/Tests/2026-11-17-00-39-51.gh-issue-162034.FmiuNi.rst diff --git a/Misc/NEWS.d/next/Tests/2026-11-17-00-39-51.gh-issue-162034.FmiuNi.rst b/Misc/NEWS.d/next/Tests/2026-11-17-00-39-51.gh-issue-162034.FmiuNi.rst new file mode 100644 index 00000000000000..1764fa2a458e59 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2026-11-17-00-39-51.gh-issue-162034.FmiuNi.rst @@ -0,0 +1,2 @@ +Fix the Apple testbed's extension module processing for an XCframework or +package path with a space, or a build path with brackets or a backslash. diff --git a/Platforms/Apple/testbed/Python.xcframework/build/utils.sh b/Platforms/Apple/testbed/Python.xcframework/build/utils.sh index 7e2cda78be5769..53801215377fd8 100755 --- a/Platforms/Apple/testbed/Python.xcframework/build/utils.sh +++ b/Platforms/Apple/testbed/Python.xcframework/build/utils.sh @@ -101,9 +101,9 @@ install_dylib () { MODULE_PATH=$(dirname "$FULL_EXT") MODULE_NAME=$(echo $EXT | cut -d "." -f 1) # The location of the extension file, relative to the bundle - RELATIVE_EXT=${FULL_EXT#$CODESIGNING_FOLDER_PATH/} + RELATIVE_EXT=${FULL_EXT#"$CODESIGNING_FOLDER_PATH"/} # The path to the extension file, relative to the install base - PYTHON_EXT=${RELATIVE_EXT/$INSTALL_BASE/} + PYTHON_EXT=${RELATIVE_EXT/"$INSTALL_BASE"/} # The full dotted name of the extension module, constructed from the file path. FULL_MODULE_NAME=$(echo $PYTHON_EXT | cut -d "." -f 1 | tr "/" "."); # A bundle identifier; not actually used, but required by Xcode framework packaging @@ -152,8 +152,8 @@ install_dylib () { process_dylibs () { PYTHON_XCFRAMEWORK_PATH=$1 LIB_PATH=$2 - find "$CODESIGNING_FOLDER_PATH/$LIB_PATH" -name "*.so" | while read FULL_EXT; do - install_dylib $PYTHON_XCFRAMEWORK_PATH "$LIB_PATH/" "$FULL_EXT" + find "$CODESIGNING_FOLDER_PATH/$LIB_PATH" -name "*.so" | while read -r FULL_EXT; do + install_dylib "$PYTHON_XCFRAMEWORK_PATH" "$LIB_PATH/" "$FULL_EXT" done } @@ -168,13 +168,13 @@ install_python() { PYTHON_XCFRAMEWORK_PATH=$1 shift - install_stdlib $PYTHON_XCFRAMEWORK_PATH + install_stdlib "$PYTHON_XCFRAMEWORK_PATH" PYTHON_VER=$(ls -1 "$CODESIGNING_FOLDER_PATH/python/lib" | grep -E "^python3\.\d+[a-z]*$") echo "Install Python $PYTHON_VER standard library extension modules..." - process_dylibs $PYTHON_XCFRAMEWORK_PATH python/lib/$PYTHON_VER/lib-dynload + process_dylibs "$PYTHON_XCFRAMEWORK_PATH" python/lib/$PYTHON_VER/lib-dynload - for package_path in $@; do + for package_path in "$@"; do echo "Installing $package_path extension modules ..." - process_dylibs $PYTHON_XCFRAMEWORK_PATH $package_path + process_dylibs "$PYTHON_XCFRAMEWORK_PATH" "$package_path" done }