Libc-dbg install triggers despite cache restore - #509
Conversation
Merging this PR will not alter performance
|
6d9a1ae to
d3a5ace
Compare
The setup cache restores package files onto the root filesystem without touching dpkg's database, so `dpkg -s libc6-dbg` reported the package as missing after a cache restore and valgrind's dependencies were reinstalled on every run. Probe the system libc for a resolvable separate debug file instead, using the same build-id and `.gnu_debuglink` lookup GDB and valgrind perform. The lookup moves from `wall_time::profiler::perf::elf_helper` to a shared `executor::helpers::debug_file` module; perf's debug-info and module-symbol resolution now go through it, unchanged. `apt::is_package_installed` had no other caller and is removed. Closes COD-3306 Co-Authored-By: Claude <noreply@anthropic.com>
d3a5ace to
bebb031
Compare
Greptile SummaryThe PR replaces the
Confidence Score: 5/5The PR appears safe to merge, with no concrete changed-code failure identified on the supported Valgrind targets. The shared debug-file lookup preserves the prior perf behavior, and the new setup predicate targets the same x86_64 and aarch64 Debian/Ubuntu environments supported by the Valgrind installer.
|
| Filename | Overview |
|---|---|
| src/executor/valgrind/setup.rs | Replaces the libc6-dbg package-state check with debug-file discovery for the supported Debian/Ubuntu architectures. |
| src/executor/helpers/debug_file.rs | Centralizes build-id and CRC-validated .gnu_debuglink lookup previously located in the perf ELF helper. |
| src/executor/helpers/apt.rs | Removes the now-unused dpkg -s package-state helper. |
| src/executor/wall_time/profiler/perf/debug_info.rs | Switches perf debug-info loading to the shared debug-file helper without changing lookup behavior. |
| src/executor/wall_time/profiler/perf/elf_helper.rs | Removes debug-file lookup code after its relocation to the executor helper module. |
| src/executor/wall_time/profiler/perf/module_symbols.rs | Switches separate symbol-table discovery and associated tests to the shared helper. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Valgrind setup] --> B{Valgrind installed?}
B -- No --> E[Restore or install packages]
B -- Yes --> C[Resolve system libc path]
C --> D{Build-id or debuglink file found?}
D -- Yes --> F[Skip package installation]
D -- No --> E
Reviews (1): Last reviewed commit: "fix(valgrind): detect cached libc debug ..." | Re-trigger Greptile
Instead of relying on dpkg to determine if debug symbols are installed, simply look for them in the expected debian based places. This is quite fragile, and will be solved once we internalize the well-known library's debug infos through debug info servers in the backend, but at least it will prevent reinstallation of valgrind and libc debug on every run.
Tested in https://github.com/CodSpeedHQ/codspeed/actions/runs/32247794511/job/96052014667#step:5:36 (debug logs were activated for this run)
Closes #504