diff --git a/rust/src/composepost.rs b/rust/src/composepost.rs index 1a5ae86937..c29d1c8c33 100644 --- a/rust/src/composepost.rs +++ b/rust/src/composepost.rs @@ -1201,7 +1201,18 @@ fn workaround_selinux_cross_labeling_recurse( /// This is the nearly the last code executed before we run `ostree commit`. pub fn compose_postprocess_final(rootfs_dfd: i32, _treefile: &Treefile) -> CxxResult<()> { let rootfs = unsafe { &crate::ffiutil::ffi_dirfd(rootfs_dfd)? }; - + if std::process::Command::new("add-determinism").status().expect("Failed to find add-determinism on system.").success() { + // add-determinism --handler pyc-zero-mtime + let r = std::process::Command::new("add-determinism") + .arg("--handler") + .arg("pyc-zero-mtime") + .arg("/usr") + .status() + .expect("Failed to normalize .pyc files using add-determinism"); + if !r.success() { + return Err(anyhow!("Failed to execute add-determinism --handler pyc-zero-mtime: {:?}", r).into()); + } + } hardlink_rpmdb_base_location(rootfs, None)?; Ok(()) }