Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix pkg-config cross build, add suffix to create unique workers
  • Loading branch information
tiran committed Jun 14, 2022
commit e6e71feadc6e006ec0f353518962fe5cbf12931f
29 changes: 27 additions & 2 deletions master/custom/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,7 @@ class Wasm32EmscriptenBuild(UnixCrossBuild):


class Wasm32EmscriptenNodeBuild(Wasm32EmscriptenBuild):
buildersuffix = ".emscripten-node"
extra_configure_flags = [
"--with-emscripten-target=node",
"--disable-wasm-dynamic-linking",
Expand All @@ -768,6 +769,7 @@ class Wasm32EmscriptenNodeBuild(Wasm32EmscriptenBuild):


class Wasm32EmscriptenBrowserBuild(Wasm32EmscriptenBuild):
buildersuffix = ".emscripten-browser"
extra_configure_flags = [
"--with-emscripten-target=browser",
"--enable-wasm-dynamic-linking",
Expand All @@ -785,19 +787,42 @@ class Wasm32WASIBuild(UnixCrossBuild):
* ccache must be installed
* wasmtime must be installed and on PATH
"""
buildersuffix = ".wasi"
factory_tags = ["wasm", "wasi"]
extra_configure_flags = [
# debug builds exhaust the limited call stack on WASI
"--without-pydebug"
"--disable-ipv6",
Comment thread
emmatyping marked this conversation as resolved.
]
wasi_sdk = "/opt/wasi-sdk"
wasi_sysroot = f"{wasi_sdk}/share/wasi-sysroot"
wasix = "/opt/wasix"
compile_environ = {
"CONFIG_SITE": "../../Tools/wasm/config.site-wasm32-wasi",
# use Clang from WASI-SDK
"CC": f"ccache {wasi_sdk}/bin/clang",
"LDSHARED": f"{wasi_sdk}/bin/wasm-ld",
"AR": f"{wasi_sdk}/bin/llvm-ar",
# use WASIX library with POSIX stubs
"CFLAGS": f"-isystem {wasix}/include",
"LDLAGS": f"-L{wasix}/lib -lwasix",
"LDFLAGS": f"-L{wasix}/lib -lwasix",
# WASI-SDK does not have a 'wasm32-unknown-wasi-pkg-config' script
# force pkg-config into cross-compiling mode
"PKG_CONFIG_PATH": "",
"PKG_CONFIG_SYSROOT_DIR": wasi_sysroot,
"PKG_CONFIG_LIBDIR": f"{wasi_sysroot}/lib/pkgconfig:{wasi_sysroot}/share/pkgconfig",
}
host = "wasm32-unknown-wasi"
host_configure_cmd = ["../../configure"]

def setup(self, parallel, branch, test_with_PTY=False, **kwargs):
self.addStep(
ShellCommand(
name="Touch srcdir Modules/Setup.local",
description="Hack to work around wasmtime mapdir issue",
command=["touch", "Modules/Setup.local"],
haltOnFailure=True,
)
)
super().setup(
parallel, branch, test_with_PTY=test_with_PTY, **kwargs
)
11 changes: 8 additions & 3 deletions master/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,14 @@ for branch_num, (git_url, branchname, git_branch) in enumerate(git_branches):
branch=branchname,
**extra_factory_args.get(worker, {}),
)
tags = [branchname, stability,] + getattr(f, "tags", [])
if tier:
tags.append(tier)

# Only 3.11+ for WebAssembly builds
if "wasm" in tags and branchname in {"3.8", "3.9", "3.10"}:
continue

if name in DAILYBUILDERS:
dailybuildernames.append(buildername)
else:
Expand All @@ -249,9 +257,6 @@ for branch_num, (git_url, branchname, git_branch) in enumerate(git_branches):
# disable GitHub notifications for unstable builders
if stability == STABLE:
github_status_builders.append(buildername)
tags = [branchname, stability,] + getattr(f, "tags", [])
if tier:
tags.append(tier)
c["builders"].append(
util.BuilderConfig(
name=buildername,
Expand Down