From 2a57b05a700ab597201ecee1cad238da2a29274c Mon Sep 17 00:00:00 2001 From: Ferdinando Ametrano Date: Sun, 15 Nov 2026 09:43:22 +0100 Subject: [PATCH 1/2] gh-162034: Quote the utils.sh path in the Apple testbed build phase The "Process Python libraries" build phase sources utils.sh through an unquoted $PROJECT_DIR. The build fails when the project path contains a space, and a *, ? or [ in the path is glob-expanded, so the phase can source another directory's utils.sh. Quote the path in the four testbed projects. --- .../next/Tests/2026-11-15-09-43-15.gh-issue-162034.egx5QV.rst | 2 ++ Platforms/Apple/testbed/iOSTestbed.xcodeproj/project.pbxproj | 2 +- Platforms/Apple/testbed/tvOSTestbed.xcodeproj/project.pbxproj | 2 +- .../Apple/testbed/visionOSTestbed.xcodeproj/project.pbxproj | 2 +- .../Apple/testbed/watchOSTestbed.xcodeproj/project.pbxproj | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 Misc/NEWS.d/next/Tests/2026-11-15-09-43-15.gh-issue-162034.egx5QV.rst diff --git a/Misc/NEWS.d/next/Tests/2026-11-15-09-43-15.gh-issue-162034.egx5QV.rst b/Misc/NEWS.d/next/Tests/2026-11-15-09-43-15.gh-issue-162034.egx5QV.rst new file mode 100644 index 000000000000000..1b7d2c4ad5f27c6 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2026-11-15-09-43-15.gh-issue-162034.egx5QV.rst @@ -0,0 +1,2 @@ +The Apple testbed projects now build when the path of the project contains a +space. diff --git a/Platforms/Apple/testbed/iOSTestbed.xcodeproj/project.pbxproj b/Platforms/Apple/testbed/iOSTestbed.xcodeproj/project.pbxproj index 6ac40a325045bd6..b2131822424044e 100644 --- a/Platforms/Apple/testbed/iOSTestbed.xcodeproj/project.pbxproj +++ b/Platforms/Apple/testbed/iOSTestbed.xcodeproj/project.pbxproj @@ -250,7 +250,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "set -e\nsource $PROJECT_DIR/Python{{abiflags}}.xcframework/build/utils.sh\ninstall_python Python{{abiflags}}.xcframework app app_packages\n"; + shellScript = "set -e\nsource \"$PROJECT_DIR/Python{{abiflags}}.xcframework/build/utils.sh\"\ninstall_python Python{{abiflags}}.xcframework app app_packages\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ diff --git a/Platforms/Apple/testbed/tvOSTestbed.xcodeproj/project.pbxproj b/Platforms/Apple/testbed/tvOSTestbed.xcodeproj/project.pbxproj index e14489ad0770a0f..941f6a266bc42a0 100644 --- a/Platforms/Apple/testbed/tvOSTestbed.xcodeproj/project.pbxproj +++ b/Platforms/Apple/testbed/tvOSTestbed.xcodeproj/project.pbxproj @@ -236,7 +236,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "set -e\n\nsource $PROJECT_DIR/Python{{abiflags}}.xcframework/build/utils.sh\n\ninstall_python Python{{abiflags}}.xcframework app app_packages\n"; + shellScript = "set -e\n\nsource \"$PROJECT_DIR/Python{{abiflags}}.xcframework/build/utils.sh\"\n\ninstall_python Python{{abiflags}}.xcframework app app_packages\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ diff --git a/Platforms/Apple/testbed/visionOSTestbed.xcodeproj/project.pbxproj b/Platforms/Apple/testbed/visionOSTestbed.xcodeproj/project.pbxproj index ee19e22d533cc83..53ddec1b6f29e40 100644 --- a/Platforms/Apple/testbed/visionOSTestbed.xcodeproj/project.pbxproj +++ b/Platforms/Apple/testbed/visionOSTestbed.xcodeproj/project.pbxproj @@ -250,7 +250,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "set -e\n\nsource $PROJECT_DIR/Python{{abiflags}}.xcframework/build/utils.sh\n\ninstall_python Python{{abiflags}}.xcframework app app_packages\n"; + shellScript = "set -e\n\nsource \"$PROJECT_DIR/Python{{abiflags}}.xcframework/build/utils.sh\"\n\ninstall_python Python{{abiflags}}.xcframework app app_packages\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ diff --git a/Platforms/Apple/testbed/watchOSTestbed.xcodeproj/project.pbxproj b/Platforms/Apple/testbed/watchOSTestbed.xcodeproj/project.pbxproj index d5220c60e65c441..02b98a685cea6c0 100644 --- a/Platforms/Apple/testbed/watchOSTestbed.xcodeproj/project.pbxproj +++ b/Platforms/Apple/testbed/watchOSTestbed.xcodeproj/project.pbxproj @@ -236,7 +236,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "set -e\n\nsource $PROJECT_DIR/Python{{abiflags}}.xcframework/build/utils.sh\n\ninstall_python Python{{abiflags}}.xcframework app app_packages\n"; + shellScript = "set -e\n\nsource \"$PROJECT_DIR/Python{{abiflags}}.xcframework/build/utils.sh\"\n\ninstall_python Python{{abiflags}}.xcframework app app_packages\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ From c9d997733a3bb294d47e89db916791382afe5dc5 Mon Sep 17 00:00:00 2001 From: Ferdinando Ametrano Date: Sun, 15 Nov 2026 10:42:52 +0100 Subject: [PATCH 2/2] gh-162034: Quote and correct the utils.sh path in the iOS docs The build phase example in Doc/using/ios.rst, and the one in the utils.sh header comment, source an unquoted path to build_utils.sh. The helper is named utils.sh. Quote the path and use the right file name. --- Doc/using/ios.rst | 2 +- Platforms/Apple/testbed/Python.xcframework/build/utils.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/using/ios.rst b/Doc/using/ios.rst index d7cf699d5bc3bfb..4dbb6e77459c480 100644 --- a/Doc/using/ios.rst +++ b/Doc/using/ios.rst @@ -226,7 +226,7 @@ To add Python to an iOS Xcode project: .. code-block:: bash set -e - source $PROJECT_DIR/Python.xcframework/build/build_utils.sh + source "$PROJECT_DIR/Python.xcframework/build/utils.sh" install_python Python.xcframework app If you have placed your XCframework somewhere other than the root of your diff --git a/Platforms/Apple/testbed/Python.xcframework/build/utils.sh b/Platforms/Apple/testbed/Python.xcframework/build/utils.sh index bbe3620a1397311..7e2cda78be57690 100755 --- a/Platforms/Apple/testbed/Python.xcframework/build/utils.sh +++ b/Platforms/Apple/testbed/Python.xcframework/build/utils.sh @@ -14,7 +14,7 @@ # * There is an `app_packages` folder that contains installed Python packages. # ----- # set -e -# source $PROJECT_DIR/Python.xcframework/build/build_utils.sh +# source "$PROJECT_DIR/Python.xcframework/build/utils.sh" # install_python Python.xcframework app app_packages # -----