Skip to content

Nix package missing libstdc++ runtime dependency on Linux #18447

Closed as not planned

Description

@jerome-benoit

Description

The Nix package (nix/opencode.nix) fails at runtime on Linux with libstdc++.so.6: cannot open shared object file after recent changes that introduced native dependencies into the node_modules tree.

The package uses stdenvNoCC and wrapProgram only adds ripgrep and sysctl to PATH. There is no LD_LIBRARY_PATH or rpath setup for libstdc++.

Recent commits likely introduced the native dependency:

  • 37b8662 — "abstract SQLite behind runtime-conditional #db import" added drizzle-orm/node-sqlite path and bumped drizzle-orm to 1.0.0-beta.19 (which has better-sqlite3 as optional peer dep — a native C++ module)
  • @typescript/native-preview (Go/C++ binary) was already in the dependency tree

The fix would be to either:

  1. Add stdenv.cc.cc.lib to the wrapper's LD_LIBRARY_PATH in nix/opencode.nix
  2. Or ensure native modules are excluded from the Bun build path since the Nix package runs under Bun (which uses bun:sqlite, not node:sqlite)

Steps to reproduce

  1. nix build the opencode package from current dev on x86_64-linux
  2. Run ./result/bin/opencode
  3. Crash with libstdc++.so.6 not found

OpenCode version

1.2.27 (dev @ 5a0bfa7)

Operating System

x86_64-linux (NixOS / Nix on non-NixOS)

Activity

  1. behrangsa commented on May 29, 2026

    @behrangsa

    @thdxr isn't it possible to use Node's built-in file watching APIs?

  2. github-actions commented on Jul 29, 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

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions