opencode: refine build flags and remove unused tree-sitter dependency
Synchronize the build command with `packages/opencode/script/publish.ts` by: - Adding `--define OPENCODE_TUI_PATH` to explicitly inject the TUI path during the build - Removing the `--minify` flag from the bun build command Removing the `--minify` flag resolves the error: "Cannot find module '/$bunfs/root/../../../tree-sitter-zw03zjvh.node' from '/$bunfs/root/opencode'" which occurred when letting the AI run bash commands. Fixes #430293
This commit is contained in:
parent
9021b82a70
commit
8dc5e38125
@ -7,7 +7,6 @@
|
|||||||
models-dev,
|
models-dev,
|
||||||
nix-update-script,
|
nix-update-script,
|
||||||
testers,
|
testers,
|
||||||
tree-sitter,
|
|
||||||
writableTmpDirAsHomeHook,
|
writableTmpDirAsHomeHook,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
@ -108,8 +107,6 @@ stdenvNoCC.mkDerivation (finalAttrs: {
|
|||||||
outputHashMode = "recursive";
|
outputHashMode = "recursive";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ tree-sitter ];
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
bun
|
bun
|
||||||
models-dev
|
models-dev
|
||||||
@ -135,13 +132,12 @@ stdenvNoCC.mkDerivation (finalAttrs: {
|
|||||||
runHook preBuild
|
runHook preBuild
|
||||||
|
|
||||||
bun build \
|
bun build \
|
||||||
|
--define OPENCODE_TUI_PATH="'${finalAttrs.tui}/bin/tui'" \
|
||||||
--define OPENCODE_VERSION="'${finalAttrs.version}'" \
|
--define OPENCODE_VERSION="'${finalAttrs.version}'" \
|
||||||
--compile \
|
--compile \
|
||||||
--minify \
|
|
||||||
--target=${bun-target.${stdenvNoCC.hostPlatform.system}} \
|
--target=${bun-target.${stdenvNoCC.hostPlatform.system}} \
|
||||||
--outfile=opencode \
|
--outfile=opencode \
|
||||||
./packages/opencode/src/index.ts \
|
./packages/opencode/src/index.ts \
|
||||||
${finalAttrs.tui}/bin/tui
|
|
||||||
|
|
||||||
runHook postBuild
|
runHook postBuild
|
||||||
'';
|
'';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user