From bc8f069d18c5de3dee04ae303227a255248efc1e Mon Sep 17 00:00:00 2001 From: aur-build Date: Thu, 19 Nov 2026 11:17:27 +0000 Subject: pipeline: replace the devtools chroot with pinned pacman -U provisioning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The chroot step existed to run mkarchroot/makechrootpkg, whose sudo requirement was the whole reason a build had to run on the hub under root-adjacent rules. The sandbox model makes the chroot redundant: the sandbox boots from a base that already carries the official packages, and step 2 now provisions it with a lease manifest instead — every dependency we publish, pinned to the exact version and digest of the artifact the index serves. The hub re-hashes every blob before staging it, installs with pacman -U (no -Sy, no live resolution, no mirror at build time), and the sandbox's own pacman -Q must confirm the pinned world landed before a build may start. A byte that hashes differently, or a world that drifted, fails closed. The build step is now plain makepkg -c -f: no -s (dependencies arrive installed; resolving at build time is what the pinning model forbids) and no -si (ingest signs). mkarchroot/makechrootpkg are gone from the pipeline and the config; their shims stay as stand-ins for the real devtools so the shim protocol itself remains exercised. The shim pacman grew a real fake installed-database: -U refuses bytes that do not hash to the digest their name claims, -Q reports what landed, so the world check is a test and not a no-op. --- src/sandbox/loopback.rs | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'src/sandbox/loopback.rs') diff --git a/src/sandbox/loopback.rs b/src/sandbox/loopback.rs index 1b31b1a..8e9f52d 100644 --- a/src/sandbox/loopback.rs +++ b/src/sandbox/loopback.rs @@ -65,12 +65,30 @@ impl Sandbox for LoopbackSandbox { } fn run(&self, cmd: &Cmd, on_log: &mut dyn FnMut(&[u8])) -> Result { - let argv0 = cmd - .argv - .first() - .ok_or_else(|| Error::invalid("sandbox command has no argv[0]"))?; - let mut c = std::process::Command::new(argv0); - c.args(&cmd.argv[1..]); + if cmd.argv.is_empty() { + return Err(Error::invalid("sandbox command has no argv[0]")); + } + // Expand `blob:` argv elements to the staged blob's path — + // the loopback sandbox's blob dir is "inside the sandbox" as much as + // anything here is. An unstaged blob is a caller bug and fails closed. + let mut argv: Vec = Vec::with_capacity(cmd.argv.len()); + for a in &cmd.argv { + match a.strip_prefix("blob:") { + Some(digest) => { + let path = self.blob_path(digest)?; + if !path.exists() { + return Err(Error::fail_closed(format!( + "blob {digest} was never staged in sandbox {}", + self.id + ))); + } + argv.push(path.display().to_string()); + } + None => argv.push(a.clone()), + } + } + let mut c = std::process::Command::new(&argv[0]); + c.args(&argv[1..]); if let Some(dir) = &cmd.cwd { c.current_dir(dir); } -- cgit v1.2.3