Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pkg/config/registry/override_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func TestOverride_Match(t *testing.T) { //nolint:funlen
},
},
{
title: "variant libc musl doesn't match gnu runtime",
title: "variant libc musl doesn't match glibc runtime",
override: &registry.Override{
GOOS: "linux",
Variants: registry.Variants{
Expand All @@ -194,7 +194,7 @@ func TestOverride_Match(t *testing.T) { //nolint:funlen
rt: &runtime.Runtime{
GOOS: "linux",
GOARCH: "amd64",
LibC: "gnu",
LibC: "glibc",
},
},
{
Expand All @@ -221,7 +221,7 @@ func TestOverride_Match(t *testing.T) { //nolint:funlen
rt: &runtime.Runtime{
GOOS: "linux",
GOARCH: "amd64",
LibC: "gnu",
LibC: "glibc",
},
},
{
Expand All @@ -230,7 +230,7 @@ func TestOverride_Match(t *testing.T) { //nolint:funlen
GOOS: "linux",
Variants: registry.Variants{
{Key: "libc", Value: "musl"},
{Key: "libc", Value: "gnu"},
{Key: "libc", Value: "glibc"},
},
},
rt: &runtime.Runtime{
Expand Down
8 changes: 4 additions & 4 deletions pkg/runtime/libc_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
)

const (
libcMusl = "musl"
libcGNU = "gnu"
libcMusl = "musl"
libcGlibc = "glibc"
)

// muslLdFiles lists well-known paths of the musl dynamic linker / libc alias
Expand All @@ -26,7 +26,7 @@ var muslLdFiles = []string{ //nolint:gochecknoglobals
}

// detectLibC returns the libc implementation in use on the current Linux system.
// It returns "musl", "gnu", or "" when detection is not possible.
// It returns "musl", "glibc", or "" when detection is not possible.
//
// Detection is tiered:
// 1. Stat well-known musl ld files. No subprocess and works on distroless or
Expand Down Expand Up @@ -55,5 +55,5 @@ func detectLibC(ctx context.Context) string {
if out.Len() == 0 {
return ""
}
return libcGNU
return libcGlibc
}
4 changes: 2 additions & 2 deletions pkg/runtime/libc_linux_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ func TestDetectLibC(t *testing.T) {
t.Parallel()
got := detectLibC(t.Context())
switch got {
case "musl", "gnu", "":
case "musl", "glibc", "":
default:
t.Fatalf("unexpected libc value: %q (want one of \"musl\", \"gnu\", \"\")", got)
t.Fatalf("unexpected libc value: %q (want one of \"musl\", \"glibc\", \"\")", got)
}
}
2 changes: 1 addition & 1 deletion website/docs/develop-registry/registry-style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ files:

:warning: The author [@suzuki-shunsuke](https://github.com/suzuki-shunsuke) isn't familiar with Rust. If you have any opinion, please let us know.

- linux: use the asset for not `gnu` but `musl` if both of them are supported
- linux: use the asset for not `glibc` but `musl` if both of them are supported
- ref: https://github.com/aquaproj/aqua-registry/pull/2153#discussion_r805116879
- windows: use the asset for not `gnu` but `msvc` if both of them are supported
- ref: https://rust-lang.github.io/rustup/installation/windows.html
Expand Down
16 changes: 8 additions & 8 deletions website/docs/reference/registry-config/overrides.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ overrides:
goarch: amd64
variants:
- key: libc
value: gnu
asset: foo-{{.OS}}-{{.Arch}}-gnu.{{.Format}}
value: glibc
asset: foo-{{.OS}}-{{.Arch}}-glibc.{{.Format}}
```

### Supported keys

| key | values | runtime detection |
|-----|--------|-------------------|
| `libc` | `musl`, `gnu` | On Linux: presence of `/lib/ld-musl-*.so.1` or `/lib/libc.musl-*.so.1`, otherwise `ldd --version` output. On non-Linux: not detected (empty). |
| `libc` | `musl`, `glibc` | On Linux: presence of `/lib/ld-musl-*.so.1` or `/lib/libc.musl-*.so.1`, otherwise `ldd --version` output. On non-Linux: not detected (empty). |

You can override the detected libc with the `AQUA_LIBC` environment variable (e.g. `AQUA_LIBC=musl`).

Expand Down Expand Up @@ -157,7 +157,7 @@ On aqua `< v2.58.0`, `variants` is ignored, so this override matches every Linux

##### Correct: preserves older behavior

Put the gnu override **first** so older aqua matches it before reaching the musl entry.
Put the glibc override **first** so older aqua matches it before reaching the musl entry.
Its `url` can be omitted because the top-level `url` is inherited when an override does not set its own.

```yaml
Expand All @@ -168,8 +168,8 @@ version_overrides:
- goos: linux
variants:
- key: libc
value: gnu
# url omitted → inherits the top-level (gnu) URL
value: glibc
# url omitted → inherits the top-level (glibc) URL
- goos: linux
url: https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases/{{trimV .Version}}/{{.OS}}-{{.Arch}}-musl/claude
variants:
Expand All @@ -181,8 +181,8 @@ version_overrides:

| aqua version | glibc user | musl user |
|----|----|----|
| `< v2.58.0` (`variants` ignored) | gnu URL ✅ (unchanged) | gnu URL ⚠️ (unchanged — same as before v2.58.0; the binary may not run on musl) |
| `>= v2.58.0` | gnu URL ✅ | musl URL ✅ |
| `< v2.58.0` (`variants` ignored) | glibc URL ✅ (unchanged) | glibc URL ⚠️ (unchanged — same as before v2.58.0; the binary may not run on musl) |
| `>= v2.58.0` | glibc URL ✅ | musl URL ✅ |

musl users who want the musl binary need to upgrade to aqua `>= v2.58.0`.
On older aqua they continue to get the glibc URL, which is the same behavior as before `variants` existed — so this is not a regression.
Expand Down
Loading