Bug: bunx opencode-ai installs incorrect musl binary on WSL (glibc environment) #6432

Open
opened 2026-02-16 18:04:12 -05:00 by yindo · 3 comments
Owner

Originally created by @qqlzfmn on GitHub (Jan 16, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

Hi team,

I'm encountering an issue when attempting to use the opencode command-line tool via bunx in a WSL (Windows Subsystem for Linux) environment.

Problem:
When I execute bunx opencode-ai in my WSL2 environment, Bun proceeds to download and run the tool. However, it appears to be selecting and installing opencode-linux-x64-baseline-musl in the temporary bunx cache. My WSL environment, however, uses glibc (as is typical for most WSL distributions). This results in runtime errors related to libc incompatibility when opencode-ai attempts to execute its underlying binary.

Specifically, the opencode binary (from node_modules/opencode-ai/bin/opencode within the bunx cache) fails to execute because it's compiled against musl while the system expects glibc.

Expected Behavior:
When bunx opencode-ai is executed, the opencode-ai package should correctly detect the glibc based WSL environment and ensure that the appropriate glibc compatible binary (i.e., opencode-linux-x64-baseline) is used/installed for execution.

Terminal Output:

$ bunx opencode-ai
ENOENT: no such file or directory, posix_spawn '/tmp/bunx-1000-opencode-ai@latest/node_modules/opencode-linux-x64-baseline-musl/bin/opencode'

$ ls /tmp/bunx-1000-opencode-ai@latest/node_modules
opencode-ai  opencode-linux-x64  opencode-linux-x64-baseline  opencode-linux-x64-baseline-musl  opencode-linux-x64-musl

$ /tmp/bunx-1000-opencode-ai@latest/node_modules/opencode-linux-x64-baseline-musl/bin/opencode --version
zsh: no such file or directory: /tmp/bunx-1000-opencode-ai@latest/node_modules/opencode-linux-x64-baseline-musl/bin/opencode

$ /tmp/bunx-1000-opencode-ai@latest/node_modules/opencode-linux-x64-baseline/bin/opencode --version
1.1.23

My WSL Environment Details:

$ uname -a   
Linux HOST 6.6.87.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun  5 18:30:46 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

$ ldd --version
ldd (Ubuntu GLIBC 2.39-0ubuntu8.6) 2.39
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

Thank you for your time and consideration

Plugins

No response

OpenCode version

1.1.23

Steps to reproduce

  1. Set up a fresh WSL2 environment (e.g., Ubuntu 24.04 LTS).
  2. Install Bun (if not already installed).
  3. Run the command: bunx opencode-ai
  4. Observe the errors related to libc incompatibility.

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

Windows Terminal

Originally created by @qqlzfmn on GitHub (Jan 16, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description Hi team, I'm encountering an issue when attempting to use the `opencode` command-line tool via `bunx` in a WSL (Windows Subsystem for Linux) environment. **Problem:** When I execute `bunx opencode-ai` in my WSL2 environment, Bun proceeds to download and run the tool. However, it appears to be selecting and installing `opencode-linux-x64-baseline-musl` in the temporary `bunx` cache. My WSL environment, however, uses `glibc` (as is typical for most WSL distributions). This results in runtime errors related to `libc` incompatibility when `opencode-ai` attempts to execute its underlying binary. Specifically, the `opencode` binary (from `node_modules/opencode-ai/bin/opencode` within the `bunx` cache) fails to execute because it's compiled against `musl` while the system expects `glibc`. **Expected Behavior:** When `bunx opencode-ai` is executed, the `opencode-ai` package should correctly detect the `glibc` based WSL environment and ensure that the appropriate `glibc` compatible binary (i.e., `opencode-linux-x64-baseline`) is used/installed for execution. **Terminal Output:** ``` $ bunx opencode-ai ENOENT: no such file or directory, posix_spawn '/tmp/bunx-1000-opencode-ai@latest/node_modules/opencode-linux-x64-baseline-musl/bin/opencode' $ ls /tmp/bunx-1000-opencode-ai@latest/node_modules opencode-ai opencode-linux-x64 opencode-linux-x64-baseline opencode-linux-x64-baseline-musl opencode-linux-x64-musl $ /tmp/bunx-1000-opencode-ai@latest/node_modules/opencode-linux-x64-baseline-musl/bin/opencode --version zsh: no such file or directory: /tmp/bunx-1000-opencode-ai@latest/node_modules/opencode-linux-x64-baseline-musl/bin/opencode $ /tmp/bunx-1000-opencode-ai@latest/node_modules/opencode-linux-x64-baseline/bin/opencode --version 1.1.23 ``` **My WSL Environment Details:** ``` $ uname -a Linux HOST 6.6.87.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun 5 18:30:46 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux $ ldd --version ldd (Ubuntu GLIBC 2.39-0ubuntu8.6) 2.39 Copyright (C) 2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Written by Roland McGrath and Ulrich Drepper. ``` Thank you for your time and consideration ### Plugins _No response_ ### OpenCode version 1.1.23 ### Steps to reproduce 1. Set up a fresh WSL2 environment (e.g., Ubuntu 24.04 LTS). 2. Install Bun (if not already installed). 3. Run the command: `bunx opencode-ai` 4. Observe the errors related to `libc` incompatibility. ### Screenshot and/or share link _No response_ ### Operating System Windows 11 ### Terminal Windows Terminal
yindo added the windowsbug labels 2026-02-16 18:04:12 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 16, 2026):

This issue might be a duplicate of or related to existing issues. Please check:

  • #8744: [Bug] Windows binary selection picks AVX version on non-AVX CPUs - Similar binary variant selection issue where the wrong compiled binary is installed based on platform/CPU capabilities

Feel free to ignore if this doesn't address your specific case.

@github-actions[bot] commented on GitHub (Jan 16, 2026): This issue might be a duplicate of or related to existing issues. Please check: - #8744: [Bug] Windows binary selection picks AVX version on non-AVX CPUs - Similar binary variant selection issue where the wrong compiled binary is installed based on platform/CPU capabilities Feel free to ignore if this doesn't address your specific case.
Author
Owner

@dodumosu commented on GitHub (Jan 17, 2026):

Confirming that this also happens on native Linux. Since the automatic update to 1.1.25 on Ubuntu, it has been an issue:

➜  ~  bun remove -g opencode-ai
bun remove v1.3.5 (1e86cebd)

1 package installed [4.50s]
Removed: 1
➜  ~  bun add -g opencode-ai
bun add v1.3.5 (1e86cebd)

installed opencode-ai@1.1.25 with binaries:
 - opencode

6 packages installed [73.06s]
➜  ~  opencode
/usr/bin/env: ‘node’: No such file or directory
➜  ~ 
@dodumosu commented on GitHub (Jan 17, 2026): Confirming that this also happens on native Linux. Since the automatic update to 1.1.25 on Ubuntu, it has been an issue: ``` ➜ ~ bun remove -g opencode-ai bun remove v1.3.5 (1e86cebd) 1 package installed [4.50s] Removed: 1 ➜ ~ bun add -g opencode-ai bun add v1.3.5 (1e86cebd) installed opencode-ai@1.1.25 with binaries: - opencode 6 packages installed [73.06s] ➜ ~ opencode /usr/bin/env: ‘node’: No such file or directory ➜ ~ ```
Author
Owner

@sigmareaver commented on GitHub (Jan 19, 2026):

This also happens on Manjaro when installing via AUR:

Error relocating /lib/libstdc++.so.6: arc4random: symbol not found
Error relocating /lib/libstdc++.so.6: __fprintf_chk: symbol not found
Error relocating /lib/libstdc++.so.6: __openat_2: symbol not found
Error relocating /lib/libstdc++.so.6: __strftime_l: symbol not found
Error relocating /lib/libstdc++.so.6: __libc_single_threaded: symbol not found
Error relocating /lib/libstdc++.so.6: __memcpy_chk: symbol not found
Error relocating /lib/libstdc++.so.6: __cxa_thread_atexit_impl: symbol not found
Error relocating /lib/libstdc++.so.6: __read_chk: symbol not found
Error relocating /lib/libstdc++.so.6: strfromf128: symbol not found
Error relocating /lib/libstdc++.so.6: __mbsrtowcs_chk: symbol not found
Error relocating /lib/libstdc++.so.6: __strcpy_chk: symbol not found
Error relocating /lib/libstdc++.so.6: __memset_chk: symbol not found
Error relocating /lib/libstdc++.so.6: strtof128: symbol not found
Error relocating /lib/libstdc++.so.6: __wmemcpy_chk: symbol not found
Error relocating /lib/libstdc++.so.6: __sprintf_chk: symbol not found
Error relocating /lib/libstdc++.so.6: __memmove_chk: symbol not found
Error relocating /lib/libstdc++.so.6: __isoc23_strtoul: symbol not found
Error relocating /lib/libgcc_s.so.1: __cpu_indicator_init: symbol not found
Error relocating /lib/libgcc_s.so.1: __cpu_model: symbol not found
Error relocating /lib/libgcc_s.so.1: _dl_find_object: symbol not found
Error relocating /lib/libgcc_s.so.1: __memset_chk: symbol not found
Error relocating /lib/ld-linux-x86-64.so.2: unsupported relocation type 37

Dependencies:

readelf -d /usr/bin/opencode | grep NEEDED                                 0|1|0|0 ✔ 
 0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libc.musl-x86_64.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]

My pamac looks like this:

pamac search opencode                                                              ✔ 
opencode-pty  0.1.4-2                                                                                                                    AUR
    OpenCode plugin for interactive PTY management - run background processes, send input, read output with regex filtering
opencode-optimal-model-temps  1.0.2-1                                                                                                    AUR
    Minimal OpenCode plugin that hooks chat.params and nudges specific models to their preferred sampling temperature
opencode-openai-codex-auth  4.4.0-1                                                                                                      AUR
    OpenAI ChatGPT OAuth Plugin for opencode
opencode-git  0.9.3-1                                                                                                                    AUR
    The AI coding agent built for the terminal.
opencode-gemini-auth  1.3.8-1                                                                                                            AUR
    Google Gemini OAuth Plugin for opencode
opencode-desktop-bin  1.1.25-1                                                                                                           AUR
    OpenCode desktop client
opencode-cursor-auth  1.0.16-1                                                                                                           AUR
    Cursor Auth Plugin for opencode
opencode-bin  1.1.25-1                                                                                                                   AUR
    The AI coding agent built for the terminal.
opencode-antigravity-auth  1.3.0-1                                                                                                       AUR
    Google Antigravity OAuth Plugin for opencode
opencode-ai-bin  0.0.55-1                                                                                                                AUR
    terminal based agent that can build anything
opencode  1.1.25-1 [Installed]                                                                                                           AUR
    The AI coding agent built for the terminal.
@sigmareaver commented on GitHub (Jan 19, 2026): This also happens on Manjaro when installing via AUR: ``` Error relocating /lib/libstdc++.so.6: arc4random: symbol not found Error relocating /lib/libstdc++.so.6: __fprintf_chk: symbol not found Error relocating /lib/libstdc++.so.6: __openat_2: symbol not found Error relocating /lib/libstdc++.so.6: __strftime_l: symbol not found Error relocating /lib/libstdc++.so.6: __libc_single_threaded: symbol not found Error relocating /lib/libstdc++.so.6: __memcpy_chk: symbol not found Error relocating /lib/libstdc++.so.6: __cxa_thread_atexit_impl: symbol not found Error relocating /lib/libstdc++.so.6: __read_chk: symbol not found Error relocating /lib/libstdc++.so.6: strfromf128: symbol not found Error relocating /lib/libstdc++.so.6: __mbsrtowcs_chk: symbol not found Error relocating /lib/libstdc++.so.6: __strcpy_chk: symbol not found Error relocating /lib/libstdc++.so.6: __memset_chk: symbol not found Error relocating /lib/libstdc++.so.6: strtof128: symbol not found Error relocating /lib/libstdc++.so.6: __wmemcpy_chk: symbol not found Error relocating /lib/libstdc++.so.6: __sprintf_chk: symbol not found Error relocating /lib/libstdc++.so.6: __memmove_chk: symbol not found Error relocating /lib/libstdc++.so.6: __isoc23_strtoul: symbol not found Error relocating /lib/libgcc_s.so.1: __cpu_indicator_init: symbol not found Error relocating /lib/libgcc_s.so.1: __cpu_model: symbol not found Error relocating /lib/libgcc_s.so.1: _dl_find_object: symbol not found Error relocating /lib/libgcc_s.so.1: __memset_chk: symbol not found Error relocating /lib/ld-linux-x86-64.so.2: unsupported relocation type 37 ``` Dependencies: ``` readelf -d /usr/bin/opencode | grep NEEDED  0|1|0|0 ✔ 0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6] 0x0000000000000001 (NEEDED) Shared library: [libc.musl-x86_64.so.1] 0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1] ``` My pamac looks like this: ``` pamac search opencode  ✔ opencode-pty 0.1.4-2 AUR OpenCode plugin for interactive PTY management - run background processes, send input, read output with regex filtering opencode-optimal-model-temps 1.0.2-1 AUR Minimal OpenCode plugin that hooks chat.params and nudges specific models to their preferred sampling temperature opencode-openai-codex-auth 4.4.0-1 AUR OpenAI ChatGPT OAuth Plugin for opencode opencode-git 0.9.3-1 AUR The AI coding agent built for the terminal. opencode-gemini-auth 1.3.8-1 AUR Google Gemini OAuth Plugin for opencode opencode-desktop-bin 1.1.25-1 AUR OpenCode desktop client opencode-cursor-auth 1.0.16-1 AUR Cursor Auth Plugin for opencode opencode-bin 1.1.25-1 AUR The AI coding agent built for the terminal. opencode-antigravity-auth 1.3.0-1 AUR Google Antigravity OAuth Plugin for opencode opencode-ai-bin 0.0.55-1 AUR terminal based agent that can build anything opencode 1.1.25-1 [Installed] AUR The AI coding agent built for the terminal. ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6432