Skip to content

ci: fix the clang-format hook failing to install - #540

Merged
adriencaccia merged 1 commit into
mainfrom
fix-clang-format-hook-install
Sep 16, 2026
Merged

adriencaccia merged 1 commit into
mainfrom
fix-clang-format-hook-install

Conversation

@adriencaccia

@adriencaccia adriencaccia commented Sep 16, 2026

Copy link
Copy Markdown
Member

cpp-linter-hooks installs clang-format with pip at hook runtime. v1.4.0 only
requires pip>=20.3, which now fails to lay the wheel down:

pip failed to install clang-format 22.1.2
PermissionError: [Errno 13] Permission denied: .../site-packages/clang_format/data/bin/clang-format

Lint only stayed green while the prek cache survived — every cache miss rebuilt
the hook environment and went red, which is what happened on main today.
v1.6.0 requires pip>=26.1 for exactly this reason.

v1.6.0 also resolves the clang-format version from PyPI at run time instead of a
static list, so it is pinned to the 22.1.2 the sources are already formatted
with. Without the pin lint would jump to whatever PyPI publishes next (23.1.1
today) and reformat the eBPF C sources.

Verified against a fresh prek cache
(PREK_HOME=<empty dir> prek run clang-format --all-files): the hook installs,
reports clang-format version 22.1.2 and leaves the C sources untouched.

Refs COD-3543 — that issue tracks the memtrack/runner patch releases, which this
only unblocks.

cpp-linter-hooks installs clang-format with pip at hook runtime. v1.4.0
requires only pip>=20.3, which now fails to lay the wheel down:

  pip failed to install clang-format 22.1.2
  PermissionError: [Errno 13] Permission denied:
    .../site-packages/clang_format/data/bin/clang-format

Lint only stayed green while the prek cache survived; every cache miss
rebuilt the hook environment and went red. v1.6.0 requires pip>=26.1 for
exactly this reason.

v1.6.0 also resolves the clang-format version from PyPI at run time
instead of a static list, so pin it to the 22.1.2 the sources are
already formatted with, keeping the version independent of what PyPI
publishes next.

Refs COD-3543
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@adriencaccia
adriencaccia force-pushed the fix-clang-format-hook-install branch from 107f904 to 41f6539 Compare September 16, 2026 17:30
@codspeed

codspeed Bot commented Sep 16, 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 fix-clang-format-hook-install (41f6539) with main (f198706)

Open in CodSpeed

@adriencaccia
adriencaccia marked this pull request as ready for review September 16, 2026 17:36
@adriencaccia
adriencaccia merged commit 725213e into main Sep 16, 2026
46 checks passed
@adriencaccia
adriencaccia deleted the fix-clang-format-hook-install branch September 16, 2026 17:37
@greptile-apps

greptile-apps Bot commented Sep 16, 2026

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

The PR appears safe to merge; no concrete behavioral, security, or repository-rule issue was identified.

Summary

This PR repairs cold-cache clang-format hook installation by upgrading cpp-linter-hooks and pins the formatter version to preserve stable formatting.

  • Upgrades cpp-linter-hooks from v1.4.0 to v1.6.0.
  • Pins clang-format to 22.1.2 while retaining the existing style and in-place formatting arguments.
  • Keeps the hook scoped to the existing memtrack eBPF C sources.

Reviews (1) · Last reviewed commit: "ci: fix the clang-format hook failing to..."

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