Skip to content

Commit aebc13b

Browse files
ochafikclaude
andcommitted
fix: remove bun devDep, add libc detection for Linux ARM64
- Remove 'bun' from devDependencies (its postinstall fails on Windows ARM64) - Add libc detection (glibc vs musl) to setup-bun.mjs - Only try compatible binaries based on detected libc - Re-enable Windows ARM64 in CI (now uses x64 emulation fallback) - Remove setup-bun action from CI (no longer needed) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 181384a commit aebc13b

File tree

4 files changed

+46
-213
lines changed

4 files changed

+46
-213
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@ jobs:
2121
name: Linux ARM64
2222
- os: windows-latest
2323
name: Windows x64
24-
# Windows ARM64 disabled: Bun doesn't support this platform yet
25-
# - os: windows-11-arm
26-
# name: Windows ARM64
24+
- os: windows-11-arm
25+
name: Windows ARM64
2726
- os: macos-latest
2827
name: macOS ARM64
2928

@@ -37,10 +36,6 @@ jobs:
3736
shell: bash
3837
run: '! grep -E "\"resolved\": \"https?://" package-lock.json | grep -v registry.npmjs.org'
3938

40-
- uses: oven-sh/setup-bun@v2
41-
with:
42-
bun-version: latest
43-
4439
- uses: actions/setup-node@v4
4540
with:
4641
node-version: "20"
@@ -135,20 +130,15 @@ jobs:
135130
name: Linux ARM64
136131
- os: windows-latest
137132
name: Windows x64
138-
# Windows ARM64 disabled: Bun doesn't support this platform yet
139-
# - os: windows-11-arm
140-
# name: Windows ARM64
133+
- os: windows-11-arm
134+
name: Windows ARM64
141135
- os: macos-latest
142136
name: macOS ARM64
143137

144138
name: Test git install (${{ matrix.name }})
145139
runs-on: ${{ matrix.os }}
146140

147141
steps:
148-
- uses: oven-sh/setup-bun@v2
149-
with:
150-
bun-version: latest
151-
152142
- uses: actions/setup-node@v4
153143
with:
154144
node-version: "20"

package-lock.json

Lines changed: 0 additions & 189 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
"@types/bun": "^1.3.2",
6060
"@types/react": "^19.2.2",
6161
"@types/react-dom": "^19.2.2",
62-
"bun": "^1.3.2",
6362
"concurrently": "^9.2.1",
6463
"cors": "^2.8.5",
6564
"cross-env": "^10.1.0",
@@ -77,8 +76,8 @@
7776
"zod": "^3.25.0 || ^4.0.0"
7877
},
7978
"dependencies": {
80-
"prettier": "^3.6.2",
8179
"@modelcontextprotocol/sdk": "^1.24.3",
80+
"prettier": "^3.6.2",
8281
"react": "^19.2.0",
8382
"react-dom": "^19.2.0"
8483
},

scripts/setup-bun.mjs

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,45 @@ const arch = process.arch;
3131
const isWindows = os === "win32";
3232
const bunExe = isWindows ? "bun.exe" : "bun";
3333

34+
// Detect libc type on Linux (glibc vs musl)
35+
function detectLibc() {
36+
if (os !== "linux") return null;
37+
38+
// Check for musl-specific loader
39+
const muslLoaders = [
40+
`/lib/ld-musl-${arch === "arm64" ? "aarch64" : "x86_64"}.so.1`,
41+
"/lib/ld-musl-x86_64.so.1",
42+
"/lib/ld-musl-aarch64.so.1",
43+
];
44+
45+
for (const loader of muslLoaders) {
46+
if (existsSync(loader)) {
47+
console.log(` Detected musl libc (found ${loader})`);
48+
return "musl";
49+
}
50+
}
51+
52+
// Default to glibc on Linux
53+
console.log(" Detected glibc (no musl loader found)");
54+
return "glibc";
55+
}
56+
3457
// Platform to package mapping (matches @oven/bun-* package names)
58+
// For Linux, separate glibc and musl packages
3559
const platformPackages = {
3660
darwin: {
3761
arm64: ["bun-darwin-aarch64"],
3862
x64: ["bun-darwin-x64", "bun-darwin-x64-baseline"],
3963
},
4064
linux: {
41-
arm64: ["bun-linux-aarch64", "bun-linux-aarch64-musl"],
42-
x64: [
43-
"bun-linux-x64",
44-
"bun-linux-x64-baseline",
45-
"bun-linux-x64-musl",
46-
"bun-linux-x64-musl-baseline",
47-
],
65+
arm64: {
66+
glibc: ["bun-linux-aarch64"],
67+
musl: ["bun-linux-aarch64-musl"],
68+
},
69+
x64: {
70+
glibc: ["bun-linux-x64", "bun-linux-x64-baseline"],
71+
musl: ["bun-linux-x64-musl", "bun-linux-x64-musl-baseline"],
72+
},
4873
},
4974
win32: {
5075
x64: ["bun-windows-x64", "bun-windows-x64-baseline"],
@@ -53,7 +78,15 @@ const platformPackages = {
5378
};
5479

5580
function findBunBinary() {
56-
const packages = platformPackages[os]?.[arch] || [];
81+
let packages = platformPackages[os]?.[arch];
82+
83+
// For Linux, select packages based on libc type
84+
if (os === "linux" && packages && typeof packages === "object") {
85+
const libc = detectLibc();
86+
packages = packages[libc] || [];
87+
}
88+
89+
packages = packages || [];
5790
console.log(
5891
`Looking for bun packages: ${packages.join(", ") || "(none for this platform)"}`,
5992
);

0 commit comments

Comments
 (0)