From ec960b81e50ea052e40966d5982de7a0269df2c5 Mon Sep 17 00:00:00 2001 From: Thierry Delafontaine Date: Sat, 6 Sep 2025 08:29:41 +0200 Subject: [PATCH] opencode: fix `failed to change directory` error Fixed the `failed to change directory` error when running `opencode` without arguments. The issue is related to the update of bun 1.2.20 to 1.2.21 where they introduced the `--compile-exec-argv` flag which has to be set to `"--"` to achieve the same behavior as before (see the changelog https://github.com/sst/opencode/issues/462#issuecomment-3261213732). --- pkgs/by-name/op/opencode/package.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/by-name/op/opencode/package.nix b/pkgs/by-name/op/opencode/package.nix index 4aed8ca2fd2b..2ac4428d2de0 100644 --- a/pkgs/by-name/op/opencode/package.nix +++ b/pkgs/by-name/op/opencode/package.nix @@ -135,6 +135,7 @@ stdenvNoCC.mkDerivation (finalAttrs: { --define OPENCODE_TUI_PATH="'${finalAttrs.tui}/bin/tui'" \ --define OPENCODE_VERSION="'${finalAttrs.version}'" \ --compile \ + --compile-exec-argv="--" \ --target=${bun-target.${stdenvNoCC.hostPlatform.system}} \ --outfile=opencode \ ./packages/opencode/src/index.ts \