Repository navigation
Conversation
- add the freebsd targets so `--target=opencode-freebsd-<arch>` resolves
and Bun.build({ compile: { target: "bun-freebsd-<arch>" } }) works
- degrade the @parcel/watcher binding to a stub on FreeBSD, which has no
prebuilt @parcel/watcher-freebsd-* package
- disable --compile bytecode on FreeBSD, where bun does not emit it
@ff-labs/fff-bun is not published for every platform (FreeBSD, for one), so the hard import aborts the CLI at startup with "Cannot find module". Fall back to the existing unavailable path instead of importing it.
|
The following comment was made by an LLM, it may be inaccurate: |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
The previous change dropped the @ff-labs/fff-bun import unconditionally, which also disabled the file finder on linux/darwin/win32 where that package is published. Restore the import in fff.bun.ts and instead replace the module with an unavailable stub only for the freebsd target, mirroring the parcel-watcher handling in build.ts.
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
|
Please reopen. Patch is still valid and relevant |
Issue for this PR
Refs #48658 — the
@ff-labs/fff-bunstartup crash this also fixes.Type of change
What does this PR do?
Adds FreeBSD as a build target so the CLI can be built from source there.
In
packages/cli/script/build.ts:freebsdarm64/x64 targets, so--target=opencode-freebsd-<arch>resolves andBun.build({ compile: { target: "bun-freebsd-<arch>" } })produces a FreeBSD binary;@parcel/watcherbinding on FreeBSD. There is no@parcel/watcher-freebsd-*package, and the watcher already falls back tonode:fsfor file/entries watches and logs "backend not supported" for recursive directories, so a throwing stub is enough;@ff-labs/fff-bunmodule with an unavailable backend on FreeBSD. That package is not published for FreeBSD (itsosfield excludes it), so bun never installs it and the staticimport { FileFinder }infff.bun.tsthrowsCannot find modulebefore anything runs. The stub keepsavailablefalse and makescreatereturn a clean error instead of crashing startup;--compileon FreeBSD, where bun does not emit it.Every change is gated on the FreeBSD target (either
item.os === "freebsd"in the build script, or a plugin that only applies for that target), so Linux/macOS/Windows behaviour is untouched.The TUI also needs OpenTUI to accept
freebsd; that is anomalyco/opentui#1565.How did you verify your code works?
Built with Bun 1.4.2 on FreeBSD 15.1-RELEASE, on amd64 and aarch64:
Both produce a self-contained executable that starts and runs a conversation. I checked the degraded paths explicitly: the watcher falls back to
node:fs, andfff.availableisfalsewithcreatereturning the "unavailable" error rather than throwing.Screenshots / recordings
N/A — no UI change.
Checklist