Skip to content

Libc-dbg install triggers despite cache restore - #509

Merged
GuillaumeLagrange merged 1 commit into
mainfrom
cod-3306-fix-instruments-cache-behavior-in-the-action
Aug 21, 2026
Merged

Libc-dbg install triggers despite cache restore#509
GuillaumeLagrange merged 1 commit into
mainfrom
cod-3306-fix-instruments-cache-behavior-in-the-action

Conversation

@GuillaumeLagrange

@GuillaumeLagrange GuillaumeLagrange commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

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

@GuillaumeLagrange GuillaumeLagrange changed the title Libc-dbg install gets trigger despite cache restore Libc-dbg install triggers despite cache restore Aug 19, 2026
@codspeed-hq

codspeed-hq Bot commented Aug 19, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

✅ 17 untouched benchmarks


Comparing cod-3306-fix-instruments-cache-behavior-in-the-action (bebb031) with main (3798897)

Open in CodSpeed

@GuillaumeLagrange
GuillaumeLagrange force-pushed the cod-3306-fix-instruments-cache-behavior-in-the-action branch 3 times, most recently from 6d9a1ae to d3a5ace Compare August 19, 2026 12:00
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>
@GuillaumeLagrange
GuillaumeLagrange force-pushed the cod-3306-fix-instruments-cache-behavior-in-the-action branch from d3a5ace to bebb031 Compare August 19, 2026 12:22
@GuillaumeLagrange
GuillaumeLagrange marked this pull request as ready for review August 19, 2026 12:31
@greptile-apps

greptile-apps Bot commented Aug 19, 2026

Copy link
Copy Markdown

Greptile Summary

The PR replaces the dpkg package-state check with direct discovery of libc's separate debug information, preventing restored cache contents from triggering redundant package installation.

  • Moves shared build-id and .gnu_debuglink discovery into executor::helpers::debug_file.
  • Uses the shared lookup to determine whether libc debug symbols are available before installing Valgrind dependencies.
  • Updates perf symbolication consumers and tests to use the relocated helper.

Confidence Score: 5/5

The 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.

Important Files Changed

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
Loading

Reviews (1): Last reviewed commit: "fix(valgrind): detect cached libc debug ..." | Re-trigger Greptile

@GuillaumeLagrange
GuillaumeLagrange merged commit e5587f4 into main Aug 21, 2026
23 checks passed
@GuillaumeLagrange
GuillaumeLagrange deleted the cod-3306-fix-instruments-cache-behavior-in-the-action branch August 21, 2026 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Packages restored from cache are redownloaded

2 participants