Repository navigation
Commit eae7ee7
committed
fix(nix): make the v2 packages buildable
Three independent defects in the v2 Nix packaging, each fatal to
`nix build .#opencode` or `nix build .#opencode-desktop`.
`nix/opencode.nix` generates completions through `opencode completion`, a
subcommand v2 no longer has. The Effect CLI parses it as the optional
`directory` argument and the TUI opens instead, so `installShellCompletion`
gets a zero-size file and the build fails:
Error: ENOENT: no such file or directory, chdir '/build/source/packages/cli' -> 'completion'
ERROR: installShellCompletion: installed shell completion file .../opencode.bash does not exist or has zero size
Completions now come from the Effect-CLI global action flag,
`--completions <bash|zsh|fish|sh>`. Naming the shell directly also drops
the `SHELL=/bin/zsh` coaxing the old yargs-based path needed. The name in
the output is a build-time define, so `opencode2 --completions` just
reproduces the `opencode` script; it is renamed instead.
`sh` is a synonym for `bash` in the Effect CLI, so `--bash` already covers
it. Fish did not ship before, but the CLI generates it and
`installShellFiles` knows where to put it, so it is installed now.
`nix/electron.nix` still carries the electron 42.10.1 hashes while
`packages/desktop/package.json` moved to 44.4.3, so the desktop's electron
fetchzip cannot resolve. The hashes are refreshed from the 44.4.3
SHASUMS256.txt; the headers hash is the fetchzip recursive hash, computed
the same way the 42.10.1 one was (reproducing the previous value as a
control).
`nix/desktop.nix` stages the CLI executable but not the package manifest
next to it, and `packages/desktop/scripts/utils.ts` reads the bundled CLI's
version from that manifest. The desktop build aborts in `scripts/prebuild.ts`:
ENOENT: no such file or directory, open '/build/desktop-cli/cli-linux-x64-baseline/package.json'
The manifest is now written alongside the executable, so the version file
the desktop ships resolves without spawning the binary.
Fixes anomalyco#504081 parent dd786c6 commit eae7ee7
3 files changed
Lines changed: 21 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
94 | 98 | | |
95 | 99 | | |
96 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
89 | 91 | | |
90 | | - | |
91 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
92 | 95 | | |
| 96 | + | |
| 97 | + | |
93 | 98 | | |
94 | | - | |
95 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
96 | 102 | | |
97 | 103 | | |
98 | 104 | | |
| |||
0 commit comments