fix(valgrind): install libc6-dbg during valgrind setup#394
Conversation
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
Merging this PR will not alter performance
|
Greptile SummaryInstalls
Confidence Score: 3/5The change adds repeated apt-get update overhead to every CI run where valgrind is already cached, negating caching benefits. The libc6-dbg install sits outside the caching gate and will run apt-get update plus an install attempt on every CI invocation, including those that skip the valgrind installation entirely via the early-return path in apt::install_cached. src/executor/valgrind/setup.rs — specifically the placement of the apt::install call relative to the apt::install_cached early-return logic. Important Files Changed
|
| // Install libc debug symbols, as Github runners by default do not | ||
| // include them. Only install for supported systems. | ||
| apt::install(system_info, &["libc6-dbg"])?; |
There was a problem hiding this comment.
libc6-dbg installed unconditionally, bypassing the cache gate
apt::install_cached exits early (return Ok(())) when valgrind is already installed, but the new apt::install call for libc6-dbg sits outside that gate and runs on every install_valgrind invocation. This means every CI run where valgrind is cached will still execute apt-get update followed by an install attempt for libc6-dbg — adding the ~10 s overhead even when nothing needs to be installed. Including libc6-dbg inside the install_packages closure (alongside the valgrind .deb) would keep it under the same caching and idempotency logic, or at minimum a dpkg -s libc6-dbg check could guard the call.
| // Install libc debug symbols, as Github runners by default do not | ||
| // include them. Only install for supported systems. | ||
| apt::install(system_info, &["libc6-dbg"])?; |
There was a problem hiding this comment.
The comment "Only install for supported systems" implies a silent no-op on incompatible systems, but
apt::install actually propagates an error (bail!) when the system is incompatible. While install_valgrind is only reached on supported systems today, the comment is misleading about the runtime behaviour.
| // Install libc debug symbols, as Github runners by default do not | |
| // include them. Only install for supported systems. | |
| apt::install(system_info, &["libc6-dbg"])?; | |
| // Install libc debug symbols, as GitHub runners do not include them by | |
| // default. `apt::install` will error on unsupported systems, but this | |
| // function is only reachable when `is_codspeed_valgrind_installation_supported` | |
| // is true, so only compatible Linux distros reach this point. | |
| apt::install(system_info, &["libc6-dbg"])?; |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| }, | ||
| ) | ||
| .await | ||
| .await?; |
There was a problem hiding this comment.
Part of the cache in the action is to avoid having to do sudo apt update when not required, which can take quite a lot of time.
We should cache the output of libc dbg, because it can in practice ad 30 sec to 1 min to ci runs.apt.rs already exposes the cache helper it should work transparently
This takes around 10 seconds, so it shouldn't be an issue that it's not cached + prevents complexities of cache invalidation