Skip to content

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

Closed as not planned

Description

@qqlzfmn

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

Activity

  1. github-actions commented on Jan 16, 2026

    @github-actions
    Contributor

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

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

  2. dodumosu commented on Jan 18, 2026

    @dodumosu

    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 [email protected] with binaries:
     - opencode
    
    6 packages installed [73.06s]
    ➜  ~  opencode
    /usr/bin/env: ‘node’: No such file or directory
    ➜  ~ 
    
  3. sigmareaver commented on Jan 19, 2026

    @sigmareaver

    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.
    
  4. youralmight commented on Feb 27, 2026

    @youralmight

    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.
    

    This happens on macos bun, too.

    ~ via 🥟 v1.3.9 
    ❯     bun add --global opencode-ai oh-my-opencode
    bun add v1.3.9 (cf6cdbbb)
    
    installed [email protected] with binaries:
     - opencode
    installed [email protected] with binaries:
     - oh-my-opencode
    
    6 packages installed [1.72s]
    
    Blocked 1 postinstall. Run `bun pm -g untrusted` for details.
    
    ~ via 🥟 v1.3.9 
    ❯ opencode
    env: node: No such file or directory
    
  5. github-actions commented on Apr 28, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingwindows

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions