Containerize local builds with rootless nerdctl

This commit is contained in:
ms2k 2026-08-18 01:36:48 +09:00
commit 30fc02d79f

View file

@ -448,6 +448,27 @@ class VerificationTests(unittest.TestCase):
(ROOT / "patches/gvisor-9f8f6c917-MODULE.bazel.lock").is_file()
)
def test_canonical_build_uses_one_unprivileged_nerdctl_container(self) -> None:
build = (ROOT / "tools/build").read_text()
containerfile = (ROOT / "tools/container/Containerfile").read_text()
installer = (ROOT / "tools/install-to-host").read_text()
materializer = (ROOT / "tools/materialize-runsc").read_text()
self.assertIn("nerdctl build", build)
self.assertIn("nerdctl run --rm", build)
self.assertIn("tools/materialize-runsc --build", build)
self.assertIn("cargo build", build)
self.assertIn("GIT_CEILING_DIRECTORIES=/workspace", build)
self.assertNotIn("--privileged", build)
self.assertNotIn("docker.sock", build)
self.assertIn("rust:1.97.0-bookworm@sha256:", containerfile)
self.assertIn("ARG BAZEL_VERSION=8.3.1", containerfile)
self.assertIn("tools/build", installer)
self.assertNotIn("cargo build", installer)
self.assertNotIn("readelf", installer)
self.assertIn("bazel build", materializer)
self.assertNotIn("make -C", materializer)
def test_workspace_tests_use_nextest_and_cargo_retains_doctests(self) -> None:
source = (ROOT / "tools/lazaret_verify.py").read_text()
expected = [