Skip to content

opencode binary on macOS arm64 is 0 byte large when building from nix flake #4575

@Mic92

Description

@Mic92

Description

I made the same observation in nix-ai-tools, which is why I switched to bundeling the javascript. There is something off when running bun install inside the nix sandbox. The same commands work fine outside the sandbox.

$ nix build github:sst/opencode
$ ./result/bin/opencode --version
$ ls -al ./result/bin/.opencode-wrapped
.r-xr-xr-x@ 0 root 55 years  ./result/bin/.opencode-wrapped
$ du -sh ./result/bin/.opencode-wrapped
0B .opencode-wrapped

cc @Alb-O who authored the original build.

I might re-use your node normalization though to have reproducible hashes.

OpenCode version

d16c8c9

Steps to reproduce

see above

Operating System

macOS m4

Terminal

not important

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingnix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions