Skip to content

Commit 4dcda3d

Browse files
committed
fix: parcel watcher musl support
1 parent 479cca2 commit 4dcda3d

File tree

5 files changed

+8
-2
lines changed

5 files changed

+8
-2
lines changed

bun.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,9 @@
285285
"@parcel/watcher-darwin-arm64": "2.5.1",
286286
"@parcel/watcher-darwin-x64": "2.5.1",
287287
"@parcel/watcher-linux-arm64-glibc": "2.5.1",
288+
"@parcel/watcher-linux-arm64-musl": "2.5.1",
288289
"@parcel/watcher-linux-x64-glibc": "2.5.1",
290+
"@parcel/watcher-linux-x64-musl": "2.5.1",
289291
"@parcel/watcher-win32-x64": "2.5.1",
290292
"@standard-schema/spec": "1.0.0",
291293
"@tsconfig/bun": "catalog:",

packages/opencode/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
"@parcel/watcher-darwin-arm64": "2.5.1",
2424
"@parcel/watcher-darwin-x64": "2.5.1",
2525
"@parcel/watcher-linux-arm64-glibc": "2.5.1",
26+
"@parcel/watcher-linux-arm64-musl": "2.5.1",
2627
"@parcel/watcher-linux-x64-glibc": "2.5.1",
28+
"@parcel/watcher-linux-x64-musl": "2.5.1",
2729
"@parcel/watcher-win32-x64": "2.5.1",
2830
"@standard-schema/spec": "1.0.0",
2931
"@tsconfig/bun": "catalog:",

packages/opencode/script/build.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ for (const item of targets) {
128128
OTUI_TREE_SITTER_WORKER_PATH: bunfsRoot + workerRelativePath,
129129
OPENCODE_WORKER_PATH: workerPath,
130130
OPENCODE_CHANNEL: `'${Script.channel}'`,
131+
OPENCODE_LIBC: item.os === "linux" ? `'${item.abi ?? "glibc"}'` : "",
131132
},
132133
})
133134

packages/opencode/src/cli/cmd/tui/thread.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ export const TuiThreadCommand = cmd({
6060
const cwd = args.project ? path.resolve(baseCwd, args.project) : process.cwd()
6161
const localWorker = new URL("./worker.ts", import.meta.url)
6262
const distWorker = new URL("./cli/cmd/tui/worker.js", import.meta.url)
63-
const execDir = path.dirname(process.execPath)
6463
const workerPath = await iife(async () => {
6564
if (typeof OPENCODE_WORKER_PATH !== "undefined") return OPENCODE_WORKER_PATH
6665
if (await Bun.file(distWorker).exists()) return distWorker

packages/opencode/src/file/watcher.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import { createWrapper } from "@parcel/watcher/wrapper"
99
import { lazy } from "@/util/lazy"
1010
import type ParcelWatcher from "@parcel/watcher"
1111

12+
declare const OPENCODE_LIBC: string | undefined
13+
1214
export namespace FileWatcher {
1315
const log = Log.create({ service: "file.watcher" })
1416

@@ -24,7 +26,7 @@ export namespace FileWatcher {
2426

2527
const watcher = lazy(() => {
2628
const binding = require(
27-
`@parcel/watcher-${process.platform}-${process.arch}${process.platform === "linux" ? "-glibc" : ""}`,
29+
`@parcel/watcher-${process.platform}-${process.arch}${process.platform === "linux" ? `-${OPENCODE_LIBC || "glibc"}` : ""}`,
2830
)
2931
return createWrapper(binding) as typeof import("@parcel/watcher")
3032
})

0 commit comments

Comments
 (0)