(
system_info: &SystemInfo,
setup_cache_dir: Option<&Path>,
)
| 192 | } |
| 193 | |
| 194 | pub async fn install_valgrind( |
| 195 | system_info: &SystemInfo, |
| 196 | setup_cache_dir: Option<&Path>, |
| 197 | ) -> Result<()> { |
| 198 | apt::install_cached( |
| 199 | system_info, |
| 200 | setup_cache_dir, |
| 201 | || is_valgrind_installed(system_info), |
| 202 | || async { |
| 203 | debug!("Installing valgrind"); |
| 204 | let binary = get_codspeed_valgrind_binary(system_info)?; |
| 205 | let deb_path = env::temp_dir().join("valgrind-codspeed.deb"); |
| 206 | download_pinned_file(binary, &deb_path).await?; |
| 207 | |
| 208 | // Install libc debug symbols alongside valgrind, as GitHub runners |
| 209 | // do not include them by default. Keeping them in the same install |
| 210 | // call puts them under the same caching and idempotency logic. |
| 211 | apt::install(system_info, &[deb_path.to_str().unwrap(), "libc6-dbg"])?; |
| 212 | |
| 213 | // Return package names for caching |
| 214 | Ok(vec!["valgrind".to_string(), "libc6-dbg".to_string()]) |
| 215 | }, |
| 216 | ) |
| 217 | .await |
| 218 | } |
| 219 | |
| 220 | #[cfg(test)] |
| 221 | mod tests { |
no test coverage detected