Skip to content

feat(core): support FreeBSD source builds - #48655

Closed
Mawfyy wants to merge 4 commits into
anomalyco:devfrom
Mawfyy:freebsd-source-build
Closed

Mawfyy wants to merge 4 commits into
anomalyco:devfrom
Mawfyy:freebsd-source-build

Conversation

@Mawfyy

@Mawfyy Mawfyy commented Sep 12, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #48658

Type of change

  • Bug fix

What does this PR do?

On FreeBSD, bun install succeeds but skips @ff-labs/fff-bun (its os field has no freebsd entry), so the static import in fff.bun.ts crashes the CLI at startup.

This replaces the static import with a guarded top-level dynamic import. When the package is missing, Fff.available() returns false and Fff.create() returns an error result, so the existing ripgrep fallback in search.ts handles search and the CLI boots normally. Behavior is unchanged on platforms where the package exists.

Also pins @parcel/[email protected] alongside the other watcher platform bindings (needed for standalone builds with bun install --os="*" --cpu="*"), and reserves minimumReleaseAgeExcludes entries for future FreeBSD native packages.

How did you verify your code works?

  • With the binding removed from node_modules (same state FreeBSD sees): bun run --cwd packages/opencode ./src/index.ts --version exits 0, Fff.available() is false, ripgrep fallback engages
  • With the binding present (Linux): Fff.available() is true, Fff.create() succeeds — no behavior change
  • bun install --os=freebsd --cpu=x64 completes
  • bun run typecheck passes in packages/core and packages/opencode; full bun test in packages/core: 1098 pass, 0 fail

Not yet tested on a real FreeBSD host; TUI (@opentui/core) and PTY (bun-pty) still lack FreeBSD binaries — those are separate issues.

Screenshots / recordings

Not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

bun install succeeds on FreeBSD since Bun only skips platform-mismatched
optional dependencies instead of failing, but @ff-labs/fff-bun declares
os/cpu fields without a FreeBSD entry so the package is never extracted.
The static import then crashed startup, so resolve the binding through a
guarded top-level dynamic import and degrade to the existing ripgrep
fallback when it is missing.

Also add @parcel/watcher-freebsd-x64 to the pinned watcher bindings and
reserve minimumReleaseAge excludes for future FreeBSD native packages.
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Sep 12, 2026
@Mawfyy
Mawfyy marked this pull request as draft September 12, 2026 13:30
@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Sep 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@github-actions

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@Mawfyy
Mawfyy marked this pull request as ready for review September 12, 2026 13:40
@Mawfyy
Mawfyy marked this pull request as draft September 12, 2026 13:40
@Mawfyy
Mawfyy marked this pull request as ready for review September 13, 2026 03:09
@Mawfyy Mawfyy closed this Sep 13, 2026
@Mawfyy Mawfyy reopened this Sep 13, 2026
@thdxr

thdxr commented Oct 10, 2026

Copy link
Copy Markdown
Member

This branch has been upgraded to V2. We're no longer taking PRs for V1. If you think this is still relevant, please port it over and open it for V2.

— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

opencode crashes at startup on FreeBSD: Cannot find module '@ff-labs/fff-bun'

2 participants