Skip to content

Compiled binary does not embed fff native library (bun --compile) #31584

Description

@dmtrKovalenko

Description

The compiled opencode binary (built with bun build --compile) does not embed the @ff-labs/fff-bun native library correctly. bun --compile only bundles statically analyzable imports, and fff resolves its native lib at runtime, so the embedded path was missing/incorrect in the standalone binary. This breaks fff-backed file search (glob/grep/file search) in released binaries.

fff 0.9.4 adds an embedded-lib resolution path that references native libs via type: "file" imports plus a build-time FFF_LIBC constant (gnu/musl) so Bun embeds them into the compiled binary. We need to bump to 0.9.4 and wire up the FFF_LIBC define in the opencode build for linux targets.

OpenCode version

dev (HEAD)

Steps to reproduce

  1. Build a standalone binary: ./packages/opencode/script/build.ts --single
  2. Run fff-backed search from the compiled binary (e.g. opencode debug file search <query>)
  3. Native lib fails to load in the compiled binary

Operating System

macOS / Linux (gnu + musl)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
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