`bunx @openai/[email protected]` (and above) on `WSL2` is crashing
What version of Codex is running?
- ✔️
0.54.0-alpha.2 - ❌
0.54.0-alpha.3 - ❌
0.54.0
with bun 1.3.1 on WSL2 2.6.1.0.
What subscription do you have?
PRO
Which model were you using?
No response
What platform is your computer?
Linux 6.6.87.2-microsoft-standard-WSL2 x86_64 x86_64
What issue are you seeing?
118 | detectPackageManager() === "bun"
119 | ? "CODEX_MANAGED_BY_BUN"
120 | : "CODEX_MANAGED_BY_NPM";
121 | env[packageManagerEnvVar] = "1";
122 |
123 | const child = spawn(binaryPath, process.argv.slice(2), {
^
ENOENT: no such file or directory, posix_spawn '/tmp/bunx-1000-@openai/[email protected]/node_modules/@openai/codex/vendor/x86_64-unknown-linux-musl/codex/codex'
path: "/tmp/bunx-1000-@openai/[email protected]/node_modules/@openai/codex/vendor/x86_64-unknown-linux-musl/codex/codex",
syscall: "spawn /tmp/bunx-1000-@openai/[email protected]/node_modules/@openai/codex/vendor/x86_64-unknown-linux-musl/codex/codex",
errno: -2,
spawnargs: [],
code: "ENOENT"
at spawn (node:child_process:669:35)
at spawn (node:child_process:14:39)
at /tmp/bunx-1000-@openai/[email protected]/node_modules/@openai/codex/bin/codex.js:123:15
What steps can reproduce the bug?
bunx @openai/[email protected]
What is the expected behavior?
It should just run as it was doing with earlier versions up to and including 0.54.0-alpha.2!
Additional information
bun -v (version) → 1.3.1
wsl -v
WSL version: 2.6.1.0
Kernel version: 6.6.87.2-1
WSLg version: 1.0.66
MSRDC version: 1.2.6353
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.26200.6901
It works just fine on a different non-WSL2 Linux VM!
ubuntu@instance-20211204-1555:~$ bun -v
1.3.1
ubuntu@instance-20211204-1555:~$ uname -mprs
Linux 6.14.0-1015-oracle aarch64 aarch64
After installation of latest version I had this error: error: spawn /home/.../tools/image/packages/@openai/codex/lib/node_modules/@openai/codex/vendor/x86_64-unknown-linux-musl/codex/codex ENOENT at ChildProcess._handle.onexit (node:internal/child_process:285:19) at onErrorNT (node:internal/child_process:483:16) at process.processTicksAndRejections (node:internal/process/task_queues:90:21) { errno: -2, code: 'ENOENT', syscall: 'spawn /home/.../tools/image/packages/@openai/codex/lib/node_modules/@openai/codex/vendor/x86_64-unknown-linux-musl/codex/codex', path: '/home/.../tools/image/packages/@openai/codex/lib/node_modules/@openai/codex/vendor/x86_64-unknown-linux-musl/codex/codex', spawnargs: [] }
Ubuntu 22.04 Tried to install sudo apt install -y musl, than codex stopped loading at all. No errors. Downgraded to 0.53 and it work again
Same issue, downgrade to 0.53.0 works.
Error: spawn /home/user/.nvm/versions/node/v20.19.5/lib/node_modules/@openai/codex/vendor/x86_64-unknown-linux-musl/codex/codex ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:285:19)
at onErrorNT (node:internal/child_process:483:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn /home/user/.nvm/versions/node/v20.19.5/lib/node_modules/@openai/codex/vendor/x86_64-unknown-linux-musl/codex/codex',
path: '/home/user/.nvm/versions/node/v20.19.5/lib/node_modules/@openai/codex/vendor/x86_64-unknown-linux-musl/codex/codex',
spawnargs: []
}
same
What was the problem:
- The npm package uses musl-compiled Linux binaries (x86_64-unknown-linux-musl)
- WSL2 runs Ubuntu with glibc 2.39, not musl
- The musl binary was incompatible and segfaulted
Solution: Downloaded the codex-x86_64-unknown-linux-gnu.tar.gz (glibc version) from GitHub releases and replaced the musl binary at: /home/ilya/.nvm/versions/node/v24.7.0/lib/node_modules/@openai/codex/vendor/x86_64-unknown-linux-musl/codex/codex
Thanks for the report! Fixed in https://github.com/openai/codex/releases/tag/rust-v0.55.0.