From 1541f6597cb66a8d1c777048c281e10bfd61cb72 Mon Sep 17 00:00:00 2001 From: LukeParkerDev <10430890+Hona@users.noreply.github.com> Date: Mon, 20 Apr 2026 13:25:00 +1000 Subject: [PATCH 1/4] fix(ripgrep): inline Windows archive paths for PowerShell --- packages/opencode/src/file/ripgrep.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/opencode/src/file/ripgrep.ts b/packages/opencode/src/file/ripgrep.ts index c84d9b522a3..6f76511fb3a 100644 --- a/packages/opencode/src/file/ripgrep.ts +++ b/packages/opencode/src/file/ripgrep.ts @@ -254,10 +254,9 @@ export const layer: Layer.Layer which("powershell.exe") ?? which("pwsh.exe"))) ?? "powershell.exe" const result = yield* run(shell, [ "-NoProfile", + "-NonInteractive", "-Command", - "Expand-Archive -LiteralPath $args[0] -DestinationPath $args[1] -Force", - archive, - dir, + `$global:ProgressPreference = 'SilentlyContinue'; Expand-Archive -LiteralPath '${archive.replaceAll("'", "''")}' -DestinationPath '${dir.replaceAll("'", "''")}' -Force`, ]) if (result.code !== 0) { return yield* Effect.fail(error(result.stderr || result.stdout, result.code)) From da2de936ad48fb21b53ae75743e30587f7218edb Mon Sep 17 00:00:00 2001 From: LukeParkerDev <10430890+Hona@users.noreply.github.com> Date: Mon, 20 Apr 2026 13:53:49 +1000 Subject: [PATCH 2/4] fix(ripgrep): update to 15.1.0 and fix fallback extraction logic --- packages/opencode/src/file/ripgrep.ts | 55 ++++++++++++++++++--------- 1 file changed, 37 insertions(+), 18 deletions(-) diff --git a/packages/opencode/src/file/ripgrep.ts b/packages/opencode/src/file/ripgrep.ts index 6f76511fb3a..f95d1215f71 100644 --- a/packages/opencode/src/file/ripgrep.ts +++ b/packages/opencode/src/file/ripgrep.ts @@ -14,13 +14,14 @@ import { sanitizedProcessEnv } from "@/util/opencode-process" import { which } from "@/util/which" const log = Log.create({ service: "ripgrep" }) -const VERSION = "14.1.1" +const VERSION = "15.1.0" const PLATFORM = { "arm64-darwin": { platform: "aarch64-apple-darwin", extension: "tar.gz" }, "arm64-linux": { platform: "aarch64-unknown-linux-gnu", extension: "tar.gz" }, "x64-darwin": { platform: "x86_64-apple-darwin", extension: "tar.gz" }, "x64-linux": { platform: "x86_64-unknown-linux-musl", extension: "tar.gz" }, "arm64-win32": { platform: "aarch64-pc-windows-msvc", extension: "zip" }, + "ia32-win32": { platform: "i686-pc-windows-msvc", extension: "zip" }, "x64-win32": { platform: "x86_64-pc-windows-msvc", extension: "zip" }, } as const @@ -224,6 +225,13 @@ function raceAbort(effect: Effect.Effect, signal?: AbortSignal return signal ? effect.pipe(Effect.raceFirst(waitForAbort(signal))) : effect } +function samePath(left: string, right: string) { + const a = path.resolve(left) + const b = path.resolve(right) + if (process.platform === "win32") return a.toLowerCase() === b.toLowerCase() + return a === b +} + export const layer: Layer.Layer = Layer.effect( Service, @@ -247,7 +255,11 @@ export const layer: Layer.Layer which("rg")) - if (system && (yield* fs.isFile(system).pipe(Effect.orDie))) return system + if (system && !samePath(system, target) && (yield* fs.isFile(system).pipe(Effect.orDie))) return system - const target = path.join(Global.Path.bin, `rg${process.platform === "win32" ? ".exe" : ""}`) - if (yield* fs.isFile(target).pipe(Effect.orDie)) return target + const installed = yield* fs.isFile(target).pipe(Effect.orDie) + const current = yield* fs.readFileString(version).pipe(Effect.catch(() => Effect.succeed(""))) + if (installed && current === VERSION) return target const platformKey = `${process.arch}-${process.platform}` as keyof typeof PLATFORM const config = PLATFORM[platformKey] @@ -303,19 +325,16 @@ export const layer: Layer.Layer Effect.succeed(target))) + return yield* install }), ) From 6d37f1d4db5b1b3dbfea24a5cc5ac9d60fa74347 Mon Sep 17 00:00:00 2001 From: LukeParkerDev <10430890+Hona@users.noreply.github.com> Date: Mon, 20 Apr 2026 14:12:58 +1000 Subject: [PATCH 3/4] let snot do that lol --- packages/opencode/src/file/ripgrep.ts | 30 +++++++-------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/packages/opencode/src/file/ripgrep.ts b/packages/opencode/src/file/ripgrep.ts index f95d1215f71..56d242cd500 100644 --- a/packages/opencode/src/file/ripgrep.ts +++ b/packages/opencode/src/file/ripgrep.ts @@ -225,13 +225,6 @@ function raceAbort(effect: Effect.Effect, signal?: AbortSignal return signal ? effect.pipe(Effect.raceFirst(waitForAbort(signal))) : effect } -function samePath(left: string, right: string) { - const a = path.resolve(left) - const b = path.resolve(right) - if (process.platform === "win32") return a.toLowerCase() === b.toLowerCase() - return a === b -} - export const layer: Layer.Layer = Layer.effect( Service, @@ -294,14 +287,11 @@ export const layer: Layer.Layer which("rg")) - if (system && !samePath(system, target) && (yield* fs.isFile(system).pipe(Effect.orDie))) return system + if (system && (yield* fs.isFile(system).pipe(Effect.orDie))) return system - const installed = yield* fs.isFile(target).pipe(Effect.orDie) - const current = yield* fs.readFileString(version).pipe(Effect.catch(() => Effect.succeed(""))) - if (installed && current === VERSION) return target + const target = path.join(Global.Path.bin, `rg${process.platform === "win32" ? ".exe" : ""}`) + if (yield* fs.isFile(target).pipe(Effect.orDie)) return target const platformKey = `${process.arch}-${process.platform}` as keyof typeof PLATFORM const config = PLATFORM[platformKey] @@ -325,16 +315,10 @@ export const layer: Layer.Layer Effect.succeed(target))) - return yield* install + yield* fs.writeWithDirs(archive, new Uint8Array(bytes)) + yield* extract(archive, config, target) + yield* fs.remove(archive, { force: true }).pipe(Effect.ignore) + return target }), ) From a1bf72f17e7117da19af4dfc4fc8a92b8ea1ddce Mon Sep 17 00:00:00 2001 From: LukeParkerDev <10430890+Hona@users.noreply.github.com> Date: Mon, 20 Apr 2026 14:25:22 +1000 Subject: [PATCH 4/4] Update ripgrep.ts --- packages/opencode/src/file/ripgrep.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/opencode/src/file/ripgrep.ts b/packages/opencode/src/file/ripgrep.ts index 56d242cd500..3e58d422f65 100644 --- a/packages/opencode/src/file/ripgrep.ts +++ b/packages/opencode/src/file/ripgrep.ts @@ -287,7 +287,7 @@ export const layer: Layer.Layer which("rg")) + const system = yield* Effect.sync(() => which(process.platform === "win32" ? "rg.exe" : "rg")) if (system && (yield* fs.isFile(system).pipe(Effect.orDie))) return system const target = path.join(Global.Path.bin, `rg${process.platform === "win32" ? ".exe" : ""}`)