Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package opencode for openSUSE:Factory checked in at 2026-09-14 16:26:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/opencode (Old) and /work/SRC/openSUSE:Factory/.opencode.new.1265 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "opencode" Mon Sep 14 16:26:23 2026 rev:12 rq:1377875 version:1.18.30 Changes: -------- --- /work/SRC/openSUSE:Factory/opencode/opencode.changes 2026-09-09 16:23:06.073906288 +0200 +++ /work/SRC/openSUSE:Factory/.opencode.new.1265/opencode.changes 2026-09-14 16:26:30.667953446 +0200 @@ -1,0 +2,13 @@ +Mon Sep 14 11:02:22 UTC 2026 - Martin Pluskal <[email protected]> + +- Add opencode-fix-filesystem-cycle.patch: every prompt failed with + "undefined is not an object (evaluating 'a.name')" when built + with bun 1.4.2, a circular import between core/filesystem.ts and + filesystem/search.ts left a layer dependency undefined + (boo#1280159, gh#anomalyco/opencode#48397) +- Set NO_BRP_STRIP_DEBUG=true at install time: brp-15-strip-debug + strips the compiled payload off the binary whenever the bun it + was built from is not fully stripped, leaving a binary that + reports bun's version + +------------------------------------------------------------------- New: ---- opencode-fix-filesystem-cycle.patch ----------(New B)---------- New: - Add opencode-fix-filesystem-cycle.patch: every prompt failed with "undefined is not an object (evaluating 'a.name')" when built ----------(New E)---------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ opencode.spec ++++++ --- /var/tmp/diff_new_pack.IcMfHR/_old 2026-09-14 16:26:32.316022396 +0200 +++ /var/tmp/diff_new_pack.IcMfHR/_new 2026-09-14 16:26:32.317022438 +0200 @@ -77,6 +77,8 @@ Patch1: %{name}-no-self-update.patch Patch2: %{name}-no-runtime-npm-install.patch Patch3: %{name}-no-grammar-download.patch +# PATCH-FIX-UPSTREAM opencode-fix-filesystem-cycle.patch boo#1280159 gh#anomalyco/opencode#48397 +Patch4: %{name}-fix-filesystem-cycle.patch # No floor. Which bun upstream wants changes with every release and Patch0 # turns a mismatch into a warning; a floor here would be a guess at which # older bun still works, and the package is a git snapshot anyway, so @@ -163,6 +165,12 @@ bun run ./script/build.ts --single --skip-install --skip-embed-web-ui %install +# brp-15-strip-debug runs binutils strip, not %%__strip, on every ELF that +# `file` reports as not stripped. Whether that is the case depends on how +# the bun it was compiled from was stripped (a project without debuginfo +# leaves bun's .symtab in place), and strip rewrites the file just as +# eu-strip does. +export NO_BRP_STRIP_DEBUG=true install -Dpm 0755 packages/opencode/dist/%{name}-linux-%{node_arch}/bin/%{name} \ %{buildroot}%{_bindir}/%{name} ++++++ README.SUSE-maint ++++++ --- /var/tmp/diff_new_pack.IcMfHR/_old 2026-09-14 16:26:32.365024446 +0200 +++ /var/tmp/diff_new_pack.IcMfHR/_new 2026-09-14 16:26:32.367024530 +0200 @@ -3,7 +3,7 @@ Read this before a version bump. The package is unusual in three ways: the sources are generated rather than downloaded, the whole npm dependency tree is -compiled into one executable, and three of the four patches exist only to stop +compiled into one executable, and three of the five patches exist only to stop the program reaching the network at runtime. None of that is obvious from the spec alone. @@ -30,9 +30,10 @@ producing something subtly broken - see "OpenTUI" below. If it moved, bump the opentui package first and update opentui_version here. -2. Rebase the four patches. They are small and all of them sit in code +2. Rebase the five patches. They are small and all of them sit in code upstream changes rarely, but the grammar patch in particular is a single - line in a large file. + line in a large file. Drop opencode-fix-filesystem-cycle.patch once the + release contains upstream PR 48397 (see "Runtime network access"). 3. Build locally, then read %check. It runs the compiled binary, which is the only thing that proves the payload survived packaging. @@ -165,17 +166,29 @@ when a download fails. OPENCODE_ALLOW_GRAMMAR_DOWNLOAD=1 -The fourth patch, opencode-relax-bun-version.patch, is unrelated and, as of -1.18.30, inert. Upstream's build script fails unless bun satisfies a caret -range around the version in the packageManager field: 1.18.30 pins [email protected] -and Factory has 1.4.2, which satisfies ^1.3.14, so the check passes and the -patch changes nothing. Keep it anyway. Both versions float independently, a -distribution ships one bun, and the day either side crosses a major the check -would stop a build for a reason that is upstream's convenience rather than a -real incompatibility - the build itself is Bun.build() plus shell calls, and -%check runs the resulting binary, so a bun that really is too new fails -visibly on its own. To confirm it is still inert, grep a build log for -"expected bun@": the warning is absent when the range is satisfied. +The other two patches are unrelated to the network. + +opencode-relax-bun-version.patch is, as of 1.18.30, inert. Upstream's build +script fails unless bun satisfies a caret range around the version in the +packageManager field: 1.18.30 pins [email protected] and Factory has 1.4.2, which +satisfies ^1.3.14, so the check passes and the patch changes nothing. Keep it +anyway. Both versions float independently, a distribution ships one bun, and +the day either side crosses a major the check would stop a build for a reason +that is upstream's convenience rather than a real incompatibility - the build +itself is Bun.build() plus shell calls, and %check runs the resulting binary, +so a bun that really is too new fails visibly on its own. To confirm it is +still inert, grep a build log for "expected bun@": the warning is absent when +the range is satisfied. + +opencode-fix-filesystem-cycle.patch is a real bug fix (boo#1280159). Two +modules in packages/core import each other, and filesystem.ts reads a value +from filesystem/search.ts at module scope, so only one evaluation order +works. bun 1.3 picked the working one; bun 1.4's bundler picks the other, +the layer dependency comes out undefined, and every prompt fails with +"undefined is not an object (evaluating 'a.name')". Upstream builds with a +pinned bun 1.3.14 and does not see it. The patch is the search.ts hunk of +upstream PR 48397; drop it when a release contains that PR - if it applies +with an offset only, it is still needed. Two things are deliberately left alone: @@ -271,7 +284,12 @@ - No debuginfo, on purpose. `bun build --compile` appends its payload past everything the ELF headers describe. eu-strip rewrites the file, drops the payload, and the result aborts at startup. Hence - %global debug_package %{nil} and %global __strip /bin/true. + %global debug_package %{nil} and %global __strip /bin/true, and + NO_BRP_STRIP_DEBUG=true in %install, because brp-15-strip-debug uses + binutils strip on any ELF `file` calls "not stripped" - which the + compiled binary is whenever the bun it was copied from kept its + .symtab (a project built without debuginfo). The symptom is %check + printing bun's version instead of opencode's. - The lockfile is regenerated rather than frozen. bun rewrites the key order of trustedDependencies and patchedDependencies, so any bun newer ++++++ opencode-fix-filesystem-cycle.patch ++++++ From: kernel-oops <[email protected]> Subject: fix(core): break filesystem cycle in compiled prompts Patch-mainline: Submitted, https://github.com/anomalyco/opencode/pull/48397 Backported-by: Martin Pluskal <[email protected]> core/src/filesystem.ts reads FileSystemSearch.node at module scope while filesystem/search.ts imports FileSystem back from it. bun 1.4's bundler evaluates the two bodies the other way round, so the deps array captures undefined and every prompt dies in SystemPrompt.environment with "undefined is not an object (evaluating 'a.name')" (boo#1280159). The search.ts hunk of the upstream PR; its other files are CI and a test runner. diff --git a/packages/core/src/filesystem/search.ts b/packages/core/src/filesystem/search.ts index c7738388bcc0..6dcffc084ffb 100644 --- a/packages/core/src/filesystem/search.ts +++ b/packages/core/src/filesystem/search.ts @@ -5,7 +5,9 @@ import path from "path" import { Context, Effect, Layer, Scope } from "effect" import { Fff } from "#fff" import fuzzysort from "fuzzysort" -import { FileSystem } from "../filesystem" +// Keep the service module type-only: it depends on this module's node during initialisation. +import type { GlobInput, GrepInput } from "../filesystem" +import { FileSystem } from "@opencode-ai/schema/filesystem" import { FSUtil } from "../fs-util" import { Location } from "../location" import { Ripgrep } from "../ripgrep" @@ -14,8 +16,8 @@ import { Flag } from "../flag/flag" export interface Interface { readonly find: (input: FileSystem.FindInput) => Effect.Effect<FileSystem.Entry[]> - readonly glob: (input: FileSystem.GlobInput) => Effect.Effect<readonly FileSystem.Entry[]> - readonly grep: (input: FileSystem.GrepInput) => Effect.Effect<readonly FileSystem.Match[]> + readonly glob: (input: GlobInput) => Effect.Effect<readonly FileSystem.Entry[]> + readonly grep: (input: GrepInput) => Effect.Effect<readonly FileSystem.Match[]> } export class Service extends Context.Service<Service, Interface>()("@opencode/v2/FileSystem/Search") {}
