The open source coding agent.
TypeScript
fix: parcel watcher musl support
Aiden Cline4dcda3d53d08
diff --git a/bun.lock b/bun.lockindex d211e2de859..ed5f4930d15 100644--- a/bun.lock+++ b/bun.lock@@ -285,7 +285,9 @@"@parcel/watcher-darwin-arm64": "2.5.1","@parcel/watcher-darwin-x64": "2.5.1","@parcel/watcher-linux-arm64-glibc": "2.5.1",+ "@parcel/watcher-linux-arm64-musl": "2.5.1","@parcel/watcher-linux-x64-glibc": "2.5.1",+ "@parcel/watcher-linux-x64-musl": "2.5.1","@parcel/watcher-win32-x64": "2.5.1","@standard-schema/spec": "1.0.0","@tsconfig/bun": "catalog:",diff --git a/packages/opencode/package.json b/packages/opencode/package.jsonindex bd1bd663468..2c801fcc09b 100644--- a/packages/opencode/package.json+++ b/packages/opencode/package.json@@ -23,7 +23,9 @@"@parcel/watcher-darwin-arm64": "2.5.1","@parcel/watcher-darwin-x64": "2.5.1","@parcel/watcher-linux-arm64-glibc": "2.5.1",+ "@parcel/watcher-linux-arm64-musl": "2.5.1","@parcel/watcher-linux-x64-glibc": "2.5.1",+ "@parcel/watcher-linux-x64-musl": "2.5.1","@parcel/watcher-win32-x64": "2.5.1","@standard-schema/spec": "1.0.0","@tsconfig/bun": "catalog:",diff --git a/packages/opencode/script/build.ts b/packages/opencode/script/build.tsindex 64f43b748df..5a6ac258489 100755--- a/packages/opencode/script/build.ts+++ b/packages/opencode/script/build.ts@@ -128,6 +128,7 @@ for (const item of targets) {OTUI_TREE_SITTER_WORKER_PATH: bunfsRoot + workerRelativePath,OPENCODE_WORKER_PATH: workerPath,OPENCODE_CHANNEL: `'${Script.channel}'`,+ OPENCODE_LIBC: item.os === "linux" ? `'${item.abi ?? "glibc"}'` : "",},})diff --git a/packages/opencode/src/cli/cmd/tui/thread.ts b/packages/opencode/src/cli/cmd/tui/thread.tsindex 79638c5e876..3cf8937a974 100644--- a/packages/opencode/src/cli/cmd/tui/thread.ts+++ b/packages/opencode/src/cli/cmd/tui/thread.ts@@ -60,7 +60,6 @@ export const TuiThreadCommand = cmd({const cwd = args.project ? path.resolve(baseCwd, args.project) : process.cwd()const localWorker = new URL("./worker.ts", import.meta.url)const distWorker = new URL("./cli/cmd/tui/worker.js", import.meta.url)- const execDir = path.dirname(process.execPath)const workerPath = await iife(async () => {if (typeof OPENCODE_WORKER_PATH !== "undefined") return OPENCODE_WORKER_PATHif (await Bun.file(distWorker).exists()) return distWorkerdiff --git a/packages/opencode/src/file/watcher.ts b/packages/opencode/src/file/watcher.tsindex 4adf721b947..c9985acf34e 100644--- a/packages/opencode/src/file/watcher.ts+++ b/packages/opencode/src/file/watcher.ts@@ -9,6 +9,8 @@ import { createWrapper } from "@parcel/watcher/wrapper"import { lazy } from "@/util/lazy"import type ParcelWatcher from "@parcel/watcher"+declare const OPENCODE_LIBC: string | undefined+export namespace FileWatcher {const log = Log.create({ service: "file.watcher" })@@ -24,7 +26,7 @@ export namespace FileWatcher {const watcher = lazy(() => {const binding = require(- `@parcel/watcher-${process.platform}-${process.arch}${process.platform === "linux" ? "-glibc" : ""}`,+ `@parcel/watcher-${process.platform}-${process.arch}${process.platform === "linux" ? `-${OPENCODE_LIBC || "glibc"}` : ""}`,)return createWrapper(binding) as typeof import("@parcel/watcher")})