Skip to content

fix: support distributions that report no OS version (Arch, rolling releases) - #525

Open
moha-bekh wants to merge 3 commits into
mainfrom
cod-3072-cli-fails-to-detect-os-version-on-arch-linux
Open

fix: support distributions that report no OS version (Arch, rolling releases)#525
moha-bekh wants to merge 3 commits into
mainfrom
cod-3072-cli-fails-to-detect-os-version-on-arch-linux

Conversation

@moha-bekh

Copy link
Copy Markdown
Member

Refs COD-3072

The CLI aborted on Arch Linux before it could do anything: SupportedOs::from_os read sysinfo::System::os_version() up front and failed with "Failed to get OS version" when it was absent. That value comes from VERSION_ID in /etc/os-release, which rolling releases do not ship.

Fixing that surfaced a second failure right after, at setup: install_valgrind went straight to the valgrind-codspeed deb, which only exists for the Debian/Ubuntu versions we publish — so it bailed with a bare "Unsupported system", even though ValgrindExecutor::support_level already advertises RequiresManualInstallation for those hosts.

Changes

  • src/system/os.rs — on Linux, fall back to "unknown" with a debug! instead of failing. The version only matters for the distributions we ship packages for, and those all expose one; the rest are handled by is_supported(). macOS keeps the hard error, since the version is always available there et is what we report to the API.
  • src/executor/valgrind/setup.rs — mirror the executor's support level.

moha-bekh and others added 2 commits September 3, 2026 11:12
`SupportedOs::from_os` read `sysinfo::System::os_version()` before looking
at the OS at all and bailed with "Failed to get OS version" when it was
absent. That value comes from `VERSION_ID` in `/etc/os-release`, which
rolling releases do not ship: on Arch (`ID=archarm`, `BUILD_ID=rolling`)
every command aborted before it could determine anything about the host.

The version only matters for the distributions we publish packages for,
and those all expose one — the rest are already handled by
`is_supported()`. So on Linux fall back to `"unknown"` with a `debug!`
rather than failing, and keep the hard error on macOS, where the version
is always available and is what we report to the API.

Refs COD-3072

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VZZqxhWtwHhurnV2hsJ48H
`install_valgrind` went straight to `apt::install_cached`, which resolves the
`valgrind-codspeed` deb for the host through `get_codspeed_valgrind_target`.
That mapping only covers the Debian/Ubuntu versions we publish packages for, so
on anything else — Arch and other rolling releases, non-apt distributions — it
bailed with a bare "Unsupported system" and the run stopped at setup. Yet
`ValgrindExecutor::support_level` already reports `RequiresManualInstallation`
for those hosts, so the executor was advertising a path that setup refused to
take.

Mirror that support level in the setup: when no package exists for the host,
return early if a valgrind installation is already present, and otherwise fail
with an error that says CodSpeed publishes nothing for this distribution and
points at valgrind-codspeed for a manual install. The libc debug symbol check
is already skipped on non-apt systems, so an existing build is enough.

Refs COD-3072

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Sep 3, 2026

Copy link
Copy Markdown

Greptile Summary

This PR allows Linux distributions without a reported OS version to initialize using an unknown placeholder and adds a manual Valgrind-installation path for hosts outside the published package matrix.

  • Keeps macOS version detection strict.
  • Accepts a compatible existing Valgrind installation on unsupported Linux package targets.
  • Improves the unsupported-host failure message, although it omits the separately enforced libc debug-symbol requirement.

Confidence Score: 4/5

The PR appears safe to merge, with a non-blocking diagnostic gap for manual installations on unsupported Ubuntu or Debian versions.

The changed setup branch correctly avoids automatic package installation where no package exists, but its error message cannot guide users whose compatible Valgrind installation fails only because libc debug symbols are missing.

Files Needing Attention: src/executor/valgrind/setup.rs

Important Files Changed

Filename Overview
src/system/os.rs Linux now falls back to an unknown version while preserving strict macOS detection; no concrete compatibility defect was identified.
src/executor/valgrind/setup.rs Manual installations are now accepted outside the package matrix, but the failure guidance does not mention the libc debug symbols required on apt-compatible hosts.

Fix all with Greploop Fix All in Claude Code Fix All in Codex

Prompt To Fix All With AI
### Issue 1
src/executor/valgrind/setup.rs:260-264
**Manual requirement omitted**

On unsupported Ubuntu or Debian versions, `is_valgrind_installed` also requires resolvable libc debug symbols, but this error only instructs users to install `valgrind-codspeed`. A user who follows that instruction can receive the same error again without learning that the debug-symbol package is the remaining requirement.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "fix(valgrind): accept a manual installat..." | Re-trigger Greptile

Comment on lines +260 to +264
bail!(
"CodSpeed does not publish a valgrind package for {}, so it cannot be installed automatically. \
Install valgrind-codspeed {} or higher manually, see https://github.com/CodSpeedHQ/valgrind-codspeed",
system_info.os,
VALGRIND_CODSPEED_VERSION_STRING.as_str()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Manual requirement omitted

On unsupported Ubuntu or Debian versions, is_valgrind_installed also requires resolvable libc debug symbols, but this error only instructs users to install valgrind-codspeed. A user who follows that instruction can receive the same error again without learning that the debug-symbol package is the remaining requirement.

Knowledge Base Used: Valgrind measurement

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/executor/valgrind/setup.rs
Line: 260-264

Comment:
**Manual requirement omitted**

On unsupported Ubuntu or Debian versions, `is_valgrind_installed` also requires resolvable libc debug symbols, but this error only instructs users to install `valgrind-codspeed`. A user who follows that instruction can receive the same error again without learning that the debug-symbol package is the remaining requirement.

**Knowledge Base Used:** [Valgrind measurement](https://app.greptile.com/codspeed/-/custom-context/knowledge-base/codspeedhq/codspeed/-/docs/valgrind-measurement.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

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!

Fix in Claude Code Fix in Codex

@codspeed-hq

codspeed-hq Bot commented Sep 3, 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-3072-cli-fails-to-detect-os-version-on-arch-linux (a1fe177) with main (6ecb3c0)

Open in CodSpeed

On the systems we publish no valgrind package for (rolling releases,
non-apt distributions, ...), the setup used to give up immediately and
ask for a manual installation. Try a best-effort source build instead:
check the build toolchain, clone the sources, compile them and install
system-wide, only falling back to the manual instructions when any of
those steps fails.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

1 participant