@@ -1032,6 +1032,7 @@ class _IOSSimulatorBuild(UnixBuild):
10321032 build)
10331033 * It invokes `make testios` as a test target
10341034 """
1035+
10351036 buildersuffix = ".iOS-simulator"
10361037 ios_min_version = "" # use the default from the configure file
10371038 factory_tags = ["iOS" ]
@@ -1044,7 +1045,7 @@ def __init__(self, source, **kwargs):
10441045
10451046 super ().__init__ (source , ** kwargs )
10461047
1047- def setup (self , parallel , branch , test_with_PTY = False , ** kwargs ):
1048+ def py313_setup (self , parallel , branch , test_with_PTY = False , ** kwargs ):
10481049 out_of_tree_dir = "build_oot"
10491050 oot_dir_path = os .path .join ("build" , out_of_tree_dir )
10501051 oot_build_path = os .path .join (oot_dir_path , "build" )
@@ -1076,7 +1077,7 @@ def setup(self, parallel, branch, test_with_PTY=False, **kwargs):
10761077 Configure (
10771078 name = "Configure build Python" ,
10781079 command = ["../../configure" ],
1079- workdir = oot_build_path
1080+ workdir = oot_build_path ,
10801081 )
10811082 )
10821083 if parallel :
@@ -1088,7 +1089,7 @@ def setup(self, parallel, branch, test_with_PTY=False, **kwargs):
10881089 Compile (
10891090 name = "Compile build Python" ,
10901091 command = compile ,
1091- workdir = oot_build_path
1092+ workdir = oot_build_path ,
10921093 )
10931094 )
10941095
@@ -1128,15 +1129,15 @@ def setup(self, parallel, branch, test_with_PTY=False, **kwargs):
11281129 f"--build={ self .arch } -apple-darwin" ,
11291130 f"--host={ self .host } " ,
11301131 "--with-build-python=../build/python.exe" ,
1131- "--enable-framework"
1132+ "--enable-framework" ,
11321133 ]
11331134
11341135 self .addStep (
11351136 Configure (
11361137 name = "Configure host Python" ,
11371138 command = configure_cmd ,
11381139 env = compile_environ ,
1139- workdir = oot_host_path
1140+ workdir = oot_host_path ,
11401141 )
11411142 )
11421143
@@ -1186,6 +1187,71 @@ def setup(self, parallel, branch, test_with_PTY=False, **kwargs):
11861187 )
11871188 )
11881189
1190+ def current_setup (self , parallel , branch , test_with_PTY = False , ** kwargs ):
1191+ build_environ = {
1192+ "CACHE_DIR" : "/Users/buildbot/downloads" ,
1193+ }
1194+
1195+ self .addSteps ([
1196+ # This symlink is needed to support Python 3.14 builds - it makes the
1197+ # top level Apple folder appear in the new Platforms/Apple location.
1198+ # It will fail on 3.13 PR branches because the top level Apple folder
1199+ # doesn't exist. This step can be removed when 3.14 is no longer
1200+ # supported.
1201+ ShellCommand (
1202+ name = "Set up compatibility symlink" ,
1203+ command = "[ -e Platforms/Apple ] || ln -s ../Apple Platforms/Apple" ,
1204+ ),
1205+ # Build the full iOS XCframework, including a multi-arch simulator slice.
1206+ Compile (
1207+ name = "Configure and compile build Python" ,
1208+ command = ["python3" , "Platforms/Apple" , "build" , "iOS" , "build" ],
1209+ env = build_environ ,
1210+ ),
1211+ Compile (
1212+ name = "Configure and compile host Pythons" ,
1213+ command = ["python3" , "Platforms/Apple" , "build" , "iOS" , "hosts" ],
1214+ env = build_environ ,
1215+ ),
1216+ Compile (
1217+ name = "Package XCframework" ,
1218+ command = ["python3" , "Platforms/Apple" , "package" , "iOS" ],
1219+ env = build_environ ,
1220+ ),
1221+ Test (
1222+ name = "Run test suite" ,
1223+ command = [
1224+ "python3" ,
1225+ "Platforms/Apple" ,
1226+ "test" ,
1227+ "iOS" ,
1228+ "--slow-ci" ,
1229+ ],
1230+ env = build_environ ,
1231+ timeout = step_timeout (self .test_timeout ),
1232+ ),
1233+ Clean (
1234+ name = "Clean the builds" ,
1235+ command = ["python3" , "Platforms/Apple" , "clean" , "iOS" ],
1236+ env = build_environ ,
1237+ ),
1238+ ])
1239+
1240+ def setup (self , parallel , branch , test_with_PTY = False , ** kwargs ):
1241+ # Builds on Python 3.13 use a direct set of calls to make. Python 3.14
1242+ # introduced a simpler XCframework build script; Python 3.15 moved that
1243+ # script to the Platforms folder.
1244+ #
1245+ # The `Platforms/Apple` location can be used for 3.14 builds with a
1246+ # symlink, but 3.13 builds have to used the build process.
1247+ #
1248+ # The symlink approach will fail for Python 3.13 *PR* builds, because
1249+ # there's no way to identify the base branch for a PR.
1250+ if branch == "3.13" :
1251+ self .py313_setup (parallel , branch , test_with_PTY = test_with_PTY , ** kwargs )
1252+ else :
1253+ self .current_setup (parallel , branch , test_with_PTY = test_with_PTY , ** kwargs )
1254+
11891255
11901256class IOSARM64SimulatorBuild (_IOSSimulatorBuild ):
11911257 """An ARM64 iOS simulator build."""
0 commit comments