Skip to content

Commit 0ebd518

Browse files
authored
Merge pull request #1547 from cgwalters/workaround-buildinfo
build-sys: Work around #1546
2 parents fd1e538 + d61f681 commit 0ebd518

File tree

3 files changed

+37
-7
lines changed

3 files changed

+37
-7
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,7 @@ fi
9393
# tests to know we're doing upstream CI.
9494
touch /usr/lib/.bootc-dev-stamp
9595
# And test our own linting
96+
## Workaround for https://github.com/bootc-dev/bootc/issues/1546
97+
rm -rf /root/buildinfo
9698
bootc container lint --fatal-warnings
9799
EORUN

crates/ostree-ext/src/sysroot.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,9 @@ impl SysrootLock {
3737
/// immediately, a status message will be printed to standard output.
3838
/// The lock will be unlocked when this object is dropped.
3939
pub async fn new_from_sysroot(sysroot: &ostree::Sysroot) -> Result<Self> {
40-
if sysroot.try_lock()? {
41-
return Ok(Self {
42-
sysroot: sysroot.clone(),
43-
unowned: false,
44-
});
45-
}
46-
async_task_with_spinner("Waiting for sysroot lock...", sysroot.lock_future()).await?;
40+
let sysroot_clone = sysroot.clone();
41+
let locker = tokio::task::spawn_blocking(move || sysroot_clone.lock());
42+
async_task_with_spinner("Waiting for sysroot lock...", locker).await??;
4743
Ok(Self {
4844
sysroot: sysroot.clone(),
4945
unowned: false,
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Verify we can spawn multiple bootc status at the same time
2+
use std assert
3+
use tap.nu
4+
5+
tap begin "concurrent bootc status"
6+
7+
# Fork via systemd-run
8+
let n = 10
9+
0..$n | each { |v|
10+
# Clean up prior runs
11+
systemctl stop $"bootc-status-($v)" | complete
12+
}
13+
# Fork off a concurrent bootc status
14+
0..$n | each { |v|
15+
systemd-run --no-block -qr -u $"bootc-status-($v)" bootc status
16+
}
17+
18+
# Await completion
19+
0..$n | each { |v|
20+
loop {
21+
let r = systemctl is-active $"bootc-status-($v)" | complete
22+
if $r.exit_code == 0 {
23+
break
24+
}
25+
# check status
26+
systemctl status $"bootc-status-($v)" out> /dev/null
27+
# Clean it up
28+
systemctl reset-failed $"bootc-status-($v)"
29+
}
30+
}
31+
32+
tap ok

0 commit comments

Comments
 (0)