From 926dec188d83f68b623b4370a4a1a914adbafaa3 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 25 Aug 2025 09:11:30 -0400 Subject: [PATCH 1/2] build-sys: Work around #1546 While we work to fix the base image (again). Signed-off-by: Colin Walters --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index c7b1d519a..3f1c747a6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -93,5 +93,7 @@ fi # tests to know we're doing upstream CI. touch /usr/lib/.bootc-dev-stamp # And test our own linting +## Workaround for https://github.com/bootc-dev/bootc/issues/1546 +rm -rf /root/buildinfo bootc container lint --fatal-warnings EORUN From d61f681c4e50bf765a41cc45e6400be3acf23fa5 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 25 Aug 2025 15:35:43 -0400 Subject: [PATCH 2/2] sysroot: Fix regression in status locking The previous locking code was just wrong; my bad for not stress testing it. Fix it an add a test too. Signed-off-by: Colin Walters --- crates/ostree-ext/src/sysroot.rs | 10 ++---- .../booted/readonly/030-test-locking-read.nu | 32 +++++++++++++++++++ 2 files changed, 35 insertions(+), 7 deletions(-) create mode 100644 tmt/tests/booted/readonly/030-test-locking-read.nu diff --git a/crates/ostree-ext/src/sysroot.rs b/crates/ostree-ext/src/sysroot.rs index b6f00b7f1..7ba0db7a8 100644 --- a/crates/ostree-ext/src/sysroot.rs +++ b/crates/ostree-ext/src/sysroot.rs @@ -37,13 +37,9 @@ impl SysrootLock { /// immediately, a status message will be printed to standard output. /// The lock will be unlocked when this object is dropped. pub async fn new_from_sysroot(sysroot: &ostree::Sysroot) -> Result { - if sysroot.try_lock()? { - return Ok(Self { - sysroot: sysroot.clone(), - unowned: false, - }); - } - async_task_with_spinner("Waiting for sysroot lock...", sysroot.lock_future()).await?; + let sysroot_clone = sysroot.clone(); + let locker = tokio::task::spawn_blocking(move || sysroot_clone.lock()); + async_task_with_spinner("Waiting for sysroot lock...", locker).await??; Ok(Self { sysroot: sysroot.clone(), unowned: false, diff --git a/tmt/tests/booted/readonly/030-test-locking-read.nu b/tmt/tests/booted/readonly/030-test-locking-read.nu new file mode 100644 index 000000000..cb8be9fa0 --- /dev/null +++ b/tmt/tests/booted/readonly/030-test-locking-read.nu @@ -0,0 +1,32 @@ +# Verify we can spawn multiple bootc status at the same time +use std assert +use tap.nu + +tap begin "concurrent bootc status" + +# Fork via systemd-run +let n = 10 +0..$n | each { |v| + # Clean up prior runs + systemctl stop $"bootc-status-($v)" | complete +} +# Fork off a concurrent bootc status +0..$n | each { |v| + systemd-run --no-block -qr -u $"bootc-status-($v)" bootc status +} + +# Await completion +0..$n | each { |v| + loop { + let r = systemctl is-active $"bootc-status-($v)" | complete + if $r.exit_code == 0 { + break + } + # check status + systemctl status $"bootc-status-($v)" out> /dev/null + # Clean it up + systemctl reset-failed $"bootc-status-($v)" + } +} + +tap ok