Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ lib/
venv/
worker/
settings.yaml
.vscode/
78 changes: 73 additions & 5 deletions master/custom/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,7 @@ class _IOSSimulatorBuild(UnixBuild):
build)
* It invokes `make testios` as a test target
"""

buildersuffix = ".iOS-simulator"
ios_min_version = "" # use the default from the configure file
factory_tags = ["iOS"]
Expand All @@ -1044,7 +1045,7 @@ def __init__(self, source, **kwargs):

super().__init__(source, **kwargs)

def setup(self, parallel, branch, test_with_PTY=False, **kwargs):
def py313_setup(self, parallel, branch, test_with_PTY=False, **kwargs):
out_of_tree_dir = "build_oot"
oot_dir_path = os.path.join("build", out_of_tree_dir)
oot_build_path = os.path.join(oot_dir_path, "build")
Expand Down Expand Up @@ -1076,7 +1077,7 @@ def setup(self, parallel, branch, test_with_PTY=False, **kwargs):
Configure(
name="Configure build Python",
command=["../../configure"],
workdir=oot_build_path
workdir=oot_build_path,
)
)
if parallel:
Expand All @@ -1088,7 +1089,7 @@ def setup(self, parallel, branch, test_with_PTY=False, **kwargs):
Compile(
name="Compile build Python",
command=compile,
workdir=oot_build_path
workdir=oot_build_path,
)
)

Expand Down Expand Up @@ -1128,15 +1129,15 @@ def setup(self, parallel, branch, test_with_PTY=False, **kwargs):
f"--build={self.arch}-apple-darwin",
f"--host={self.host}",
"--with-build-python=../build/python.exe",
"--enable-framework"
"--enable-framework",
]

self.addStep(
Configure(
name="Configure host Python",
command=configure_cmd,
env=compile_environ,
workdir=oot_host_path
workdir=oot_host_path,
)
)

Expand Down Expand Up @@ -1186,6 +1187,73 @@ def setup(self, parallel, branch, test_with_PTY=False, **kwargs):
)
)

def current_setup(self, parallel, branch, test_with_PTY=False, **kwargs):
build_environ = {
"CACHE_DIR": "/Users/buildbot/downloads",
}

self.addSteps(
[
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding style suggestion: you may move [ after addSteps( to remove one indentation level.

Suggested change
self.addSteps(
[
self.addSteps([

# This symlink is needed to support Python 3.14 builds - it makes the
# top level Apple folder appear in the new Platforms/Apple location.
# It will fail on 3.13 PR branches because the top level Apple folder
# doesn't exist. This step can be removed when 3.14 is no longer
# supported.
ShellCommand(
name="Set up compatibility symlink",
command="[ -e Platforms/Apple ] || ln -s ../Apple Platforms/Apple",
),
# Build the full iOS XCframework, including a multi-arch simulator slice.
Compile(
name="Configure and compile build Python",
command=["python3", "Platforms/Apple", "build", "iOS", "build"],
env=build_environ,
),
Compile(
name="Configure and compile host Pythons",
command=["python3", "Platforms/Apple", "build", "iOS", "hosts"],
env=build_environ,
),
Compile(
name="Package XCframework",
command=["python3", "Platforms/Apple", "package", "iOS"],
env=build_environ,
),
Test(
name="Run test suite",
command=[
"python3",
"Platforms/Apple",
"test",
"iOS",
"--slow-ci",
],
env=build_environ,
timeout=step_timeout(self.test_timeout),
),
Clean(
name="Clean the builds",
command=["python3", "Platforms/Apple", "clean", "iOS"],
env=build_environ,
),
]
)

def setup(self, parallel, branch, test_with_PTY=False, **kwargs):
# Builds on Python 3.13 use a direct set of calls to make. Python 3.14
# introduced a simpler XCframework build script; Python 3.15 moved that
# script to the Platforms folder.
#
# The `Platforms/Apple` location can be used for 3.14 builds with a
# symlink, but 3.13 builds have to used the build process.
#
# The symlink approach will fail for Python 3.13 *PR* builds, because
# there's no way to identify the base branch for a PR.
if branch == "3.13":
self.py313_setup(parallel, branch, test_with_PTY=test_with_PTY, **kwargs)
else:
self.current_setup(parallel, branch, test_with_PTY=test_with_PTY, **kwargs)


class IOSARM64SimulatorBuild(_IOSSimulatorBuild):
"""An ARM64 iOS simulator build."""
Expand Down