Skip to content

fix(nix): ship the root script/ dir to the CLI build - #55494

Merged
rekram1-node merged 1 commit into
anomalyco:devfrom
fabiob:fix/nix-ship-script-dir
Oct 19, 2026
Merged

rekram1-node merged 1 commit into
anomalyco:devfrom
fabiob:fix/nix-ship-script-dir

Conversation

@fabiob

@fabiob fabiob commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #55491 #55328

Type of change

  • Bug fix

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

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Added by the opencode bot (AI-generated).

Fixes #55328

Related: #52863

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fixes #55328
Related: #52863

@fabiob
fabiob force-pushed the fix/nix-ship-script-dir branch from ae55d61 to b2fdf8e Compare October 16, 2026 07:10
fleischerdesign added a commit to fleischerdesign/nixfiles that referenced this pull request Oct 16, 2026
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.
@rekram1-node
rekram1-node merged commit 3171839 into anomalyco:dev Oct 19, 2026
2 checks passed
@fabiob
fabiob deleted the fix/nix-ship-script-dir branch October 19, 2026 06:36
drzero42 added a commit to drzero42/nixpkgs that referenced this pull request Oct 19, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants