Skip to content
Merged
Changes from 2 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
44 changes: 23 additions & 21 deletions master/custom/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -1185,10 +1185,7 @@ def py313_setup(self, branch, worker, test_with_PTY=False, **kwargs):
)

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

apple_py = ["python3", "Platforms/Apple"]
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.
Expand All @@ -1202,18 +1199,15 @@ def current_setup(self, branch, worker, test_with_PTY=False, **kwargs):
# 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,
command=apple_py + ["build", "iOS", "build"],
),
Compile(
name="Configure and compile host Pythons",
command=["python3", "Platforms/Apple", "build", "iOS", "hosts"],
env=build_environ,
command=apple_py + ["build", "iOS", "hosts"],
),
Compile(
name="Package XCframework",
command=["python3", "Platforms/Apple", "package", "iOS"],
env=build_environ,
command=apple_py + ["package", "iOS"],
),
Test(
name="Run test suite",
Expand All @@ -1224,13 +1218,11 @@ def current_setup(self, branch, worker, test_with_PTY=False, **kwargs):
"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,
command=apple_py + ["clean", "iOS"],
),
])

Expand Down Expand Up @@ -1273,8 +1265,20 @@ class AndroidBuild(BaseBuild):
"""

def setup(self, **kwargs):
android_py = "Android/android.py"
android_py = ["python3", "Platforms/Android"]
self.addSteps([
# This symlink is needed to support pre Python 3.15 builds - it makes the
# top level Andrdoid folder appear in the new Platforms/Android location,
# and links `__main__.py` to the older `android.py` script. This step can
# be removed when 3.14 is no longer supported.
ShellCommand(
name="Set up compatibility symlink",
command=(
"[ -e Platforms/Android ]"
"|| ln -s ../Android Platforms/Android"
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.

On Python 3.13, this command fails with:

ln: failed to create symbolic link 'Platforms/Android': No such file or directory

You should create the Platforms/ directory somehow. For example, add [ -e Platforms ] || mkdir Platforms; prefix to your command.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🤦 I forgot that 3.14 has the Platforms directory; but 3.13 doesn't. Fixed.

"&& ln -si ../Android/android.py Platforms/Android/__main__.py"
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.

For readability, you should add spaces:

Suggested change
"[ -e Platforms/Android ]"
"|| ln -s ../Android Platforms/Android"
"&& ln -si ../Android/android.py Platforms/Android/__main__.py"
"[ -e Platforms/Android ] "
"|| ln -s ../Android Platforms/Android "
"&& ln -si ../Android/android.py Platforms/Android/__main__.py"

),
),
SetPropertyFromCommand(
name="Get build triple",
command=["./config.guess"],
Expand All @@ -1283,24 +1287,22 @@ def setup(self, **kwargs):
),
Configure(
name="Configure build Python",
command=[android_py, "configure-build"],
command=android_py + ["configure-build"],
),
Compile(
name="Compile build Python",
command=[android_py, "make-build"],
command=android_py + ["make-build"],
),
Configure(
name="Configure host Python",
command=[android_py, "configure-host", self.host_triple],
command=android_py + ["configure-host", self.host_triple],
),
Compile(
name="Compile host Python",
command=[android_py, "make-host", self.host_triple],
command=android_py + ["make-host", self.host_triple],
),
Test(
command=[
android_py, "test", "--managed", "maxVersion", "-v", "--slow-ci"
],
command=android_py + ["test", "--managed", "maxVersion", "-v", "--slow-ci"],
timeout=step_timeout(self.test_timeout),
),
])
Expand Down