Repository navigation
fix(nix): ship the root script/ dir to the CLI build - #55494
Conversation
|
The following comment was made by an LLM, it may be inaccurate: |
There was a problem hiding this comment.
The fix looks correct. I couldn't run a real nix build here, so I rebuilt the flake's source tree from the fileset list and checked how the import resolves. Without script/, ../../../script/native-arch fails to resolve with the same Cannot find module error as the issue. With this change it resolves. script/ has no package.json and isn't a workspace, and the derivation keeps only the node_modules directories that bun install produces, so the node_modules hash in hashes.json stays the same. native-arch.ts has no other local imports. The desktop derivation reuses the same src, so it is covered too.
Public API is unchanged (Nix packaging only).
No concerns.
ae55d61 to
b2fdf8e
Compare
opencode.url follows anomalyco/opencode's dev branch now: the v2 branch it tracked stopped receiving releases on 2026-10-10 and sat at 2.0.26, while every v2.0.x release since is cut from dev. OpenChamber web and desktop move from 2.0.1 to 2.3.3. The web CLI needs Node 24 at run time, so the wrapper uses nodejs_24; the desktop AppImage ships its app icon as a 512x512 PNG instead of a scalable SVG. The CLI source fileset upstream builds from still omits the repository root script/ directory that packages/cli/script/build.ts imports since 2.0.28, so the from-source build fails. The fix is open as anomalyco/opencode#55494; until it lands the overlay adds the directory, mirroring that patch. The dependency tree never reads it, so the measured node_modules hash is unchanged.
An updater can succeed while the new version doesn't build: slumber 5.4.2 needed rustc 1.99 (nixpkgs has 1.98), topf 0.6.1 needed Go 1.27, opencode 2.0.28 hit an upstream nix bug. Each was committed to main and broke build.yml until fixed by hand. Build every changed package (plus opencode-desktop for opencode) after its updater runs, and revert it like a failed updater if the build fails. Run nix flake update first so bumps are built against the lock that gets committed, and push those builds to Cachix. Drop the opencode updater hold, which the gate makes redundant: it will stay on 2.0.27 until a release with anomalyco/opencode#55494 builds.
Issue for this PR
Closes #55491 #55328
Type of change
What does this PR do?
At v2.0.28, packages/cli/script/build.ts imports NativeArch from the monorepo root (script/native-arch.ts), but the CLI source tree that nix/node_modules.nix produces omits the root script/ directory, so the flake build fails with "Cannot find module '../../../script/native-arch'".
The fix adds ../script to the fileset union. script/ is not a bun workspace, so node_modules and the hash in hashes.json are unchanged; the build simply gains the file it imports.
How did you verify your code works?
Built the flake at the v2.0.28 tag with this change: the CLI compiles and produces the binary.
Checklist
Added by the opencode bot (AI-generated).
Fixes #55328
Related: #52863