From eaa155a68be6c00f2fc69233e598e8e70defcc47 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Sun, 19 Oct 2025 18:39:19 -0400 Subject: [PATCH 1/2] ostree-ext: Add .context for some more errors This suddenly started in our RPM (COPR/mock) builds, my suspicion is that seccomp got turned on inadvertently, but let's add some error context here on general principle. ``` thread 'boundimage::tests::test_parse_spec_dir' panicked at crates/lib/src/boundimage.rs:290:49: called `Result::unwrap()` on an `Err` value: Querying bound images Caused by: Function not implemented (os error 38) note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` Signed-off-by: Colin Walters --- crates/ostree-ext/src/globals.rs | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/crates/ostree-ext/src/globals.rs b/crates/ostree-ext/src/globals.rs index a60ce56d7..8f3377022 100644 --- a/crates/ostree-ext/src/globals.rs +++ b/crates/ostree-ext/src/globals.rs @@ -1,9 +1,11 @@ //! Module containing access to global state. use super::Result; +use anyhow::Context; use camino::{Utf8Path, Utf8PathBuf}; use cap_std_ext::cap_std::fs::Dir; use cap_std_ext::RootDir; +use fn_error_context::context; use ostree::glib; use std::fs::File; use std::sync::OnceLock; @@ -61,17 +63,26 @@ impl ConfigPaths { let p = p.as_ref(); let mut runtime = self.runtime.clone(); runtime.push(p); - if let Some(f) = root.open_optional(&runtime)? { + if let Some(f) = root + .open_optional(&runtime) + .context("Opening runtime auth file")? + { return Ok(Some((runtime, f))); } let mut persistent = self.persistent.clone(); persistent.push(p); - if let Some(f) = root.open_optional(&persistent)? { + if let Some(f) = root + .open_optional(&persistent) + .context("Opening persistent auth file")? + { return Ok(Some((persistent, f))); } if let Some(mut system) = self.system.clone() { system.push(p); - if let Some(f) = root.open_optional(&system)? { + if let Some(f) = root + .open_optional(&system) + .context("Opening system auth file")? + { return Ok(Some((system, f))); } } @@ -80,8 +91,9 @@ impl ConfigPaths { } /// Return the path to the global container authentication file, if it exists. +#[context("Loading global authfile")] pub fn get_global_authfile(root: &Dir) -> Result> { - let root = &RootDir::new(root, ".")?; + let root = &RootDir::new(root, ".").context("Opening RootDir")?; let am_uid0 = rustix::process::getuid() == rustix::process::Uid::ROOT; get_global_authfile_impl(root, am_uid0) } From 33bdd01f7bd28b5b6982c3922f11c88522b7e46e Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 21 Oct 2025 17:05:18 -0400 Subject: [PATCH 2/2] build-sys/rpm: Disable unit tests if we detect we're in seccomp Workaround for https://github.com/rpm-software-management/mock/pull/1613#issuecomment-3421908652 Signed-off-by: Colin Walters --- contrib/packaging/bootc.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/packaging/bootc.spec b/contrib/packaging/bootc.spec index 1e5c10ecd..646ad619d 100644 --- a/contrib/packaging/bootc.spec +++ b/contrib/packaging/bootc.spec @@ -143,7 +143,11 @@ find %{?buildroot}/%{_docdir} ! -type d -printf '%{_docdir}/%%P\n' > bootcdoclis %if %{with check} %check -%cargo_test +if grep -qEe 'Seccomp:.*0$' /proc/self/status; then + %cargo_test +else + echo "skipping unit tests due to https://github.com/rpm-software-management/mock/pull/1613#issuecomment-3421908652" +fi %endif %files -f bootcdoclist.txt