From 5c908806f0f040018e43d9fbac8478649597ec0d Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Wed, 25 Mar 2026 20:18:55 +0800 Subject: [PATCH 1/4] Migrate the Apple folder to the Platforms directory. --- .github/workflows/build.yml | 2 +- Makefile.pre.in | 12 ++++---- {Apple => Platforms/Apple}/.ruff.toml | 2 +- {Apple => Platforms/Apple}/__main__.py | 20 ++++++------- {Apple => Platforms/Apple}/iOS/README.md | 30 +++++++++---------- .../Apple}/iOS/Resources/Info.plist.in | 0 .../iOS/Resources/bin/arm64-apple-ios-ar | 0 .../iOS/Resources/bin/arm64-apple-ios-clang | 0 .../iOS/Resources/bin/arm64-apple-ios-clang++ | 0 .../iOS/Resources/bin/arm64-apple-ios-cpp | 0 .../bin/arm64-apple-ios-simulator-ar | 0 .../bin/arm64-apple-ios-simulator-clang | 0 .../bin/arm64-apple-ios-simulator-clang++ | 0 .../bin/arm64-apple-ios-simulator-cpp | 0 .../bin/arm64-apple-ios-simulator-strip | 0 .../iOS/Resources/bin/arm64-apple-ios-strip | 0 .../bin/x86_64-apple-ios-simulator-ar | 0 .../bin/x86_64-apple-ios-simulator-clang | 0 .../bin/x86_64-apple-ios-simulator-clang++ | 0 .../bin/x86_64-apple-ios-simulator-cpp | 0 .../bin/x86_64-apple-ios-simulator-strip | 0 .../Apple}/iOS/Resources/pyconfig.h | 0 .../testbed/Python.xcframework/Info.plist | 0 .../build/iOS-dylib-Info-template.plist | 0 .../testbed/Python.xcframework/build/utils.sh | 0 .../Python.xcframework/ios-arm64/README | 0 .../ios-arm64_x86_64-simulator/README | 0 .../Apple}/testbed/Testbed.lldbinit | 0 .../testbed/TestbedTests/TestbedTests.m | 0 .../Apple}/testbed/__main__.py | 0 .../iOSTestbed.xcodeproj/project.pbxproj | 0 .../xcschemes/iOSTestbed.xcscheme | 0 .../Apple}/testbed/iOSTestbed.xctestplan | 0 .../Apple}/testbed/iOSTestbed/AppDelegate.h | 0 .../Apple}/testbed/iOSTestbed/AppDelegate.m | 0 .../AccentColor.colorset/Contents.json | 0 .../AppIcon.appiconset/Contents.json | 0 .../iOSTestbed/Assets.xcassets/Contents.json | 0 .../Base.lproj/LaunchScreen.storyboard | 0 .../Apple}/testbed/iOSTestbed/app/README | 0 .../testbed/iOSTestbed/app_packages/README | 0 .../testbed/iOSTestbed/iOSTestbed-Info.plist | 0 .../Apple}/testbed/iOSTestbed/main.m | 0 configure | 8 ++--- configure.ac | 6 ++-- 45 files changed, 40 insertions(+), 40 deletions(-) rename {Apple => Platforms/Apple}/.ruff.toml (88%) rename {Apple => Platforms/Apple}/__main__.py (98%) rename {Apple => Platforms/Apple}/iOS/README.md (92%) rename {Apple => Platforms/Apple}/iOS/Resources/Info.plist.in (100%) rename {Apple => Platforms/Apple}/iOS/Resources/bin/arm64-apple-ios-ar (100%) rename {Apple => Platforms/Apple}/iOS/Resources/bin/arm64-apple-ios-clang (100%) rename {Apple => Platforms/Apple}/iOS/Resources/bin/arm64-apple-ios-clang++ (100%) rename {Apple => Platforms/Apple}/iOS/Resources/bin/arm64-apple-ios-cpp (100%) rename {Apple => Platforms/Apple}/iOS/Resources/bin/arm64-apple-ios-simulator-ar (100%) rename {Apple => Platforms/Apple}/iOS/Resources/bin/arm64-apple-ios-simulator-clang (100%) rename {Apple => Platforms/Apple}/iOS/Resources/bin/arm64-apple-ios-simulator-clang++ (100%) rename {Apple => Platforms/Apple}/iOS/Resources/bin/arm64-apple-ios-simulator-cpp (100%) rename {Apple => Platforms/Apple}/iOS/Resources/bin/arm64-apple-ios-simulator-strip (100%) rename {Apple => Platforms/Apple}/iOS/Resources/bin/arm64-apple-ios-strip (100%) rename {Apple => Platforms/Apple}/iOS/Resources/bin/x86_64-apple-ios-simulator-ar (100%) rename {Apple => Platforms/Apple}/iOS/Resources/bin/x86_64-apple-ios-simulator-clang (100%) rename {Apple => Platforms/Apple}/iOS/Resources/bin/x86_64-apple-ios-simulator-clang++ (100%) rename {Apple => Platforms/Apple}/iOS/Resources/bin/x86_64-apple-ios-simulator-cpp (100%) rename {Apple => Platforms/Apple}/iOS/Resources/bin/x86_64-apple-ios-simulator-strip (100%) rename {Apple => Platforms/Apple}/iOS/Resources/pyconfig.h (100%) rename {Apple => Platforms/Apple}/testbed/Python.xcframework/Info.plist (100%) rename {Apple => Platforms/Apple}/testbed/Python.xcframework/build/iOS-dylib-Info-template.plist (100%) rename {Apple => Platforms/Apple}/testbed/Python.xcframework/build/utils.sh (100%) rename {Apple => Platforms/Apple}/testbed/Python.xcframework/ios-arm64/README (100%) rename {Apple => Platforms/Apple}/testbed/Python.xcframework/ios-arm64_x86_64-simulator/README (100%) rename {Apple => Platforms/Apple}/testbed/Testbed.lldbinit (100%) rename {Apple => Platforms/Apple}/testbed/TestbedTests/TestbedTests.m (100%) rename {Apple => Platforms/Apple}/testbed/__main__.py (100%) rename {Apple => Platforms/Apple}/testbed/iOSTestbed.xcodeproj/project.pbxproj (100%) rename {Apple => Platforms/Apple}/testbed/iOSTestbed.xcodeproj/xcshareddata/xcschemes/iOSTestbed.xcscheme (100%) rename {Apple => Platforms/Apple}/testbed/iOSTestbed.xctestplan (100%) rename {Apple => Platforms/Apple}/testbed/iOSTestbed/AppDelegate.h (100%) rename {Apple => Platforms/Apple}/testbed/iOSTestbed/AppDelegate.m (100%) rename {Apple => Platforms/Apple}/testbed/iOSTestbed/Assets.xcassets/AccentColor.colorset/Contents.json (100%) rename {Apple => Platforms/Apple}/testbed/iOSTestbed/Assets.xcassets/AppIcon.appiconset/Contents.json (100%) rename {Apple => Platforms/Apple}/testbed/iOSTestbed/Assets.xcassets/Contents.json (100%) rename {Apple => Platforms/Apple}/testbed/iOSTestbed/Base.lproj/LaunchScreen.storyboard (100%) rename {Apple => Platforms/Apple}/testbed/iOSTestbed/app/README (100%) rename {Apple => Platforms/Apple}/testbed/iOSTestbed/app_packages/README (100%) rename {Apple => Platforms/Apple}/testbed/iOSTestbed/iOSTestbed-Info.plist (100%) rename {Apple => Platforms/Apple}/testbed/iOSTestbed/main.m (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3a6d6a763f2c9c..f8ce2d684604e0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -369,7 +369,7 @@ jobs: sudo xcode-select --switch /Applications/Xcode_15.4.app - name: Build and test - run: python3 Apple ci iOS --fast-ci --simulator 'iPhone SE (3rd generation),OS=17.5' + run: python3 Platforms/Apple ci iOS --fast-ci --simulator 'iPhone SE (3rd generation),OS=17.5' build-emscripten: name: 'Emscripten' diff --git a/Makefile.pre.in b/Makefile.pre.in index 5ea00537629de0..9496126c5274e0 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -2358,7 +2358,7 @@ testios: fi # Clone the testbed project into the XCFOLDER - $(PYTHON_FOR_BUILD) $(srcdir)/Apple/testbed clone --framework $(PYTHONFRAMEWORKPREFIX) "$(XCFOLDER)" + $(PYTHON_FOR_BUILD) $(srcdir)/Platforms/Apple/testbed clone --framework $(PYTHONFRAMEWORKPREFIX) "$(XCFOLDER)" # Run the testbed project $(PYTHON_FOR_BUILD) "$(XCFOLDER)" run --verbose -- test -uall --single-process --rerun -W @@ -3286,10 +3286,10 @@ clean-retain-profile: pycremoval -find build -type f -a ! -name '*.gc??' -exec rm -f {} ';' -rm -f Include/pydtrace_probes.h -rm -f profile-gen-stamp - -rm -rf Apple/iOS/testbed/Python.xcframework/ios-*/bin - -rm -rf Apple/iOS/testbed/Python.xcframework/ios-*/lib - -rm -rf Apple/iOS/testbed/Python.xcframework/ios-*/include - -rm -rf Apple/iOS/testbed/Python.xcframework/ios-*/Python.framework + -rm -rf Platforms/Apple/iOS/testbed/Python.xcframework/ios-*/bin + -rm -rf Platforms/Apple/iOS/testbed/Python.xcframework/ios-*/lib + -rm -rf Platforms/Apple/iOS/testbed/Python.xcframework/ios-*/include + -rm -rf Platforms/Apple/iOS/testbed/Python.xcframework/ios-*/Python.framework .PHONY: profile-removal profile-removal: @@ -3323,7 +3323,7 @@ clobber: clean config.cache config.log pyconfig.h Modules/config.c -rm -rf build platform -rm -rf $(PYTHONFRAMEWORKDIR) - -rm -rf Apple/iOS/Frameworks + -rm -rf Platforms/Apple/iOS/Frameworks -rm -rf iOSTestbed.* -rm -f python-config.py python-config -rm -rf cross-build diff --git a/Apple/.ruff.toml b/Platforms/Apple/.ruff.toml similarity index 88% rename from Apple/.ruff.toml rename to Platforms/Apple/.ruff.toml index 4cdc39ebee4be9..f5d74fdb6afe87 100644 --- a/Apple/.ruff.toml +++ b/Platforms/Apple/.ruff.toml @@ -1,4 +1,4 @@ -extend = "../.ruff.toml" # Inherit the project-wide settings +extend = "../../.ruff.toml" # Inherit the project-wide settings [format] preview = true diff --git a/Apple/__main__.py b/Platforms/Apple/__main__.py similarity index 98% rename from Apple/__main__.py rename to Platforms/Apple/__main__.py index c19108c8e389b5..85ca87501f2313 100644 --- a/Apple/__main__.py +++ b/Platforms/Apple/__main__.py @@ -10,7 +10,7 @@ # # The simplest entry point is: # -# $ python Apple ci iOS +# $ python Platforms/Apple ci iOS # # which will: # * Clean any pre-existing build artefacts @@ -57,7 +57,7 @@ ArgsT = Sequence[str | Path] SCRIPT_NAME = Path(__file__).name -PYTHON_DIR = Path(__file__).resolve().parent.parent +PYTHON_DIR = Path(__file__).resolve().parent.parent.parent CROSS_BUILD_DIR = PYTHON_DIR / "cross-build" @@ -140,7 +140,7 @@ def apple_env(host: str) -> EnvironmentT: """Construct an Apple development environment for the given host.""" env = { "PATH": ":".join([ - str(PYTHON_DIR / "Apple/iOS/Resources/bin"), + str(PYTHON_DIR / "Platforms/Apple/iOS/Resources/bin"), str(subdir(host) / "prefix"), "/usr/bin", "/bin", @@ -440,7 +440,7 @@ def framework_path(host_triple: str, multiarch: str) -> Path: :param host_triple: The host triple (e.g., arm64-apple-ios-simulator) :param multiarch: The multiarch identifier (e.g., arm64-simulator) """ - return CROSS_BUILD_DIR / f"{host_triple}/Apple/iOS/Frameworks/{multiarch}" + return CROSS_BUILD_DIR / f"{host_triple}/Platforms/Apple/iOS/Frameworks/{multiarch}" def package_version(prefix_path: Path) -> str: @@ -624,7 +624,7 @@ def create_xcframework(platform: str) -> str: # Copy in the cross-architecture pyconfig.h shutil.copy( - PYTHON_DIR / f"Apple/{platform}/Resources/pyconfig.h", + PYTHON_DIR / f"Platforms/Apple/{platform}/Resources/pyconfig.h", slice_framework / "Headers/pyconfig.h", ) @@ -661,7 +661,7 @@ def create_xcframework(platform: str) -> str: host_path = ( CROSS_BUILD_DIR / host_triple - / "Apple/iOS/Frameworks" + / "Platforms/Apple/iOS/Frameworks" / multiarch ) host_framework = host_path / "Python.framework" @@ -691,7 +691,7 @@ def create_xcframework(platform: str) -> str: print(" - build tools") shutil.copytree( - PYTHON_DIR / "Apple/testbed/Python.xcframework/build", + PYTHON_DIR / "Platforms/Apple/testbed/Python.xcframework/build", package_path / "Python.xcframework/build", ) @@ -711,7 +711,7 @@ def package(context: argparse.Namespace) -> None: print() run([ sys.executable, - "Apple/testbed", + "Platforms/Apple/testbed", "clone", "--platform", context.platform, @@ -806,13 +806,13 @@ def test(context: argparse.Namespace, host: str | None = None) -> None: # noqa: framework_path = ( CROSS_BUILD_DIR / host - / f"Apple/{context.platform}" + / f"Platforms/Apple/{context.platform}" / f"Frameworks/{apple_multiarch(host)}" ) run([ sys.executable, - "Apple/testbed", + "Platforms/Apple/testbed", "clone", "--platform", context.platform, diff --git a/Apple/iOS/README.md b/Platforms/Apple/iOS/README.md similarity index 92% rename from Apple/iOS/README.md rename to Platforms/Apple/iOS/README.md index 7ee257b5d648f4..faeeead1df03a2 100644 --- a/Apple/iOS/README.md +++ b/Platforms/Apple/iOS/README.md @@ -52,11 +52,11 @@ portable to machines using other architectures. ### Building a multi-architecture iOS XCframework -The `Apple` subfolder of the Python repository acts as a build script that +The `Platforms/Apple` subfolder of the Python repository acts as a build script that can be used to coordinate the compilation of a complete iOS XCframework. To use it, run:: - python Apple build iOS + python Platforms/Apple build iOS This will: @@ -69,7 +69,7 @@ This will: the `Python.xcframework`, plus a copy of the Testbed app pre-configured to use the XCframework. -The `Apple` build script has other entry points that will perform the +The `Platforms/Apple` build script has other entry points that will perform the individual parts of the overall `build` target, plus targets to test the build, clean the `cross-build` folder of iOS build products, and perform a complete "build and test" CI run. The `--clean` flag can also be used on @@ -78,7 +78,7 @@ building. ### Building a single-architecture framework -If you're using the `Apple` build script, you won't need to build +If you're using the `Platforms/Apple` build script, you won't need to build individual frameworks. However, if you do need to manually configure an iOS Python build for a single framework, the following options are available. @@ -100,7 +100,7 @@ Python build for a single framework, the following options are available. > [!NOTE] > Unless you know what you're doing, changing the name of the Python > framework on iOS is not advised. If you use this option, you won't be able - > to run the `Apple` build script without making significant manual + > to run the `Platforms/Apple` build script without making significant manual > alterations, and you won't be able to use any binary packages unless you > compile them yourself using your own framework name. @@ -119,7 +119,7 @@ provide the `--enable-framework` flag when configuring the build. The build also requires the use of cross-compilation. The minimal commands for building Python for the ARM64 iOS simulator will look something like: ``` -export PATH="$(pwd)/Apple/iOS/Resources/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin" +export PATH="$(pwd)/Platforms/Apple/iOS/Resources/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin" ./configure \ --enable-framework \ --host=arm64-apple-ios-simulator \ @@ -131,7 +131,7 @@ make install In this invocation: -* `Apple/iOS/Resources/bin` has been added to the path, providing some shims for the +* `Platforms/Apple/iOS/Resources/bin` has been added to the path, providing some shims for the compilers and linkers needed by the build. Xcode requires the use of `xcrun` to invoke compiler tooling. However, if `xcrun` is pre-evaluated and the result passed to `configure`, these results can embed user- and @@ -141,7 +141,7 @@ In this invocation: cause significant problems with many C configuration systems which assume that `CC` will be a single executable. - To work around this problem, the `Apple/iOS/Resources/bin` folder contains some + To work around this problem, the `Platforms/Apple/iOS/Resources/bin` folder contains some wrapper scripts that present as simple compilers and linkers, but wrap underlying calls to `xcrun`. This allows configure to use a `CC` definition without spaces, and without user- or version-specific paths, while @@ -222,7 +222,7 @@ simulator build with a deployment target of 15.4. Once you have a built an XCframework, you can test that framework by running: - $ python Apple test iOS + $ python Platforms/Apple test iOS This test will attempt to find an "SE-class" simulator (i.e., an iPhone SE, or iPhone 16e, or similar), and run the test suite on the most recent version of @@ -237,7 +237,7 @@ environment variable will be exposed to the iOS process at runtime. ### Testing a single-architecture framework -The `Apple/testbed` folder that contains an Xcode project that is able to run +The `Platforms/Apple/testbed` folder that contains an Xcode project that is able to run the Python test suite on Apple platforms. This project converts the Python test suite into a single test case in Xcode's XCTest framework. The single XCTest passes if the test suite passes. @@ -245,7 +245,7 @@ passes if the test suite passes. To run the test suite, configure a Python build for an iOS simulator (i.e., `--host=arm64-apple-ios-simulator` or `--host=x86_64-apple-ios-simulator` ), specifying a framework build (i.e. `--enable-framework`). Ensure that your -`PATH` has been configured to include the `Apple/iOS/Resources/bin` folder and +`PATH` has been configured to include the `Platforms/Apple/iOS/Resources/bin` folder and exclude any non-iOS tools, then run: ``` make all @@ -269,9 +269,9 @@ project, and then boot and prepare the iOS simulator. ### Debugging test failures -Running `python Apple test iOS` generates a standalone version of the -`Apple/testbed` project, and runs the full test suite. It does this using -`Apple/testbed` itself - the folder is an executable module that can be used +Running `python Platforms/Apple test iOS` generates a standalone version of the +`Platforms/Apple/testbed` project, and runs the full test suite. It does this using +`Platforms/Apple/testbed` itself - the folder is an executable module that can be used to create and run a clone of the testbed project. The standalone version of the testbed will be created in a directory named `cross-build/iOS-testbed.`. @@ -287,7 +287,7 @@ testbed clone. If you've built your own XCframework, or you only want to test a single architecture, you can construct a standalone testbed instance by running: ``` -python Apple/testbed clone --platform iOS --framework my-testbed +python Platforms/Apple/testbed clone --platform iOS --framework my-testbed ``` The framework path can be the path path to a `Python.xcframework`, or the diff --git a/Apple/iOS/Resources/Info.plist.in b/Platforms/Apple/iOS/Resources/Info.plist.in similarity index 100% rename from Apple/iOS/Resources/Info.plist.in rename to Platforms/Apple/iOS/Resources/Info.plist.in diff --git a/Apple/iOS/Resources/bin/arm64-apple-ios-ar b/Platforms/Apple/iOS/Resources/bin/arm64-apple-ios-ar similarity index 100% rename from Apple/iOS/Resources/bin/arm64-apple-ios-ar rename to Platforms/Apple/iOS/Resources/bin/arm64-apple-ios-ar diff --git a/Apple/iOS/Resources/bin/arm64-apple-ios-clang b/Platforms/Apple/iOS/Resources/bin/arm64-apple-ios-clang similarity index 100% rename from Apple/iOS/Resources/bin/arm64-apple-ios-clang rename to Platforms/Apple/iOS/Resources/bin/arm64-apple-ios-clang diff --git a/Apple/iOS/Resources/bin/arm64-apple-ios-clang++ b/Platforms/Apple/iOS/Resources/bin/arm64-apple-ios-clang++ similarity index 100% rename from Apple/iOS/Resources/bin/arm64-apple-ios-clang++ rename to Platforms/Apple/iOS/Resources/bin/arm64-apple-ios-clang++ diff --git a/Apple/iOS/Resources/bin/arm64-apple-ios-cpp b/Platforms/Apple/iOS/Resources/bin/arm64-apple-ios-cpp similarity index 100% rename from Apple/iOS/Resources/bin/arm64-apple-ios-cpp rename to Platforms/Apple/iOS/Resources/bin/arm64-apple-ios-cpp diff --git a/Apple/iOS/Resources/bin/arm64-apple-ios-simulator-ar b/Platforms/Apple/iOS/Resources/bin/arm64-apple-ios-simulator-ar similarity index 100% rename from Apple/iOS/Resources/bin/arm64-apple-ios-simulator-ar rename to Platforms/Apple/iOS/Resources/bin/arm64-apple-ios-simulator-ar diff --git a/Apple/iOS/Resources/bin/arm64-apple-ios-simulator-clang b/Platforms/Apple/iOS/Resources/bin/arm64-apple-ios-simulator-clang similarity index 100% rename from Apple/iOS/Resources/bin/arm64-apple-ios-simulator-clang rename to Platforms/Apple/iOS/Resources/bin/arm64-apple-ios-simulator-clang diff --git a/Apple/iOS/Resources/bin/arm64-apple-ios-simulator-clang++ b/Platforms/Apple/iOS/Resources/bin/arm64-apple-ios-simulator-clang++ similarity index 100% rename from Apple/iOS/Resources/bin/arm64-apple-ios-simulator-clang++ rename to Platforms/Apple/iOS/Resources/bin/arm64-apple-ios-simulator-clang++ diff --git a/Apple/iOS/Resources/bin/arm64-apple-ios-simulator-cpp b/Platforms/Apple/iOS/Resources/bin/arm64-apple-ios-simulator-cpp similarity index 100% rename from Apple/iOS/Resources/bin/arm64-apple-ios-simulator-cpp rename to Platforms/Apple/iOS/Resources/bin/arm64-apple-ios-simulator-cpp diff --git a/Apple/iOS/Resources/bin/arm64-apple-ios-simulator-strip b/Platforms/Apple/iOS/Resources/bin/arm64-apple-ios-simulator-strip similarity index 100% rename from Apple/iOS/Resources/bin/arm64-apple-ios-simulator-strip rename to Platforms/Apple/iOS/Resources/bin/arm64-apple-ios-simulator-strip diff --git a/Apple/iOS/Resources/bin/arm64-apple-ios-strip b/Platforms/Apple/iOS/Resources/bin/arm64-apple-ios-strip similarity index 100% rename from Apple/iOS/Resources/bin/arm64-apple-ios-strip rename to Platforms/Apple/iOS/Resources/bin/arm64-apple-ios-strip diff --git a/Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-ar b/Platforms/Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-ar similarity index 100% rename from Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-ar rename to Platforms/Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-ar diff --git a/Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-clang b/Platforms/Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-clang similarity index 100% rename from Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-clang rename to Platforms/Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-clang diff --git a/Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-clang++ b/Platforms/Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-clang++ similarity index 100% rename from Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-clang++ rename to Platforms/Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-clang++ diff --git a/Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-cpp b/Platforms/Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-cpp similarity index 100% rename from Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-cpp rename to Platforms/Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-cpp diff --git a/Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-strip b/Platforms/Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-strip similarity index 100% rename from Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-strip rename to Platforms/Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-strip diff --git a/Apple/iOS/Resources/pyconfig.h b/Platforms/Apple/iOS/Resources/pyconfig.h similarity index 100% rename from Apple/iOS/Resources/pyconfig.h rename to Platforms/Apple/iOS/Resources/pyconfig.h diff --git a/Apple/testbed/Python.xcframework/Info.plist b/Platforms/Apple/testbed/Python.xcframework/Info.plist similarity index 100% rename from Apple/testbed/Python.xcframework/Info.plist rename to Platforms/Apple/testbed/Python.xcframework/Info.plist diff --git a/Apple/testbed/Python.xcframework/build/iOS-dylib-Info-template.plist b/Platforms/Apple/testbed/Python.xcframework/build/iOS-dylib-Info-template.plist similarity index 100% rename from Apple/testbed/Python.xcframework/build/iOS-dylib-Info-template.plist rename to Platforms/Apple/testbed/Python.xcframework/build/iOS-dylib-Info-template.plist diff --git a/Apple/testbed/Python.xcframework/build/utils.sh b/Platforms/Apple/testbed/Python.xcframework/build/utils.sh similarity index 100% rename from Apple/testbed/Python.xcframework/build/utils.sh rename to Platforms/Apple/testbed/Python.xcframework/build/utils.sh diff --git a/Apple/testbed/Python.xcframework/ios-arm64/README b/Platforms/Apple/testbed/Python.xcframework/ios-arm64/README similarity index 100% rename from Apple/testbed/Python.xcframework/ios-arm64/README rename to Platforms/Apple/testbed/Python.xcframework/ios-arm64/README diff --git a/Apple/testbed/Python.xcframework/ios-arm64_x86_64-simulator/README b/Platforms/Apple/testbed/Python.xcframework/ios-arm64_x86_64-simulator/README similarity index 100% rename from Apple/testbed/Python.xcframework/ios-arm64_x86_64-simulator/README rename to Platforms/Apple/testbed/Python.xcframework/ios-arm64_x86_64-simulator/README diff --git a/Apple/testbed/Testbed.lldbinit b/Platforms/Apple/testbed/Testbed.lldbinit similarity index 100% rename from Apple/testbed/Testbed.lldbinit rename to Platforms/Apple/testbed/Testbed.lldbinit diff --git a/Apple/testbed/TestbedTests/TestbedTests.m b/Platforms/Apple/testbed/TestbedTests/TestbedTests.m similarity index 100% rename from Apple/testbed/TestbedTests/TestbedTests.m rename to Platforms/Apple/testbed/TestbedTests/TestbedTests.m diff --git a/Apple/testbed/__main__.py b/Platforms/Apple/testbed/__main__.py similarity index 100% rename from Apple/testbed/__main__.py rename to Platforms/Apple/testbed/__main__.py diff --git a/Apple/testbed/iOSTestbed.xcodeproj/project.pbxproj b/Platforms/Apple/testbed/iOSTestbed.xcodeproj/project.pbxproj similarity index 100% rename from Apple/testbed/iOSTestbed.xcodeproj/project.pbxproj rename to Platforms/Apple/testbed/iOSTestbed.xcodeproj/project.pbxproj diff --git a/Apple/testbed/iOSTestbed.xcodeproj/xcshareddata/xcschemes/iOSTestbed.xcscheme b/Platforms/Apple/testbed/iOSTestbed.xcodeproj/xcshareddata/xcschemes/iOSTestbed.xcscheme similarity index 100% rename from Apple/testbed/iOSTestbed.xcodeproj/xcshareddata/xcschemes/iOSTestbed.xcscheme rename to Platforms/Apple/testbed/iOSTestbed.xcodeproj/xcshareddata/xcschemes/iOSTestbed.xcscheme diff --git a/Apple/testbed/iOSTestbed.xctestplan b/Platforms/Apple/testbed/iOSTestbed.xctestplan similarity index 100% rename from Apple/testbed/iOSTestbed.xctestplan rename to Platforms/Apple/testbed/iOSTestbed.xctestplan diff --git a/Apple/testbed/iOSTestbed/AppDelegate.h b/Platforms/Apple/testbed/iOSTestbed/AppDelegate.h similarity index 100% rename from Apple/testbed/iOSTestbed/AppDelegate.h rename to Platforms/Apple/testbed/iOSTestbed/AppDelegate.h diff --git a/Apple/testbed/iOSTestbed/AppDelegate.m b/Platforms/Apple/testbed/iOSTestbed/AppDelegate.m similarity index 100% rename from Apple/testbed/iOSTestbed/AppDelegate.m rename to Platforms/Apple/testbed/iOSTestbed/AppDelegate.m diff --git a/Apple/testbed/iOSTestbed/Assets.xcassets/AccentColor.colorset/Contents.json b/Platforms/Apple/testbed/iOSTestbed/Assets.xcassets/AccentColor.colorset/Contents.json similarity index 100% rename from Apple/testbed/iOSTestbed/Assets.xcassets/AccentColor.colorset/Contents.json rename to Platforms/Apple/testbed/iOSTestbed/Assets.xcassets/AccentColor.colorset/Contents.json diff --git a/Apple/testbed/iOSTestbed/Assets.xcassets/AppIcon.appiconset/Contents.json b/Platforms/Apple/testbed/iOSTestbed/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from Apple/testbed/iOSTestbed/Assets.xcassets/AppIcon.appiconset/Contents.json rename to Platforms/Apple/testbed/iOSTestbed/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/Apple/testbed/iOSTestbed/Assets.xcassets/Contents.json b/Platforms/Apple/testbed/iOSTestbed/Assets.xcassets/Contents.json similarity index 100% rename from Apple/testbed/iOSTestbed/Assets.xcassets/Contents.json rename to Platforms/Apple/testbed/iOSTestbed/Assets.xcassets/Contents.json diff --git a/Apple/testbed/iOSTestbed/Base.lproj/LaunchScreen.storyboard b/Platforms/Apple/testbed/iOSTestbed/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from Apple/testbed/iOSTestbed/Base.lproj/LaunchScreen.storyboard rename to Platforms/Apple/testbed/iOSTestbed/Base.lproj/LaunchScreen.storyboard diff --git a/Apple/testbed/iOSTestbed/app/README b/Platforms/Apple/testbed/iOSTestbed/app/README similarity index 100% rename from Apple/testbed/iOSTestbed/app/README rename to Platforms/Apple/testbed/iOSTestbed/app/README diff --git a/Apple/testbed/iOSTestbed/app_packages/README b/Platforms/Apple/testbed/iOSTestbed/app_packages/README similarity index 100% rename from Apple/testbed/iOSTestbed/app_packages/README rename to Platforms/Apple/testbed/iOSTestbed/app_packages/README diff --git a/Apple/testbed/iOSTestbed/iOSTestbed-Info.plist b/Platforms/Apple/testbed/iOSTestbed/iOSTestbed-Info.plist similarity index 100% rename from Apple/testbed/iOSTestbed/iOSTestbed-Info.plist rename to Platforms/Apple/testbed/iOSTestbed/iOSTestbed-Info.plist diff --git a/Apple/testbed/iOSTestbed/main.m b/Platforms/Apple/testbed/iOSTestbed/main.m similarity index 100% rename from Apple/testbed/iOSTestbed/main.m rename to Platforms/Apple/testbed/iOSTestbed/main.m diff --git a/configure b/configure index 23f24d51c79e1a..c5109f69ebddb0 100755 --- a/configure +++ b/configure @@ -4389,7 +4389,7 @@ then : yes) case $ac_sys_system in Darwin) enableval=/Library/Frameworks ;; - iOS) enableval=Apple/iOS/Frameworks/\$\(MULTIARCH\) ;; + iOS) enableval=Platforms/Apple/iOS/Frameworks/\$\(MULTIARCH\) ;; *) as_fn_error $? "Unknown platform for framework build" "$LINENO" 5 esac esac @@ -4500,9 +4500,9 @@ then : prefix=$PYTHONFRAMEWORKPREFIX PYTHONFRAMEWORKINSTALLNAMEPREFIX="@rpath/$PYTHONFRAMEWORKDIR" - RESSRCDIR=Apple/iOS/Resources + RESSRCDIR=Platforms/Apple/iOS/Resources - ac_config_files="$ac_config_files Apple/iOS/Resources/Info.plist" + ac_config_files="$ac_config_files Platforms/Apple/iOS/Resources/Info.plist" ;; *) @@ -35618,7 +35618,7 @@ do "Mac/PythonLauncher/Makefile") CONFIG_FILES="$CONFIG_FILES Mac/PythonLauncher/Makefile" ;; "Mac/Resources/framework/Info.plist") CONFIG_FILES="$CONFIG_FILES Mac/Resources/framework/Info.plist" ;; "Mac/Resources/app/Info.plist") CONFIG_FILES="$CONFIG_FILES Mac/Resources/app/Info.plist" ;; - "Apple/iOS/Resources/Info.plist") CONFIG_FILES="$CONFIG_FILES Apple/iOS/Resources/Info.plist" ;; + "Platforms/Apple/iOS/Resources/Info.plist") CONFIG_FILES="$CONFIG_FILES Platforms/Apple/iOS/Resources/Info.plist" ;; "Makefile.pre") CONFIG_FILES="$CONFIG_FILES Makefile.pre" ;; "Misc/python.pc") CONFIG_FILES="$CONFIG_FILES Misc/python.pc" ;; "Misc/python-embed.pc") CONFIG_FILES="$CONFIG_FILES Misc/python-embed.pc" ;; diff --git a/configure.ac b/configure.ac index 635fce3f2e6fad..8fae8b46fa6fd5 100644 --- a/configure.ac +++ b/configure.ac @@ -568,7 +568,7 @@ AC_ARG_ENABLE([framework], yes) case $ac_sys_system in Darwin) enableval=/Library/Frameworks ;; - iOS) enableval=Apple/iOS/Frameworks/\$\(MULTIARCH\) ;; + iOS) enableval=Platforms/Apple/iOS/Frameworks/\$\(MULTIARCH\) ;; *) AC_MSG_ERROR([Unknown platform for framework build]) esac esac @@ -675,9 +675,9 @@ AC_ARG_ENABLE([framework], prefix=$PYTHONFRAMEWORKPREFIX PYTHONFRAMEWORKINSTALLNAMEPREFIX="@rpath/$PYTHONFRAMEWORKDIR" - RESSRCDIR=Apple/iOS/Resources + RESSRCDIR=Platforms/Apple/iOS/Resources - AC_CONFIG_FILES([Apple/iOS/Resources/Info.plist]) + AC_CONFIG_FILES([Platforms/Apple/iOS/Resources/Info.plist]) ;; *) AC_MSG_ERROR([Unknown platform for framework build]) From d54f9df73ed3a0bc4544e79b4707d8badf82c09b Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Fri, 27 Mar 2026 06:04:26 +0800 Subject: [PATCH 2/4] Add blurb. --- .../next/Build/2026-03-26-12-27-42.gh-issue-146444.JKJuEa.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Build/2026-03-26-12-27-42.gh-issue-146444.JKJuEa.rst diff --git a/Misc/NEWS.d/next/Build/2026-03-26-12-27-42.gh-issue-146444.JKJuEa.rst b/Misc/NEWS.d/next/Build/2026-03-26-12-27-42.gh-issue-146444.JKJuEa.rst new file mode 100644 index 00000000000000..40489f41a2ad6a --- /dev/null +++ b/Misc/NEWS.d/next/Build/2026-03-26-12-27-42.gh-issue-146444.JKJuEa.rst @@ -0,0 +1 @@ +The Apple/iOS build script has been moved to the Platforms directory. From 68ab7e4618a6bd75f81ca4e175bd554e61d8ede6 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Fri, 27 Mar 2026 08:12:12 +0800 Subject: [PATCH 3/4] Tweak pre-commit config for new location. --- .pre-commit-config.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dfd18182105e11..6e612ce232fb29 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,9 +3,9 @@ repos: rev: a27a2e47c7751b639d2b5badf0ef6ff11fee893f # frozen: v0.15.4 hooks: - id: ruff-check - name: Run Ruff (lint) on Apple/ - args: [--exit-non-zero-on-fix, --config=Apple/.ruff.toml] - files: ^Apple/ + name: Run Ruff (lint) on Platforms/Apple/ + args: [--exit-non-zero-on-fix, --config=Platforms/Apple/.ruff.toml] + files: ^Platforms/Apple/ - id: ruff-check name: Run Ruff (lint) on Doc/ args: [--exit-non-zero-on-fix] @@ -39,9 +39,9 @@ repos: args: [--exit-non-zero-on-fix, --config=Tools/wasm/.ruff.toml] files: ^Tools/wasm/ - id: ruff-format - name: Run Ruff (format) on Apple/ - args: [--exit-non-zero-on-fix, --config=Apple/.ruff.toml] - files: ^Apple + name: Run Ruff (format) on Platforms/Apple/ + args: [--exit-non-zero-on-fix, --config=Platforms/Apple/.ruff.toml] + files: ^Platforms/Apple/ - id: ruff-format name: Run Ruff (format) on Doc/ args: [--exit-non-zero-on-fix] From d8f61f8fb0a35221757604a417b3abff23ea4dec Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Fri, 27 Mar 2026 08:16:56 +0800 Subject: [PATCH 4/4] Fix a linting problem. --- Platforms/Apple/__main__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Platforms/Apple/__main__.py b/Platforms/Apple/__main__.py index 85ca87501f2313..c646a222bc630f 100644 --- a/Platforms/Apple/__main__.py +++ b/Platforms/Apple/__main__.py @@ -440,7 +440,10 @@ def framework_path(host_triple: str, multiarch: str) -> Path: :param host_triple: The host triple (e.g., arm64-apple-ios-simulator) :param multiarch: The multiarch identifier (e.g., arm64-simulator) """ - return CROSS_BUILD_DIR / f"{host_triple}/Platforms/Apple/iOS/Frameworks/{multiarch}" + return ( + CROSS_BUILD_DIR + / f"{host_triple}/Platforms/Apple/iOS/Frameworks/{multiarch}" + ) def package_version(prefix_path: Path) -> str: