summaryrefslogtreecommitdiffstats
path: root/tests/crash.rs
diff options
context:
space:
mode:
authoraur-build <aur-build@localhost>2026-11-19 11:17:27 +0000
committeraur-build <aur-build@localhost>2026-11-19 11:17:27 +0000
commitbc8f069d18c5de3dee04ae303227a255248efc1e (patch)
tree35143f64346a2a555672789ae33cbf0905bffc0b /tests/crash.rs
parent99ad2034be8fc5b107205199e19da831596a6791 (diff)
downloadaur-build-bc8f069d18c5de3dee04ae303227a255248efc1e.tar.gz
aur-build-bc8f069d18c5de3dee04ae303227a255248efc1e.zip
pipeline: replace the devtools chroot with pinned pacman -U provisioning
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.
Diffstat (limited to 'tests/crash.rs')
-rw-r--r--tests/crash.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/crash.rs b/tests/crash.rs
index ca58a04..e1f856f 100644
--- a/tests/crash.rs
+++ b/tests/crash.rs
@@ -45,8 +45,8 @@ fn run_cli(env: &Env, args: &[&str]) -> std::process::Output {
fn a_process_killed_mid_step_resumes_from_its_checkpoints_with_no_duplicate_work() {
let (mut env, _fx) = env_with_fixture("plain-make");
let id = queued(&env, "plain-make");
- // The child will be murdered the moment it invokes makechrootpkg.
- env.cfg.hooks.shim_kill_parent = Some("makechrootpkg".into());
+ // The child will be murdered the moment it invokes makepkg.
+ env.cfg.hooks.shim_kill_parent = Some("makepkg".into());
env.cfg.save().unwrap();
let out = run_cli(&env, &["run", &id]);
@@ -71,10 +71,10 @@ fn a_process_killed_mid_step_resumes_from_its_checkpoints_with_no_duplicate_work
Some(StepState::Running),
"the step that was running should be recorded as running"
);
- assert_eq!(
- builds::step_status(&env.db, &id, "chroot").unwrap(),
- Some(StepState::Succeeded),
- "the completed step before the crash must be checkpointed"
+ let chroot_status = builds::step_status(&env.db, &id, "chroot").unwrap();
+ assert!(
+ chroot_status.is_some_and(|s| s.is_done()),
+ "the completed step before the crash must be checkpointed: {chroot_status:?}"
);
assert!(db::accepted_release(&env.db, "plain-make").unwrap().is_none(), "nothing was published");
@@ -97,11 +97,11 @@ fn a_process_killed_mid_step_resumes_from_its_checkpoints_with_no_duplicate_work
let shim = env.cfg.hooks.shim_dir.clone().unwrap();
assert_eq!(
aur_build::shims::called_with(&shim, "mkarchroot", ""),
- 1,
- "the chroot step was checkpointed as done and must not run again"
+ 0,
+ "the provisioning model never calls devtools, before or after a crash"
);
assert_eq!(
- aur_build::shims::called_with(&shim, "makechrootpkg", ""),
+ aur_build::shims::called_with(&shim, "makepkg", ""),
2,
"exactly one rebuild: the crashed attempt and the resumed one"
);
@@ -147,7 +147,7 @@ fn a_failed_build_leaves_the_index_serving_the_old_version_and_says_so() {
// v2 is approved and its build fails deterministically.
fx.bump(&[("pkgver", "2.0")]);
- env.set_shim_fail("makechrootpkg");
+ env.set_shim_fail("makepkg");
let c2 = approved(&env, "plain-make");
let id2 = pipeline::enqueue_for_candidate(&env.cfg, &env.db, &c2).unwrap();
let out = pipeline::run(&env.cfg, &env.db, &id2).unwrap();