Skip to content

Commit 5a1963a

Browse files
committed
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
1 parent 9793aaf commit 5a1963a

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

src/executor/helpers/apt.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,14 @@ where
8787
Ok(())
8888
}
8989

90+
/// Returns whether a package is currently installed according to `dpkg`.
91+
pub fn is_package_installed(package: &str) -> bool {
92+
Command::new("dpkg")
93+
.args(["-s", package])
94+
.output()
95+
.is_ok_and(|output| output.status.success())
96+
}
97+
9098
pub fn install(system_info: &SystemInfo, packages: &[&str]) -> Result<()> {
9199
if !is_system_compatible(system_info) {
92100
bail!(

src/executor/valgrind/setup.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ fn is_valgrind_installed() -> bool {
177177
matches!(
178178
get_valgrind_status().status,
179179
ToolInstallStatus::Installed { .. }
180-
)
180+
) && apt::is_package_installed("libc6-dbg")
181181
}
182182

183183
pub async fn install_valgrind(
@@ -193,10 +193,14 @@ pub async fn install_valgrind(
193193
let binary = get_codspeed_valgrind_binary(system_info)?;
194194
let deb_path = env::temp_dir().join("valgrind-codspeed.deb");
195195
download_pinned_file(binary, &deb_path).await?;
196-
apt::install(system_info, &[deb_path.to_str().unwrap()])?;
196+
197+
// Install libc debug symbols alongside valgrind, as GitHub runners
198+
// do not include them by default. Keeping them in the same install
199+
// call puts them under the same caching and idempotency logic.
200+
apt::install(system_info, &[deb_path.to_str().unwrap(), "libc6-dbg"])?;
197201

198202
// Return package names for caching
199-
Ok(vec!["valgrind".to_string()])
203+
Ok(vec!["valgrind".to_string(), "libc6-dbg".to_string()])
200204
},
201205
)
202206
.await

0 commit comments

Comments
 (0)