From b5b7381248e717df44de7c8706cbe78212a3dd0d Mon Sep 17 00:00:00 2001 From: Fred E <7602667+wallscaler@users.noreply.github.com> Date: Sun, 2 Aug 2026 03:16:12 -0400 Subject: [PATCH 1/2] fix(gate0): provision fixture build backend --- scripts/dev-env.sh | 3 ++- tests/_bundle_fixture.py | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/dev-env.sh b/scripts/dev-env.sh index b3f7a47..c3b5c4c 100755 --- a/scripts/dev-env.sh +++ b/scripts/dev-env.sh @@ -21,6 +21,7 @@ set -euo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" VENV="${CATHEDRAL_DEV_VENV:-$ROOT/.venv}" PYTEST_PIN="pytest==8.3.0" +SETUPTOOLS_PIN="setuptools==80.9.0" find_supported_python() { if [ -n "${PYTHON:-}" ]; then echo "$PYTHON"; return; fi @@ -45,7 +46,7 @@ if [ ! -x "$VENV/bin/python" ]; then "$BASE" -m venv "$VENV" fi "$VENV/bin/python" -m pip install --quiet --upgrade pip -"$VENV/bin/python" -m pip install --quiet "$PYTEST_PIN" +"$VENV/bin/python" -m pip install --quiet "$PYTEST_PIN" "$SETUPTOOLS_PIN" echo "provisioned $VENV" echo " python: $("$VENV/bin/python" -V 2>&1)" diff --git a/tests/_bundle_fixture.py b/tests/_bundle_fixture.py index 5169a96..cbf11ec 100644 --- a/tests/_bundle_fixture.py +++ b/tests/_bundle_fixture.py @@ -249,7 +249,14 @@ def _wheel(self, name: str, module: str, scripts: dict[str, str], extra_dep: str f'[build-system]\nrequires=["setuptools"]\nbuild-backend="setuptools.build_meta"\n' f'[project]\nname="{name}"\nversion="0.0.1"\n{dep}[project.scripts]\n{eps}' f'[tool.setuptools.packages.find]\nwhere=["."]\n') - subprocess.run([str(self.trusted), "-m", "pip", "wheel", "--no-build-isolation", "--no-deps", + # Build the synthetic test wheels with the Gate 0 development + # environment. The trusted parent is intentionally a bare CPython on + # some supported hosts, including setup-python, and is tested as such by + # the real installer path below. Requiring a build backend in that bare + # parent makes every test fail during fixture setup before the installer + # is exercised. The development environment pins setuptools, so this + # remains reproducible and offline after provisioning. + subprocess.run([sys.executable, "-m", "pip", "wheel", "--no-build-isolation", "--no-deps", "-w", str(self.wheelhouse), str(src)], check=True, capture_output=True) return next(self.wheelhouse.glob(f"{name.replace('-', '_')}-*.whl")) From 3b4c5baf1d192842228cdb5ec6a87c5a0e66af61 Mon Sep 17 00:00:00 2001 From: Fred E <7602667+wallscaler@users.noreply.github.com> Date: Sun, 2 Aug 2026 03:16:17 -0400 Subject: [PATCH 2/2] test(gate0): use verified lifecycle executables --- tests/test_gate0.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/tests/test_gate0.py b/tests/test_gate0.py index 917ba4e..f6aea8b 100644 --- a/tests/test_gate0.py +++ b/tests/test_gate0.py @@ -5674,9 +5674,13 @@ def _crash_public_start(self, role: str, run_id: str): "from test_gate0 import _StubEngine\n" "class _LongRunning(_StubEngine):\n" " def operate_argv(self, _cfg, *, dry_run=False):\n" - # A detached descendant plus a foreground process: killing the launcher - # leaves the descendant behind exactly as a real crash would. - " return ['/bin/sh', '-c', 'sleep 90 & sleep 120']\n" + # Run through the verified generation's regular-file interpreter, just + # like every production adapter runs a verified venv entrypoint. Using + # /bin/sh here made the fixture platform-dependent because it is a + # symlink on Ubuntu and the runtime correctly refuses symlinked launch + # targets with O_NOFOLLOW. + " body = 'import os,time\\nif os.fork() == 0: time.sleep(90)\\ntime.sleep(120)'\n" + " return [str(self.verified.bin('python')), '-c', body]\n" " def operate_env(self, _cfg):\n" " return {}\n" " def child_env(self, _cfg=None):\n" @@ -6548,7 +6552,11 @@ def _public_start(self, role: str, run_id: str, body: str): "from test_gate0 import _StubEngine\n" "class _Detaching(_StubEngine):\n" " def operate_argv(self, _cfg, *, dry_run=False):\n" - f" return ['/usr/bin/python3', '-c', {body!r}, " + # Keep the fixture inside the same verified-generation boundary as the + # production adapters. /usr/bin/python3 is normally a symlink on + # Debian and Ubuntu, while signed release entrypoints are required to + # be regular files before a generation is admitted. + f" return [str(self.verified.bin('python')), '-c', {body!r}, " f"{str(self.home / 'detached.pid')!r}]\n" " def operate_env(self, _cfg):\n" " return {}\n" @@ -6584,7 +6592,11 @@ def test_a_detached_child_blocks_stop_deletion_and_a_second_start(self): if ownership is not None and ownership.spawn_state == run_state.SPAWN_OWNED: break if launcher.poll() is not None: - self.fail(f"the public start exited early: {launcher.stderr.read()[:900]}") + self.fail( + "the public start exited early: " + f"stdout={launcher.stdout.read()[:900]} " + f"stderr={launcher.stderr.read()[:900]}" + ) time.sleep(0.1) self.assertIsNotNone(ownership)