From 23e64a353aff55534f63fcf139f6c864a15c3965 Mon Sep 17 00:00:00 2001 From: not-matthias Date: Fri, 5 Jun 2026 15:05:38 +0200 Subject: [PATCH] fix(valgrind): install libc6-dbg during valgrind setup GitHub runners do not ship libc debug symbols by default, which leads to unresolved symbols in exec CLI simulation benchmarks. Install libc6-dbg via apt on supported systems after installing valgrind. Fixes COD-2770 --- src/executor/helpers/apt.rs | 8 ++++++++ src/executor/valgrind/setup.rs | 10 +++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/executor/helpers/apt.rs b/src/executor/helpers/apt.rs index 8d430bdc..75bec936 100644 --- a/src/executor/helpers/apt.rs +++ b/src/executor/helpers/apt.rs @@ -87,6 +87,14 @@ where Ok(()) } +/// Returns whether a package is currently installed according to `dpkg`. +pub fn is_package_installed(package: &str) -> bool { + Command::new("dpkg") + .args(["-s", package]) + .output() + .is_ok_and(|output| output.status.success()) +} + pub fn install(system_info: &SystemInfo, packages: &[&str]) -> Result<()> { if !is_system_compatible(system_info) { bail!( diff --git a/src/executor/valgrind/setup.rs b/src/executor/valgrind/setup.rs index adcb0fc5..d5f75e44 100644 --- a/src/executor/valgrind/setup.rs +++ b/src/executor/valgrind/setup.rs @@ -177,7 +177,7 @@ fn is_valgrind_installed() -> bool { matches!( get_valgrind_status().status, ToolInstallStatus::Installed { .. } - ) + ) && apt::is_package_installed("libc6-dbg") } pub async fn install_valgrind( @@ -193,10 +193,14 @@ pub async fn install_valgrind( let binary = get_codspeed_valgrind_binary(system_info)?; let deb_path = env::temp_dir().join("valgrind-codspeed.deb"); download_pinned_file(binary, &deb_path).await?; - apt::install(system_info, &[deb_path.to_str().unwrap()])?; + + // Install libc debug symbols alongside valgrind, as GitHub runners + // do not include them by default. Keeping them in the same install + // call puts them under the same caching and idempotency logic. + apt::install(system_info, &[deb_path.to_str().unwrap(), "libc6-dbg"])?; // Return package names for caching - Ok(vec!["valgrind".to_string()]) + Ok(vec!["valgrind".to_string(), "libc6-dbg".to_string()]) }, ) .await