Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions master/custom/builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
MacOSArmWithBrewNoGilRefleakBuild,
Wasm32WasiCrossBuild,
Wasm32WasiPreview1DebugBuild,
Wasm32WasiPlatformDebugBuild,
Wasm32WasiPlatformReleaseBuild,
IOSARM64SimulatorBuild,
AndroidBuild,
EmscriptenBuild,
Expand Down Expand Up @@ -281,7 +281,7 @@ def generate_builderdefs(tags, entries):

# WASI
("wasm32-wasip1", "bcannon-wasi", Wasm32WasiPreview1DebugBuild),
("wasm32-wasi", "bcannon-wasi", Wasm32WasiPlatformDebugBuild),
("wasm32-wasi", "bcannon-wasi", Wasm32WasiPlatformReleaseBuild),

# Windows aarch64 MSVC
("ARM64 Windows", "ware-win11-arm64", factories.WindowsARM64Build),
Expand Down
63 changes: 44 additions & 19 deletions master/custom/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -1103,16 +1103,16 @@ class Wasm32WasiPreview1DebugBuild(_Wasm32WasiPreview1Build):
testFlags = ["-u-cpu"]


class Wasm32WasiPlatformDebugBuild(UnixBuild):
class _Wasm32WasiPlatformBuild(UnixBuild):
factory_tags = ["wasm", "wasi"]
buildersuffix = ".wasi"
pydebug = True
append_suffix = ".debug"
kind = None # "pydebug", "release"
append_suffix = None

testFlags = ["-u-cpu"]

def __init__(self, source, *, extra_tags=[], **kwargs):
if self.pydebug:
if self.append_suffix:
self.buildersuffix += self.append_suffix
# `Platforms/WASI` was introduced in Python 3.15.
# `Platforms/WASI path` was introduced in Python 3.16.
Expand All @@ -1132,8 +1132,11 @@ def setup(self, branch, worker, test_with_PTY=False, **kwargs):

# Build Python
build_configure = ["python3", wasi_py, "configure-build-python"]
if self.pydebug:
build_configure.extend(["--", "--with-pydebug"])
match self.kind:
case "pydebug":
build_configure.extend(["--", "--with-pydebug"])
case "release":
build_configure.append("--release")
self.addStep(
Configure(
name="Configure build Python",
Expand All @@ -1154,11 +1157,14 @@ def setup(self, branch, worker, test_with_PTY=False, **kwargs):
)

# Host/WASI Python
host_configure = ["python3", wasi_py, "configure-host"]
# Pydebug build automatically inferred from build Python.
if self.kind == "release":
host_configure.append("--release")
self.addStep(
# Pydebug build automatically inferred from build Python.
Configure(
name="Configure host Python",
command=["python3", wasi_py, "configure-host"],
command=host_configure,
)
)
self.addStep(
Expand All @@ -1167,30 +1173,39 @@ def setup(self, branch, worker, test_with_PTY=False, **kwargs):
command=["python3", wasi_py, "make-host"],
)
)

self.addStep(
PythonInfo(
name="Display build info of the host/WASI Python",
command=["python3", wasi_py, "pythoninfo-host"],
)
)

# Copied from UnixBuild.
if self.kind == "release":
self.addStep(
Install(
name="Create release archive",
description=["archiving"],
descriptionDone = ["Archived"],
command=["python3", wasi_py, "package"],
)
)

test = ["python3", wasi_py, "test", "--slow-ci"]
if self.kind == "release":
test.extend(["--target", "archive"])
testopts = self.create_test_opts(branch, worker)
test = [
"make",
"buildbottest",
"TESTOPTS=" + " ".join(testopts) + " ${BUILDBOT_TESTOPTS}",
f"TESTPYTHONOPTS={self.interpreterFlags}",
f"TESTTIMEOUT={self.test_timeout}",
]
testopts.append(f"--timeout={self.test_timeout}")
test_env = {
**self.test_environ,
"EXTRATESTOPTS": " ".join(testopts) + " ${BUILDBOT_TESTOPTS}",
"TESTPYTHONOPTS": self.interpreterFlags,
}
self.addStep(
Test(
command=test,
timeout=step_timeout(self.test_timeout),
usePTY=test_with_PTY,
env=self.test_environ,
workdir=util.Property("wasi_host_path"),
env=test_env,
)
)
if not branch.is_pr and not has_option("-R", self.testFlags):
Expand All @@ -1207,6 +1222,16 @@ def setup(self, branch, worker, test_with_PTY=False, **kwargs):
)


class Wasm32WasiPlatformDebugBuild(_Wasm32WasiPlatformBuild):
kind = "pydebug"
append_suffix = ".debug"


class Wasm32WasiPlatformReleaseBuild(_Wasm32WasiPlatformBuild):
kind = "release"
append_suffix = ".release"


##############################################################################
################################ IOS BUILDS ################################
##############################################################################
Expand Down