git: d0d20f097d34 - main - misc/opencode: update to 2.4.4
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 03 Dec 2026 08:38:04 UTC
The branch main has been updated by samm:
URL: https://cgit.FreeBSD.org/ports/commit/?id=d0d20f097d349090c9708e07cce85f8372f9240b
commit d0d20f097d349090c9708e07cce85f8372f9240b
Author: Oleksii Samorukov <samm@FreeBSD.org>
AuthorDate: 2026-12-03 08:35:29 +0000
Commit: Oleksii Samorukov <samm@FreeBSD.org>
CommitDate: 2026-12-03 08:37:54 +0000
misc/opencode: update to 2.4.4
- Update to 2.4.4 and bundled OpenTUI 0.9.12.
- Rebase the FreeBSD watcher patch onto the reworked native layer in 2.4.4
(Layer.effect + FiberSet); the FreeBSD snapshot/poll behaviour is
unchanged.
- The opencode-pty daemon (0.6.0, protocol 9), fff 0.10.5 and Ghostty v1.4.0
pins are unchanged, and the remaining patches apply unchanged.
---
misc/opencode/Makefile | 4 +-
misc/opencode/distinfo | 8 +--
misc/opencode/files/opentui-zig-0.17.0.patch | 6 +-
.../patch-packages_core_src_filesystem_watcher.ts | 64 +++++++++++-----------
misc/opencode/files/setup-opentui-freebsd.py | 2 +-
5 files changed, 43 insertions(+), 41 deletions(-)
diff --git a/misc/opencode/Makefile b/misc/opencode/Makefile
index a2fc25a27b5f..150db20ada4f 100644
--- a/misc/opencode/Makefile
+++ b/misc/opencode/Makefile
@@ -1,6 +1,6 @@
PORTNAME= opencode
DISTVERSIONPREFIX= v
-DISTVERSION= 2.4.2
+DISTVERSION= 2.4.4
CATEGORIES= misc
# Upstream ships no FreeBSD builds of OpenTUI's Zig core, fff's Rust cdylib, the
@@ -12,7 +12,7 @@ CATEGORIES= misc
# OPENTUI_VERSION and FFF_VERSION must match the pinned @opentui/core and
# @ff-labs/fff-bun releases (the root package.json catalog and
# packages/core/package.json) or the native FFI ABI breaks.
-OPENTUI_VERSION= 0.9.9
+OPENTUI_VERSION= 0.9.12
FFF_VERSION= 0.10.5
#
# opencode-pty is the persistent terminal daemon the client spawns. It is built
diff --git a/misc/opencode/distinfo b/misc/opencode/distinfo
index db3faa953a6c..6b565b6c3bc9 100644
--- a/misc/opencode/distinfo
+++ b/misc/opencode/distinfo
@@ -701,10 +701,10 @@ SHA256 (opencode/rust/crates/zlob-1.6.3.crate) = f0f010d9b10495cc0037cb47cedc143
SIZE (opencode/rust/crates/zlob-1.6.3.crate) = 172523
SHA256 (opencode/rust/crates/zmij-1.0.23.crate) = 29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b
SIZE (opencode/rust/crates/zmij-1.0.23.crate) = 28612
-SHA256 (opencode/anomalyco-opencode-v2.4.2_GH0.tar.gz) = 306007d4b26be266f54249723028753647082f081ca6abc28beac68226bc0db4
-SIZE (opencode/anomalyco-opencode-v2.4.2_GH0.tar.gz) = 88308258
-SHA256 (opencode/anomalyco-opentui-v0.9.9_GH0.tar.gz) = ec1f458a61c7a89dcce61ee7e7afa196ad3dc8da13d880b24d977018b6c3d07d
-SIZE (opencode/anomalyco-opentui-v0.9.9_GH0.tar.gz) = 37586473
+SHA256 (opencode/anomalyco-opencode-v2.4.4_GH0.tar.gz) = 2a4015c8328bc3c5a4139c78db4f826e572ee4e9c1ac51f6ac97fc00e72286e8
+SIZE (opencode/anomalyco-opencode-v2.4.4_GH0.tar.gz) = 94646747
+SHA256 (opencode/anomalyco-opentui-v0.9.12_GH0.tar.gz) = f60639d5a2b9e3f3f972bd45d40af61778a166205993a737a653bdc99c56f66e
+SIZE (opencode/anomalyco-opentui-v0.9.12_GH0.tar.gz) = 37651051
SHA256 (opencode/dmtrKovalenko-fff-v0.10.5_GH0.tar.gz) = db50fa8aaabb77211f8dbeb4d77dc8852e0ee52070e40bfd9ef5af44ac50accc
SIZE (opencode/dmtrKovalenko-fff-v0.10.5_GH0.tar.gz) = 2798793
SHA256 (opencode/ghostty-org-ghostty-83fb95624b0439ee660c2679b43b38c8b63769cd_GH0.tar.gz) = 7759929eadaddf602d6fd5ad6b3403d854b91b7083975cd984bb525bc8275187
diff --git a/misc/opencode/files/opentui-zig-0.17.0.patch b/misc/opencode/files/opentui-zig-0.17.0.patch
index d9c73df3f3ee..76346bd1ddcb 100644
--- a/misc/opencode/files/opentui-zig-0.17.0.patch
+++ b/misc/opencode/files/opentui-zig-0.17.0.patch
@@ -1,7 +1,7 @@
Build OpenTUI with the Zig release available in the ports tree.
-OpenTUI 0.9.9 requires exactly Zig 0.17.1, but ports ships Zig 0.17.0. The
-0.17.1 tree only contains patch-level fixes; the 0.9.9 source builds unchanged
+OpenTUI 0.9.12 requires exactly Zig 0.17.1, but ports ships Zig 0.17.0. The
+0.17.1 tree only contains patch-level fixes; the 0.9.12 source builds unchanged
with 0.17.0. Lower the minimum and the exact-version check so the native core
can be built with the tree's Zig.
@@ -9,7 +9,7 @@ can be built with the tree's Zig.
+++ packages/native/build.zig.zon
@@ -2,7 +2,7 @@
.name = .opentui,
- .version = "0.9.9",
+ .version = "0.9.12",
.fingerprint = 0x5445027d063f5083,
- .minimum_zig_version = "0.17.1",
+ .minimum_zig_version = "0.17.0",
diff --git a/misc/opencode/files/patch-packages_core_src_filesystem_watcher.ts b/misc/opencode/files/patch-packages_core_src_filesystem_watcher.ts
index 160116dece5e..dcd60b9d73dc 100644
--- a/misc/opencode/files/patch-packages_core_src_filesystem_watcher.ts
+++ b/misc/opencode/files/patch-packages_core_src_filesystem_watcher.ts
@@ -11,7 +11,7 @@ reporting the subscription ready so config reloads cannot miss the first write.
+++ packages/core/src/filesystem/watcher.ts
@@ -8,7 +8,8 @@
import { isRecord } from "@opencode/util/record"
- import { Cause, Context, Effect, Layer, PubSub, RcMap, Stream } from "effect"
+ import { Cause, Context, Effect, FiberSet, Layer, PubSub, RcMap, Stream } from "effect"
import { lazy } from "../util/lazy.js"
-import { watch } from "node:fs"
+import { readdirSync, rmSync, statSync, watch } from "node:fs"
@@ -19,11 +19,10 @@ reporting the subscription ready so config reloads cannot miss the first write.
import path from "path"
import loadBinding from "./watcher-binding.js"
-@@ -198,14 +199,126 @@
- return Context.empty().pipe(Context.add(Service, test), Context.add(Test, test))
+@@ -199,6 +200,100 @@
}),
)
-+
+
+function poll(directory: string, names: ReadonlySet<string>, publish: (update: Update) => void): Subscription {
+ const scan = () => {
+ const next = new Map<string, string>()
@@ -117,32 +116,35 @@ reporting the subscription ready so config reloads cannot miss the first write.
+ }
+ })
+}
-
- export const nativeLayer = Layer.succeed(
++
+ export const nativeLayer = Layer.effect(
Native,
- Native.of({
- subscribe: (input) => {
-+ // Bun's parcel subscription path crashes on FreeBSD (N-API thread-safe
-+ // functions). Use the native snapshot API instead, which does not spawn
-+ // a callback thread, and poll the immediate entries from JS.
-+ if (process.platform === "freebsd" && input.type === "directory") {
-+ const native = watcher()
-+ if (!native) {
-+ return Effect.logError("watcher backend not supported", {
-+ directory: input.target,
-+ platform: process.platform,
-+ }).pipe(Effect.as(undefined))
-+ }
-+ return snapshotPoller(native, input.target, input.ignore, input.publish)
-+ }
- if (input.type === "file" || input.type === "entries") {
- const directory = input.type === "file" ? path.dirname(input.target) : input.target
- const names = new Set(input.type === "file" ? [path.basename(input.target)] : input.names)
-+ // Bun's fs.watch does not deliver events for missing entries on FreeBSD.
-+ // Poll the containing directory instead of using a native addon.
-+ if (process.platform === "freebsd") {
-+ return Effect.sync(() => poll(directory, names, input.publish))
+ Effect.gen(function* () {
+@@ -206,9 +301,27 @@
+ const runFork = yield* FiberSet.makeRuntime()
+ return Native.of({
+ subscribe: (input) => {
++ // Bun's parcel subscription path crashes on FreeBSD (N-API thread-safe
++ // functions). Use the native snapshot API instead, which does not spawn
++ // a callback thread, and poll the immediate entries from JS.
++ if (process.platform === "freebsd" && input.type === "directory") {
++ const native = watcher()
++ if (!native) {
++ return Effect.logError("watcher backend not supported", {
++ directory: input.target,
++ platform: process.platform,
++ }).pipe(Effect.as(undefined))
++ }
++ return snapshotPoller(native, input.target, input.ignore, input.publish)
+ }
- return Effect.try({
- try: () =>
- watch(directory, { recursive: false }, (_event, file) => {
+ if (input.type === "file" || input.type === "entries") {
+ const directory = input.type === "file" ? path.dirname(input.target) : input.target
+ const names = new Set(input.type === "file" ? [path.basename(input.target)] : input.names)
++ // Bun's fs.watch does not deliver events for missing entries on FreeBSD.
++ // Poll the containing directory instead of using a native addon.
++ if (process.platform === "freebsd") {
++ return Effect.sync(() => poll(directory, names, input.publish))
++ }
+ return Effect.try({
+ try: () =>
+ watch(directory, { recursive: false }, (_event, file) => {
diff --git a/misc/opencode/files/setup-opentui-freebsd.py b/misc/opencode/files/setup-opentui-freebsd.py
index d1698c5c5018..97ab4b013dfa 100644
--- a/misc/opencode/files/setup-opentui-freebsd.py
+++ b/misc/opencode/files/setup-opentui-freebsd.py
@@ -124,7 +124,7 @@ def create_platform_package(root: str, lib: str, version: str, arch: str) -> str
def main() -> int:
root = sys.argv[1]
lib = sys.argv[2]
- version = sys.argv[3] if len(sys.argv) > 3 else "0.9.9"
+ version = sys.argv[3] if len(sys.argv) > 3 else "0.9.12"
arch = sys.argv[4] if len(sys.argv) > 4 else "x64"
if arch not in ("x64", "arm64"):
raise SystemExit(f"unsupported arch tag: {arch}")