Skip to content

Opencode segfaults in NixOS+WSL #26846

Description

@muckelba

Description

I'm not able to run opencode inside of WSL running NixOS:

Unstable:

nix run nixpkgs/nixos-unstable#opencode -- --version
zsh: segmentation fault  nix run nixpkgs/nixos-unstable#opencode -- --version

Dev:

nix run github:anomalyco/opencode
error: Cannot build '/nix/store/hpl0fz47xs1bs9qfggv2g0v9yzrcbx2v-opencode-1.14.46+a780186.drv'.
       Reason: builder failed with exit code 1.
       Output paths:
         /nix/store/nrsbqjxmr2f2jpvjq6ly9vi7nzvjarjv-opencode-1.14.46+a780186
       Last 25 log lines:
       > dist/assets/angular-ts-BwZT4LLn.js                          183.87 kB │ gzip:  16.73 kB │ map:   249.42 kB
       > dist/assets/vue-vine-8moa0y9V.js                            190.27 kB │ gzip:  18.16 kB │ map:   255.24 kB
       > dist/assets/wolfram-lXgVvXCa.js                             262.44 kB │ gzip:  77.10 kB │ map:   279.68 kB
       > dist/assets/session-CLdkD14I.js                             528.86 kB │ gzip: 174.86 kB │ map: 1,979.63 kB
       > dist/assets/wasm-CG6Dc4jp.js                                622.38 kB │ gzip: 231.20 kB │ map:   622.93 kB
       > dist/assets/cpp-CofmeUqb.js                                 626.12 kB │ gzip:  44.93 kB │ map:   816.15 kB
       > dist/assets/ghostty-web-CmRTNB3y.js                         652.83 kB │ gzip: 188.67 kB │ map:   793.29 kB
       > dist/assets/emacs-lisp-C9XAeP06.js                          779.90 kB │ gzip: 196.57 kB │ map:   789.84 kB
       > dist/assets/index-BtCt3uoZ.js                             1,787.77 kB │ gzip: 512.18 kB │ map: 7,132.59 kB
       >
       > (!) Some chunks are larger than 500 kB after minification. Consider:
       > - Using dynamic import() to code-split the application
       > - Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
       > - Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
       > ✓ built in 12.13s
       > building opencode-linux-x64
       > Running smoke test: dist/opencode-linux-x64/bin/opencode --version
       > Smoke test failed for opencode-linux-x64: ShellError: Failed with exit code 139
       >  exitCode: 139,
       >    stdout: "",
       >    stderr: "",
       >
       >       at ShellPromise (unknown:75:16)
       >       at BunShell (unknown:191:35)
       >
       For full logs, run:
         nix log /nix/store/hpl0fz47xs1bs9qfggv2g0v9yzrcbx2v-opencode-1.14.46+a780186.drv

(exit code 139 is segfault)

Stable is working tho:

nix run nixpkgs/nixos-25.11#opencode -- --version
1.1.14

Also using the non-nixos version from the https://opencode.ai/install script works fine

How can i debug this?

WSL:

uname -r
6.6.87.2-microsoft-standard-WSL2

Nix:

nix --version
nix (Nix) 2.34.7

NixOS:

nixos-version
26.05.20260505.549bd84 (Yarara)

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

NixOS 26.05

Terminal

Windows Terminal

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions