summaryrefslogtreecommitdiffstats
path: root/src/shims/mod.rs
diff options
context:
space:
mode:
authoraur-build <aur-build@localhost>2026-11-18 22:45:28 +0000
committeraur-build <aur-build@localhost>2026-11-18 22:45:28 +0000
commit99ad2034be8fc5b107205199e19da831596a6791 (patch)
tree8b49bd4f72101a21fbf5924d0ad5bb8c4b07476c /src/shims/mod.rs
parent632a08c8543f0db533efc7bfb6728b50a77ae3d8 (diff)
downloadaur-build-99ad2034be8fc5b107205199e19da831596a6791.tar.gz
aur-build-99ad2034be8fc5b107205199e19da831596a6791.zip
pipeline: signing moves from the build step to hub-side ingest
The build step used to pass -si<key> through makechrootpkg, which meant whatever machine ran the build had to hold the signing key - fine for a chroot on the hub, disqualifying for a remote sandbox. The build now produces unsigned bytes; ingest signs the exact bytes that entered the store, with the same key and code path that signs the database, and a gpg failure fails the build closed. verify() no longer checks for a build-made signature: the meaningful guarantee moved to 'ingest produced one or the build failed'. The shim makechrootpkg now only emits .sig when -si is passed, like the real tool, so the suite cannot accidentally test a signing path that no longer exists.
Diffstat (limited to 'src/shims/mod.rs')
-rw-r--r--src/shims/mod.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/shims/mod.rs b/src/shims/mod.rs
index a34cf7d..c1b169c 100644
--- a/src/shims/mod.rs
+++ b/src/shims/mod.rs
@@ -247,7 +247,7 @@ pub fn mkarchroot(args: &[String]) -> Result<i32, String> {
Ok(0)
}
-/// `makechrootpkg -c -r <chroot> -- -si<key> -f`, run with cwd = the build dir.
+/// `makechrootpkg -c -r <chroot> -- -f`, run with cwd = the build dir.
///
/// Emits one `.pkg.tar.zst` per package in the manifest into the current
/// directory, exactly where the real tool leaves them.
@@ -281,10 +281,15 @@ pub fn makechrootpkg(args: &[String], m: &Manifest) -> Result<i32, String> {
));
}
let pkgs = packages_to_emit(m, &startdir);
+ // Sign only when the caller asked for it, like the real tool: signing is
+ // `-si<key>`/`-i`, and the pipeline stopped passing it when signing moved
+ // hub-side to ingest. A shim that signed anyway would hide that move from
+ // every test in the suite.
+ let wants_sig = args.iter().any(|a| a.starts_with("-si") || a == "-i" || a == "--sign");
for p in &pkgs {
let path = write_package(&startdir, p, m)?;
println!("==> Creating package '{}'", path.file_name().unwrap().to_string_lossy());
- if m.sig {
+ if m.sig && wants_sig {
if let Ok(bytes) = std::fs::read(&path) {
let sig = path.with_extension("pkg.tar.zst.sig");
let _ = std::fs::write(&sig, fake_sig(&bytes));