feat(registry)!: rename libc variant value gnu to glibc#4755
Conversation
The `libc` variant value `gnu` is renamed to `glibc` for consistency with `musl`. `gnu` referred to the GNU project as a whole, while the actual library is glibc (GNU C Library). This is a breaking change for pre-release users of v2.58.0-1 who wrote `value: gnu` in their registry; they must update to `value: glibc`. v2.58.0 has not yet been released, so the impact is limited. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe PR updates libc detection and variant matching terminology by renaming the constant from "gnu" to "glibc" across runtime detection code, tests, and documentation. The detection logic remains unchanged; only the identifier string is updated. ChangesLibC Terminology Standardization
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10–15 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: Turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 👉 Get your free trial and get 200 agent minutes per Slack user (a $50 value). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pkg/config/registry/override_test.go (1)
228-241: ⚡ Quick winConsider adding a symmetric positive
glibcmatch test.There is a positive test for musl (
"variant libc musl matches", lines 172–185) but no equivalent"variant libc glibc matches"test. Since this PR introduces"glibc"as a concrete return value ofdetectLibC, a positive match test would act as a direct regression guard for the rename.✅ Suggested test case to add before the
"all variants must match"entry+ { + title: "variant libc glibc matches", + exp: true, + override: ®istry.Override{ + GOOS: "linux", + Variants: registry.Variants{ + {Key: "libc", Value: "glibc"}, + }, + }, + rt: &runtime.Runtime{ + GOOS: "linux", + GOARCH: "amd64", + LibC: "glibc", + }, + },🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@pkg/config/registry/override_test.go` around lines 228 - 241, Add a symmetric positive test for glibc similar to the existing musl case: insert a new table-driven test entry (e.g., title "variant libc glibc matches") that uses registry.Override with GOOS: "linux" and Variants: registry.Variants{{Key: "libc", Value: "glibc"}}, and a matching runtime.Runtime with GOOS "linux", GOARCH "amd64", and LibC "glibc"; place it alongside the other variant tests (before the "all variants must match" case) so the detectLibC rename to "glibc" is covered by a positive regression test.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@pkg/config/registry/override_test.go`:
- Around line 228-241: Add a symmetric positive test for glibc similar to the
existing musl case: insert a new table-driven test entry (e.g., title "variant
libc glibc matches") that uses registry.Override with GOOS: "linux" and
Variants: registry.Variants{{Key: "libc", Value: "glibc"}}, and a matching
runtime.Runtime with GOOS "linux", GOARCH "amd64", and LibC "glibc"; place it
alongside the other variant tests (before the "all variants must match" case) so
the detectLibC rename to "glibc" is covered by a positive regression test.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 3066d57e-a966-4aa9-940a-68b180e91feb
📒 Files selected for processing (5)
pkg/config/registry/override_test.gopkg/runtime/libc_linux.gopkg/runtime/libc_linux_internal_test.gowebsite/docs/develop-registry/registry-style-guide.mdwebsite/docs/reference/registry-config/overrides.md
Summary
Rename the
libcvariant valuegnu→glibcfor consistency withmusl.gnureferred to the GNU project as a whole, while the actual library name is glibc (GNU C Library);glibcis symmetric withmusl(both are concrete library names).This is done as a clean break before v2.58.0 is released.
Why now
v2.58.0has not been released yet (latest tag isv2.56.7;v2.58.0-1is a pre-release). Pre-release users ofv2.58.0-1who wrotevalue: gnuin their registry are the only affected population. Renaming after the official release would require a long-term dual-acceptance shim; doing it now keeps the code, docs, and JSON Schema clean.Approach: clean break (no dual acceptance)
value: gnuwill no longer match. Anyone using it must migrate tovalue: glibc.gnuvalue is essentially unused (no stable release ever shipped it)Changes
Source
pkg/runtime/libc_linux.golibcGNU = "gnu"→libcGlibc = "glibc"(also rename the identifier)detectLibCupdated ("musl", "gnu", or ""→"musl", "glibc", or "")lddoutput ("ldd (GNU libc)...") is kept as-is — that's a literal quote from the glibclddbinary, not the aqua variant value.Tests
pkg/runtime/libc_linux_internal_test.go— allowed-values switch and error messagepkg/config/registry/override_test.go—LibC: "gnu"(×2),Value: "gnu", and one test title for consistencyDocumentation
website/docs/reference/registry-config/overrides.md— YAML examples, the supported-keys table, the prose reference, and the compatibility matrix all updatedwebsite/docs/develop-registry/registry-style-guide.md— only the linux libc bullet (use the asset for not gnu but musl→not glibc but musl)Intentionally NOT changed
pkg/asset/os.goandpkg/asset/os_test.go: occurrences likeunknown-linux-gnu/pc-windows-gnuare Rust target triple strings used for asset name mapping, unrelated to thelibcvariant value.website/docs/develop-registry/registry-style-guide.mdline 150 (windows-gnu→ MinGW) and lines 165–166 (Rust target triple examples): these refer to the Rust target triple naming convention, not thelibcvariant value.pkg/config/registry/override.go: matching logic is plain string equality and does not hold anygnu/glibcliteral.json-schema/registry.json:Variant.valueis a free-form string (no enum), so no regeneration is needed.Test plan
cmdx v(vet) — cleancmdx l(golangci-lint) — 0 issuescmdx t(full test suite) — all packages passgo test ./pkg/runtime/... ./pkg/config/registry/...— passgit grepconfirms no straylibcGNU/value: gnu/gnu URLremain (only the intentionally-keptwindows-gnu/ Rust target triple references)Release notes (suggested)
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Documentation