Skip to content

Commit 889087c

Browse files
nexxelnHona
andauthored
fix(ripgrep): restore native rg backend (#22773)
Co-authored-by: LukeParkerDev <[email protected]>
1 parent 7f3b64c commit 889087c

6 files changed

Lines changed: 295 additions & 503 deletions

File tree

bun.lock

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

nix/opencode.nix

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
sysctl,
88
makeBinaryWrapper,
99
models-dev,
10+
ripgrep,
1011
installShellFiles,
1112
versionCheckHook,
1213
writableTmpDirAsHomeHook,
@@ -51,25 +52,25 @@ stdenvNoCC.mkDerivation (finalAttrs: {
5152
runHook postBuild
5253
'';
5354

54-
installPhase =
55-
''
56-
runHook preInstall
57-
58-
install -Dm755 dist/opencode-*/bin/opencode $out/bin/opencode
59-
install -Dm644 schema.json $out/share/opencode/schema.json
60-
''
61-
# bun runs sysctl to detect if dunning on rosetta2
62-
+ lib.optionalString stdenvNoCC.hostPlatform.isDarwin ''
63-
wrapProgram $out/bin/opencode \
64-
--prefix PATH : ${
65-
lib.makeBinPath [
66-
sysctl
55+
installPhase = ''
56+
runHook preInstall
57+
58+
install -Dm755 dist/opencode-*/bin/opencode $out/bin/opencode
59+
install -Dm644 schema.json $out/share/opencode/schema.json
60+
61+
wrapProgram $out/bin/opencode \
62+
--prefix PATH : ${
63+
lib.makeBinPath (
64+
[
65+
ripgrep
6766
]
68-
}
69-
''
70-
+ ''
71-
runHook postInstall
72-
'';
67+
# bun runs sysctl to detect if dunning on rosetta2
68+
++ lib.optional stdenvNoCC.hostPlatform.isDarwin sysctl
69+
)
70+
}
71+
72+
runHook postInstall
73+
'';
7374

7475
postInstall = lib.optionalString (stdenvNoCC.buildPlatform.canExecute stdenvNoCC.hostPlatform) ''
7576
# trick yargs into also generating zsh completions

packages/opencode/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@
161161
"opentui-spinner": "0.0.6",
162162
"partial-json": "0.1.7",
163163
"remeda": "catalog:",
164-
"ripgrep": "0.3.1",
165164
"semver": "^7.6.3",
166165
"solid-js": "catalog:",
167166
"strip-ansi": "7.1.2",

packages/opencode/script/build.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ for (const item of targets) {
187187
const rootPath = path.resolve(dir, "../../node_modules/@opentui/core/parser.worker.js")
188188
const parserWorker = fs.realpathSync(fs.existsSync(localPath) ? localPath : rootPath)
189189
const workerPath = "./src/cli/cmd/tui/worker.ts"
190-
const rgPath = "./src/file/ripgrep.worker.ts"
191190

192191
// Use platform-specific bunfs root path based on target OS
193192
const bunfsRoot = item.os === "win32" ? "B:/~BUN/root/" : "/$bunfs/root/"
@@ -212,19 +211,12 @@ for (const item of targets) {
212211
windows: {},
213212
},
214213
files: embeddedFileMap ? { "opencode-web-ui.gen.ts": embeddedFileMap } : {},
215-
entrypoints: [
216-
"./src/index.ts",
217-
parserWorker,
218-
workerPath,
219-
rgPath,
220-
...(embeddedFileMap ? ["opencode-web-ui.gen.ts"] : []),
221-
],
214+
entrypoints: ["./src/index.ts", parserWorker, workerPath, ...(embeddedFileMap ? ["opencode-web-ui.gen.ts"] : [])],
222215
define: {
223216
OPENCODE_VERSION: `'${Script.version}'`,
224217
OPENCODE_MIGRATIONS: JSON.stringify(migrations),
225218
OTUI_TREE_SITTER_WORKER_PATH: bunfsRoot + workerRelativePath,
226219
OPENCODE_WORKER_PATH: workerPath,
227-
OPENCODE_RIPGREP_WORKER_PATH: rgPath,
228220
OPENCODE_CHANNEL: `'${Script.channel}'`,
229221
OPENCODE_LIBC: item.os === "linux" ? `'${item.abi ?? "glibc"}'` : "",
230222
},

0 commit comments

Comments
 (0)