Skip to content

feat(registry)!: rename libc variant value gnu to glibc#4755

Merged
suzuki-shunsuke merged 1 commit into
mainfrom
feat/libc-variant-glibc
May 2, 2026
Merged

feat(registry)!: rename libc variant value gnu to glibc#4755
suzuki-shunsuke merged 1 commit into
mainfrom
feat/libc-variant-glibc

Conversation

@suzuki-shunsuke

@suzuki-shunsuke suzuki-shunsuke commented May 2, 2026

Copy link
Copy Markdown
Member

Summary

Rename the libc variant value gnuglibc for consistency with musl. gnu referred to the GNU project as a whole, while the actual library name is glibc (GNU C Library); glibc is symmetric with musl (both are concrete library names).

This is done as a clean break before v2.58.0 is released.

Why now

v2.58.0 has not been released yet (latest tag is v2.56.7; v2.58.0-1 is a pre-release). Pre-release users of v2.58.0-1 who wrote value: gnu in 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: gnu will no longer match. Anyone using it must migrate to value: glibc.
  • Reasons for not accepting both:
    • The gnu value is essentially unused (no stable release ever shipped it)
    • Dual acceptance would complicate code, tests, and docs and become long-term debt
    • A single line in the v2.58.0 release notes covers the migration

Changes

Source

  • pkg/runtime/libc_linux.go
    • Constant: libcGNU = "gnu"libcGlibc = "glibc" (also rename the identifier)
    • Detection return value follows
    • Doc comment for detectLibC updated ("musl", "gnu", or """musl", "glibc", or "")
    • Note: the internal comment about glibc's ldd output ("ldd (GNU libc)...") is kept as-is — that's a literal quote from the glibc ldd binary, not the aqua variant value.

Tests

  • pkg/runtime/libc_linux_internal_test.go — allowed-values switch and error message
  • pkg/config/registry/override_test.goLibC: "gnu" (×2), Value: "gnu", and one test title for consistency

Documentation

  • website/docs/reference/registry-config/overrides.md — YAML examples, the supported-keys table, the prose reference, and the compatibility matrix all updated
  • website/docs/develop-registry/registry-style-guide.md — only the linux libc bullet (use the asset for not gnu but muslnot glibc but musl)

Intentionally NOT changed

  • pkg/asset/os.go and pkg/asset/os_test.go: occurrences like unknown-linux-gnu / pc-windows-gnu are Rust target triple strings used for asset name mapping, unrelated to the libc variant value.
  • website/docs/develop-registry/registry-style-guide.md line 150 (windows-gnu → MinGW) and lines 165–166 (Rust target triple examples): these refer to the Rust target triple naming convention, not the libc variant value.
  • pkg/config/registry/override.go: matching logic is plain string equality and does not hold any gnu/glibc literal.
  • json-schema/registry.json: Variant.value is a free-form string (no enum), so no regeneration is needed.

Test plan

  • cmdx v (vet) — clean
  • cmdx l (golangci-lint) — 0 issues
  • cmdx t (full test suite) — all packages pass
  • Targeted: go test ./pkg/runtime/... ./pkg/config/registry/... — pass
  • git grep confirms no stray libcGNU / value: gnu / gnu URL remain (only the intentionally-kept windows-gnu / Rust target triple references)

Release notes (suggested)

The libc variant value gnu has been renamed to glibc for consistency with musl. Pre-release users of v2.58.0-1 who wrote value: gnu in their registry must update to value: glibc.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Corrected libc detection to report "glibc" instead of "gnu"
  • Documentation

    • Updated registry documentation and style guide to reflect standardized libc terminology

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>
@coderabbitai

coderabbitai Bot commented May 2, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

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

Changes

LibC Terminology Standardization

Layer / File(s) Summary
Core Runtime Implementation
pkg/runtime/libc_linux.go
Constant libcGNU renamed to libcGlibc with value "glibc". Function documentation updated to reflect return value change from "gnu" to "glibc".
Internal Tests & Validation
pkg/runtime/libc_linux_internal_test.go
TestDetectLibC updated to accept "glibc" instead of "gnu" as valid output. Assertion message updated accordingly.
Config Registry Tests
pkg/config/registry/override_test.go
Override test cases updated: gnu runtime renamed to glibc runtime, and all libc variant assertions changed from "gnu" to "glibc" across three test scenarios.
User Documentation
website/docs/develop-registry/registry-style-guide.md, website/docs/reference/registry-config/overrides.md
Registry style guide and override documentation updated to use glibc terminology instead of gnu in examples and backward-compatibility guidance.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10–15 minutes

Possibly related PRs

Suggested labels

enhancement, documentation

🐰 Gnu no more, glibc takes the stage,
A hop, a skip, through code and page,
Constants renamed with careful care,
Consistency spreads everywhere!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: renaming the libc variant value from 'gnu' to 'glibc'. It is specific, concise, and clearly communicates the primary breaking change.
Description check ✅ Passed The PR description is comprehensive and well-structured. It includes a clear summary, rationale, approach, detailed change breakdown by file, test plan results, and a suggested release note. While it does not follow the exact repository template format, it provides all necessary information for understanding and reviewing the change.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/libc-variant-glibc

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.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

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.

❤️ Share
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@suzuki-shunsuke suzuki-shunsuke added this to the v2.58.0 milestone May 2, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
pkg/config/registry/override_test.go (1)

228-241: ⚡ Quick win

Consider adding a symmetric positive glibc match 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 of detectLibC, 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: &registry.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

📥 Commits

Reviewing files that changed from the base of the PR and between d8dc224 and fce5a3e.

📒 Files selected for processing (5)
  • pkg/config/registry/override_test.go
  • pkg/runtime/libc_linux.go
  • pkg/runtime/libc_linux_internal_test.go
  • website/docs/develop-registry/registry-style-guide.md
  • website/docs/reference/registry-config/overrides.md

@suzuki-shunsuke suzuki-shunsuke merged commit 52873a4 into main May 2, 2026
22 checks passed
@suzuki-shunsuke suzuki-shunsuke deleted the feat/libc-variant-glibc branch May 2, 2026 23:49
suzuki-shunsuke added a commit to aquaproj/aqua-registry that referenced this pull request May 2, 2026
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