From f27dd234ff0d67fcfa459e952cb30e3acc879507 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Thu, 2 Jul 2026 03:44:52 +0200 Subject: [PATCH 1/2] Add mechanism for specifying configure options per branch --- master/custom/factories.py | 18 ++++++++-- master/custom/workers.py | 68 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+), 2 deletions(-) diff --git a/master/custom/factories.py b/master/custom/factories.py index e0ded339..cd213692 100644 --- a/master/custom/factories.py +++ b/master/custom/factories.py @@ -119,6 +119,7 @@ def setup(self, branch, worker, test_with_PTY=False, **kwargs): oot_kwargs = {} configure_cmd = [configure_cmd, "--prefix", "$(PWD)/target"] configure_cmd += self.configureFlags + configure_cmd += worker.get_flags(branch, "configure") self.addStep( Configure(command=configure_cmd, **oot_kwargs) ) @@ -225,6 +226,7 @@ def setup(self, branch, worker, test_with_PTY=False, **kwargs): Configure( command=["./configure", "--prefix", "$(PWD)/target"] + self.configureFlags + + worker.get_flags(branch, "configure") ) ) @@ -620,10 +622,15 @@ class BaseWindowsBuild(BaseBuild): factory_tags = ["win32"] def setup(self, branch, worker, **kwargs): - build_command = self.build_command + self.buildFlags + build_command = ( + self.build_command + + self.buildFlags + + worker.get_flags(branch, "build") + ) test_command = [ *self.test_command, *self.testFlags, + *worker.get_flags(branch, "test"), *get_j_opts(worker, 2), ] if not has_option("-R", self.testFlags): @@ -631,6 +638,7 @@ def setup(self, branch, worker, **kwargs): clean_command = [ *self.clean_command, *self.cleanFlags, + *worker.get_flags(branch, "clean"), *get_j_opts(worker), ] self.addStep(Compile(command=build_command)) @@ -819,6 +827,7 @@ def setup(self, branch, worker, test_with_PTY=False, **kwargs): configure_cmd = list(self.host_configure_cmd) configure_cmd += ["--prefix", "$(PWD)/target/host"] configure_cmd += self.configureFlags + self.extra_configure_flags + configure_cmd += worker.get_flags(branch, "configure") configure_cmd += [util.Interpolate("--build=%(prop:build_triple)s")] configure_cmd += [f"--host={self.host}"] configure_cmd += ["--with-build-python=../build/python"] @@ -1142,6 +1151,7 @@ def py313_setup(self, branch, worker, test_with_PTY=False, **kwargs): configure_cmd = list(self.host_configure_cmd) configure_cmd += self.configureFlags configure_cmd += self.extra_configure_flags + configure_cmd += worker.get_flags(branch, "configure") configure_cmd += [ f"--with-openssl={support_path}/openssl", f"--build={self.arch}-apple-darwin", @@ -1361,7 +1371,11 @@ class ValgrindBuild(UnixBuild): def setup(self, branch, worker, **kwargs): self.addStep( Configure( - command=["./configure", "--prefix", "$(PWD)/target"] + self.configureFlags + command=( + ["./configure", "--prefix", "$(PWD)/target"] + + self.configureFlags + + worker.get_flags(branch, "configure") + ) ) ) diff --git a/master/custom/workers.py b/master/custom/workers.py index c0d95ff4..6f2bef3e 100644 --- a/master/custom/workers.py +++ b/master/custom/workers.py @@ -22,6 +22,64 @@ KEEPALIVE = 60 +class BranchWorkerFlags: + def __init__( + self, + *, + branches=None, + min_branch=None, + max_branch=None, + configure=(), + build=(), + test=(), + clean=(), + ): + if isinstance(branches, str): + self.branches = (branches,) + elif branches is not None: + self.branches = tuple(branches) + else: + self.branches = None + self.min_branch = min_branch + self.max_branch = max_branch + self.configure = self._as_tuple(configure) + self.build = self._as_tuple(build) + self.test = self._as_tuple(test) + self.clean = self._as_tuple(clean) + + @staticmethod + def _as_tuple(flags): + if isinstance(flags, str): + return (flags,) + return tuple(flags) + + def applies_to(self, branch): + if self.branches is not None and branch.name not in self.branches: + return False + + if self.min_branch is None and self.max_branch is None: + return True + + if branch.version_tuple is None: + return False + if self.min_branch is not None and branch.version_tuple < self.min_branch: + return False + if self.max_branch is not None and branch.version_tuple > self.max_branch: + return False + return True + + def get(self, kind): + if kind == "configure": + return self.configure + if kind == "build": + return self.build + if kind == "test": + return self.test + if kind == "clean": + return self.clean + raise ValueError(f"Unknown branch worker flag kind: {kind}") + + class CPythonWorker: def __init__( self, @@ -30,6 +88,7 @@ def __init__( tags=None, branches=None, not_branches=None, + branch_flags=(), parallel_builders=1, parallel_tests=None, timeout_factor=1, @@ -40,6 +99,7 @@ def __init__( self.tags = tags or set() self.branches = branches self.not_branches = not_branches + self.branch_flags = tuple(branch_flags) self.parallel_tests = parallel_tests self.timeout_factor = timeout_factor self.exclude_test_resources = exclude_test_resources or [] @@ -62,6 +122,14 @@ def __init__( max_builds=parallel_builders, ) + def get_flags(self, branch, kind): + flags = [] + for rule in self.branch_flags: + if rule.applies_to(branch): + flags.extend(rule.get(kind)) + return flags + + # Some of Itamar's workers are reprovisioned every Wednesday at 9am PT. # Builds scheduled between 8am - 10am PT on Wednesdays will be delayed to # 10am PT. From d893f4b97f76a4a6e54e950ca34c51df4a6af71a Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Thu, 2 Jul 2026 14:57:13 +0200 Subject: [PATCH 2/2] Add --with-dtrace to the cstratak workers on 3.15+ --- master/custom/workers.py | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/master/custom/workers.py b/master/custom/workers.py index 6f2bef3e..e4fd2ae0 100644 --- a/master/custom/workers.py +++ b/master/custom/workers.py @@ -163,11 +163,17 @@ def get_workers(settings): cpw( name="cstratak-fedora-rawhide-x86_64", tags=['linux', 'unix', 'fedora', 'amd64', 'x86-64'], + branch_flags=[ + BranchWorkerFlags(configure=["--with-dtrace"], min_branch=(3, 15)), + ], parallel_tests=10, ), cpw( name="cstratak-fedora-stable-x86_64", tags=['linux', 'unix', 'fedora', 'amd64', 'x86-64'], + branch_flags=[ + BranchWorkerFlags(configure=["--with-dtrace"], min_branch=(3, 15)), + ], parallel_tests=10, ), cpw( @@ -186,11 +192,17 @@ def get_workers(settings): cpw( name="cstratak-CentOS9-x86_64", tags=['linux', 'unix', 'rhel', 'amd64', 'x86-64'], + branch_flags=[ + BranchWorkerFlags(configure=["--with-dtrace"], min_branch=(3, 15)), + ], parallel_tests=6, ), cpw( name="cstratak-CentOS9-fips-x86_64", tags=['linux', 'unix', 'rhel', 'amd64', 'x86-64', 'fips'], + branch_flags=[ + BranchWorkerFlags(configure=["--with-dtrace"], min_branch=(3, 15)), + ], parallel_tests=6, # Only 3.12+ for FIPS builder not_branches=["3.10", "3.11"], @@ -198,12 +210,18 @@ def get_workers(settings): cpw( name="cstratak-fedora-rawhide-ppc64le", tags=['linux', 'unix', 'fedora', 'ppc64le'], + branch_flags=[ + BranchWorkerFlags(configure=["--with-dtrace"], min_branch=(3, 15)), + ], parallel_tests=10, timeout_factor=2, # Increase the timeout on this slow worker ), cpw( name="cstratak-fedora-stable-ppc64le", tags=['linux', 'unix', 'fedora', 'ppc64le'], + branch_flags=[ + BranchWorkerFlags(configure=["--with-dtrace"], min_branch=(3, 15)), + ], parallel_tests=10, timeout_factor=2, # Increase the timeout on this slow worker ), @@ -217,17 +235,26 @@ def get_workers(settings): cpw( name="cstratak-CentOS9-ppc64le", tags=['linux', 'unix', 'rhel', 'ppc64le'], + branch_flags=[ + BranchWorkerFlags(configure=["--with-dtrace"], min_branch=(3, 15)), + ], parallel_tests=10, timeout_factor=2, # Increase the timeout on this slow worker ), cpw( name="cstratak-fedora-rawhide-aarch64", tags=['linux', 'unix', 'fedora', 'arm', 'arm64', 'aarch64'], + branch_flags=[ + BranchWorkerFlags(configure=["--with-dtrace"], min_branch=(3, 15)), + ], parallel_tests=32, ), cpw( name="cstratak-fedora-stable-aarch64", tags=['linux', 'unix', 'fedora', 'arm', 'arm64', 'aarch64'], + branch_flags=[ + BranchWorkerFlags(configure=["--with-dtrace"], min_branch=(3, 15)), + ], parallel_tests=32, ), cpw( @@ -239,11 +266,17 @@ def get_workers(settings): cpw( name="cstratak-CentOS9-aarch64", tags=['linux', 'unix', 'rhel', 'arm', 'arm64', 'aarch64'], + branch_flags=[ + BranchWorkerFlags(configure=["--with-dtrace"], min_branch=(3, 15)), + ], parallel_tests=32, ), cpw( name="cstratak-CentOS10-aarch64", tags=['linux', 'unix', 'rhel', 'arm', 'arm64', 'aarch64'], + branch_flags=[ + BranchWorkerFlags(configure=["--with-dtrace"], min_branch=(3, 15)), + ], parallel_tests=32, ), cpw( @@ -262,11 +295,17 @@ def get_workers(settings): cpw( name="cstratak-fedora-rawhide-s390x", tags=['linux', 'unix', 'fedora', 's390x'], + branch_flags=[ + BranchWorkerFlags(configure=["--with-dtrace"], min_branch=(3, 15)), + ], parallel_tests=10, ), cpw( name="cstratak-fedora-stable-s390x", tags=['linux', 'unix', 'fedora', 's390x'], + branch_flags=[ + BranchWorkerFlags(configure=["--with-dtrace"], min_branch=(3, 15)), + ], parallel_tests=10, ), cpw( @@ -278,6 +317,9 @@ def get_workers(settings): cpw( name="cstratak-rhel9-s390x", tags=['linux', 'unix', 'rhel', 's390x'], + branch_flags=[ + BranchWorkerFlags(configure=["--with-dtrace"], min_branch=(3, 15)), + ], parallel_tests=10, ), cpw(