fix(update): detect active Linux libc

This commit is contained in:
Brian Hotopp
2026-08-02 13:20:02 -04:00
parent 06343fef42
commit 2f9a8dcf61
3 changed files with 54 additions and 7 deletions
@@ -13,6 +13,7 @@ import {
buildMiseUpgradeArgs,
buildNpmInstallArgs,
downloadVerifiedBinary,
isMuslLinuxForTest,
parseUpdateArgs,
pruneBunInstallCache,
replaceBinaryForUpdate,
@@ -74,6 +75,29 @@ describe("parseUpdateArgs", () => {
expect(parseUpdateArgs(["update", "-l"])).toEqual({ force: false, check: false, plugins: true });
});
});
describe("update-cli libc detection", () => {
it("does not mistake an installed musl loader for a glibc host", () => {
expect(
isMuslLinuxForTest({
platform: "linux",
alpineRelease: false,
lddOutput: "ldd (Ubuntu GLIBC 2.39-0ubuntu8.7) 2.39",
}),
).toBe(false);
});
it("recognizes a musl host from ldd output", () => {
expect(
isMuslLinuxForTest({
platform: "linux",
alpineRelease: false,
lddOutput: "musl libc (x86_64)",
}),
).toBe(true);
});
});
describe("update-cli install target detection", () => {
it("uses bun update when prioritized omp is inside bun global bin", () => {
const method = resolveUpdateMethodForTest("/Users/test/.bun/bin/omp", "/Users/test/.bun/bin");