Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package pi-coding-agent for openSUSE:Factory 
checked in at 2026-11-08 19:22:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/pi-coding-agent (Old)
 and      /work/SRC/openSUSE:Factory/.pi-coding-agent.new.3759290 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "pi-coding-agent"

Sun Nov  8 19:22:04 2026 rev:18 rq:1396115 version:1.5.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/pi-coding-agent/pi-coding-agent.changes  
2026-11-04 19:51:47.031269850 +0100
+++ 
/work/SRC/openSUSE:Factory/.pi-coding-agent.new.3759290/pi-coding-agent.changes 
    2026-11-08 19:22:28.987115424 +0100
@@ -1,0 +2,12 @@
+Sun Nov  8 07:02:09 UTC 2026 - Martin Pluskal <[email protected]>
+
+- Build the QuickJS codemode runtime from source:
+  quickjs-wasi 3.6.2 with quickjs-ng 6d46d07, using the
+  distribution clang and wasi-sysroot: codemode scripts run again.
+- Ship the encoding, headers, structured-clone and crypto sandbox
+  extensions built from the same tree.
+- Hold Slowroll unresolvable until its toolchain catches up:
+  BuildRequires libclang_rt23 >= 23.1.4 for the wasm32 builtins.
+- Drop pi-codemode-without-quickjs.patch, now obsolete.
+
+-------------------------------------------------------------------

Old:
----
  pi-codemode-without-quickjs.patch

New:
----
  quickjs-ng-6d46d07.tar.gz
  quickjs-wasi-3.6.2.tar.gz

----------(Old B)----------
  Old:  BuildRequires libclang_rt23 >= 23.1.4 for the wasm32 builtins.
- Drop pi-codemode-without-quickjs.patch, now obsolete.
----------(Old E)----------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ pi-coding-agent.spec ++++++
--- /var/tmp/diff_new_pack.prfw0y/_old  2026-11-08 19:22:30.487177478 +0100
+++ /var/tmp/diff_new_pack.prfw0y/_new  2026-11-08 19:22:30.489177561 +0100
@@ -30,6 +30,9 @@
 # MIT (59), Apache-2.0 (38), BSD-3-Clause (13), ISC (7), BlueOak-1.0.0 (3),
 # Unlicense (1) and 0BSD (1); every dependency declares a license. The tag
 # below is the union of all of them.
+# - The QuickJS runtime is built from Source20/21 (MIT quickjs-wasi 3.6.2,
+#   MIT quickjs-ng 6d46d07, Apache-2.0 ada 3.4.3).
+# - mbedtls 4.0 is Apache-2.0 OR GPL-2.0-or-later; Apache-2.0 is elected.
 License:        0BSD AND Apache-2.0 AND BSD-3-Clause AND BlueOak-1.0.0 AND ISC 
AND MIT AND Unlicense
 URL:            https://github.com/earendil-works/pi
 Source0:        
https://registry.npmjs.org/%{npm_name}/-/pi-coding-agent-%{version}.tgz
@@ -49,15 +52,23 @@
 # `osc service manualrun`, re-apply the same strip before committing,
 # or source-binaries.py goes red again.
 Source13:       %{name}-rpmlintrc
+Source20:       
https://github.com/vercel-labs/quickjs-wasi/archive/refs/tags/[email protected]#/quickjs-wasi-3.6.2.tar.gz
+Source21:       
https://github.com/quickjs-ng/quickjs/archive/6d46d07d04041b40f4f49eaa7fdebe44c314c699.tar.gz#/quickjs-ng-6d46d07.tar.gz
 Patch0:         pi-disable-self-update.patch
 # PATCH-FIX-OPENSUSE pi-use-modular-runtime.patch [email protected] -- point 
bin and the rpc-entry export at the modular runtime we ship and patch, not at 
the pre-bundled copy
 Patch1:         pi-use-modular-runtime.patch
-# PATCH-FIX-OPENSUSE pi-codemode-without-quickjs.patch [email protected] -- 
fail codemode scripts with a clear tool error: %build strips the prebuilt 
QuickJS runtime they would load
-Patch2:         pi-codemode-without-quickjs.patch
+BuildRequires:  binaryen
+BuildRequires:  clang >= 23
 BuildRequires:  fdupes
+# libclang_rt23 >= 23.1.4 carries the wasm32 builtins the link needs.
+BuildRequires:  libclang_rt23 >= 23.1.4
+BuildRequires:  lld
+BuildRequires:  llvm >= 23
 BuildRequires:  local-npm-registry
+BuildRequires:  make
 BuildRequires:  nodejs >= 22.19.0
 BuildRequires:  nodejs-packaging
+BuildRequires:  wasi-libc
 Requires:       nodejs >= 22.19.0
 Recommends:     %{name}-examples = %{version}-%{release}
 # On Linux dist/utils/clipboard.js drives these tools directly -- copying
@@ -76,6 +87,10 @@
 # be unbundled.
 Provides:       bundled(highlight.js)
 Provides:       bundled(marked)
+# The wasm runtime below links these; their versions are in the notice above.
+Provides:       bundled(ada) = 3.4.3
+Provides:       bundled(mbedtls) = 4.0.0
+Provides:       bundled(quickjs-ng) = 0.17.0
 BuildArch:      noarch
 %include        %{_sourcedir}/node_modules.spec.inc
 
@@ -103,7 +118,6 @@
 cd %{name}
 %patch -P 0 -p1
 %patch -P 1 -p1
-%patch -P 2 -p1
 cp -p %{SOURCE1} LICENSE
 
 # Source maps (4.9 MB) and TypeScript declarations (0.6 MB) are of no use in
@@ -125,7 +139,7 @@
 # corresponding source is not in this package, and the extension downloads a
 # non-redistributable shareware WAD on first run. Source0 stays pristine
 # (see above), so this rm keeps it out of the payload instead.
-# Source-Binary-Exception: */examples/extensions/doom-overlay/* -- test-data: 
example asset only, deleted in %prep and never shipped, loaded or linked by 
anything this package builds or tests; not rebuildable here without the full 
Doom sources
+# Source-Binary-Exception: */examples/extensions/doom-overlay/* -- test-data: 
example asset only, deleted in %%prep and never shipped, loaded or linked by 
anything this package builds or tests; not rebuildable here without the full 
Doom sources
 rm -rf examples/extensions/doom-overlay
 
 # Upstream stopped shipping a shrinkwrap in 1.0.1 (it was production-only and
@@ -168,16 +182,17 @@
 rm -rf node_modules/@earendil-works/pi-tui/native
 rm -f node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm
 
-# quickjs-wasi's quickjs.wasm and extensions/*.so are prebuilt binaries too:
-# the wasm is QuickJS-NG compiled with wasi-sdk, which is neither packaged
-# nor fetchable in an offline build, and the extensions need the same
-# toolchain's experimental dynamic-linking ABI, so neither is rebuildable
-# here. Nothing passes `extensions:` to QuickJS.create, so the .so files are
-# never loaded; the wasm is load-bearing for the codemode tool, which
-# pi-codemode-without-quickjs.patch turns into a clear tool error. The
-# tarball is repacked without all six (see above); this rm is the same
-# safety net as the pi-tui/photon lines.
-rm -f node_modules/quickjs-wasi/quickjs.wasm 
node_modules/quickjs-wasi/extensions/*/*.so
+# The sandbox runtime is built from Source20/21 with the
+# distribution toolchain, then installed over the stripped tree.
+mkdir -p %{_builddir}/quickjs-wasi %{_builddir}/qjs-sdk/bin
+tar -xzf %{SOURCE20} -C %{_builddir}/quickjs-wasi --strip-components=1
+tar -xzf %{SOURCE21} -C %{_builddir}/quickjs-wasi/quickjs-ng 
--strip-components=1
+for t in clang clang++ llvm-ar wasm-ld; do ln -sf %{_bindir}/$t 
%{_builddir}/qjs-sdk/bin/$t; done
+# The C interface must match the vendored JS exactly.
+grep -q '"version": "3.6.2"' node_modules/quickjs-wasi/package.json
+%make_build -C %{_builddir}/quickjs-wasi quickjs.wasm 
extensions/encoding/encoding.so extensions/headers/headers.so 
extensions/structured-clone/structured-clone.so extensions/crypto/crypto.so 
WASI_SDK=%{_builddir}/qjs-sdk SYSROOT=%{_datadir}/wasi-sysroot 
WASM_OPT=%{_bindir}/wasm-opt
+cp -p %{_builddir}/quickjs-wasi/quickjs.wasm 
node_modules/quickjs-wasi/quickjs.wasm
+for e in encoding headers structured-clone crypto; do install -D -m644 
%{_builddir}/quickjs-wasi/extensions/$e/$e.so 
node_modules/quickjs-wasi/extensions/$e/$e.so; done
 
 # Zero-length sources upstream never trimmed.
 find . -type f -size 0 -delete
@@ -238,6 +253,30 @@
 # The %%{_bindir} symlink is absolute and does not resolve inside the 
buildroot.
 test "$(node %{buildroot}%{nodejs_sitelib}/%{npm_name}/dist/cli.js --version)" 
= "%{version}"
 
+# The wasm runtime is built above: a script must evaluate to a real result,
+# and every shipped extension must load and answer a basic call.
+cd %{buildroot}%{nodejs_sitelib}/%{npm_name}
+node --input-type=module -e '
+import { QuickJS } from "./node_modules/quickjs-wasi/dist/index.js";
+import { readFileSync } from "node:fs";
+const dir = "./node_modules/quickjs-wasi";
+const wasm = readFileSync(dir + "/quickjs.wasm");
+const vm = await QuickJS.create({ wasm });
+if (vm.dump(vm.evalCode("40 + 2")) !== 42) throw new Error("codemode wasm 
smoke failed");
+vm.dispose();
+const probes = {
+  "encoding": "new TextDecoder().decode(new TextEncoder().encode(\"hi\"))",
+  "headers": "new Headers({\"x-a\": \"1\"}).get(\"x-a\")",
+  "structured-clone": "structuredClone({a: [1, 2]}).a[1]",
+  "crypto": "crypto.getRandomValues(new Uint8Array(8)).length"
+};
+const wants = { "encoding": "hi", "headers": "1", "structured-clone": 2, 
"crypto": 8 };
+for (const name of Object.keys(probes)) {
+  const v = await QuickJS.create({ wasm, extensions: [{ name, wasm: 
readFileSync(dir + "/extensions/" + name + "/" + name + ".so") }] });
+  if (v.dump(v.evalCode(probes[name])) !== wants[name]) throw new Error(name + 
" smoke failed");
+  v.dispose();
+}'
+
 %files
 # Marked in place rather than copied to %%{_docdir}: pi resolves README.md and
 # CHANGELOG.md at runtime relative to its own package directory.

Reply via email to