The package rpms/nodejs-undici.git has added or updated architecture specific content in
its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/nodejs-undici.git/commit/?id=6042....
Change:
+ExclusiveArch: %{ix86} x86_64 aarch64 ppc64le riscv64 noarch
Thanks.
Full change:
============
commit 28b0a22f39d938325d30665b46d57860fdb96f4e
Author: Zephyr Lykos <git(a)mochaa.ws>
Date: Tue Jan 30 15:29:19 2024 +0100
Load WASM from .wasm files
This is an adjusted version of the PR listed below,
with the actual patch replaced by the version
merged into undici upstream:
https://github.com/nodejs/undici/pull/2643
Merges:
https://src.fedoraproject.org/rpms/nodejs-undici/pull-request/3
Related: rhbz#2259320
diff --git a/0002-Support-building-for-externally-shared-js-builtins-2.patch
b/0002-Support-building-for-externally-shared-js-builtins-2.patch
new file mode 100644
index 0000000..94608d0
--- /dev/null
+++ b/0002-Support-building-for-externally-shared-js-builtins-2.patch
@@ -0,0 +1,155 @@
+From 834aec2a4fba9d4b734862530f465dcf90a998bb Mon Sep 17 00:00:00 2001
+From: Zephyr Lykos <self(a)mochaa.ws>
+Date: Sun, 28 Jan 2024 18:50:22 +0800
+Subject: [PATCH] Support building for externally shared js builtins (#2643)
+
+Signed-off-by: rpm-build <rpm-build>
+---
+ CONTRIBUTING.md | 10 ++++++++++
+ build/wasm.js | 41 ++++++++++++++++++++++++++++++-----------
+ lib/client.js | 4 ++--
+ package.json | 1 +
+ 4 files changed, 43 insertions(+), 13 deletions(-)
+
+diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
+index 3a7f3ff..7a91026 100644
+--- a/CONTRIBUTING.md
++++ b/CONTRIBUTING.md
+@@ -6,6 +6,7 @@
+ * [Test](#test)
+ * [Coverage](#coverage)
+ * [Update `WPTs`](#update-wpts)
++ * [Building for externally shared node builtins](#external-builds)
+ * [Developer's Certificate of Origin 1.1](#developers-certificate-of-origin)
+ * [Moderation Policy](#moderation-policy)
+
+@@ -165,6 +166,15 @@ npm run test
+ npm run coverage
+ ```
+
++<a id="external-builds"></a>
++### Building for externally shared node builtins
++
++If you are packaging `undici` for a distro, this might help if you would like to use
++an unbundled version instead of bundling one in `libnode.so`.
++
++To enable this, pass `EXTERNAL_PATH=/path/to/global/node_modules/undici` to
`build/wasm.js`.
++You shall also pass this path to `--shared-builtin-undici/undici-path` in Node.js's
`configure.py`.
++
+ <a id="developers-certificate-of-origin"></a>
+ ## Developer's Certificate of Origin 1.1
+
+diff --git a/build/wasm.js b/build/wasm.js
+index 2b63f3c..1104cfe 100644
+--- a/build/wasm.js
++++ b/build/wasm.js
+@@ -2,7 +2,7 @@
+
+ const { execSync } = require('child_process')
+ const { writeFileSync, readFileSync } = require('fs')
+-const { join, resolve } = require('path')
++const { join, resolve, basename } = require('path')
+
+ const ROOT = resolve(__dirname, '../')
+ const WASM_SRC = resolve(__dirname, '../deps/llhttp')
+@@ -15,6 +15,8 @@ let WASM_CFLAGS = process.env.WASM_CFLAGS ||
'--sysroot=/usr/share/wasi-sysroot
+ let WASM_LDFLAGS = process.env.WASM_LDFLAGS || ''
+ const WASM_LDLIBS = process.env.WASM_LDLIBS || ''
+
++const EXTERNAL_PATH = process.env.EXTERNAL_PATH
++
+ // These are relevant for undici and should not be overridden
+ WASM_CFLAGS += ' -Ofast -fno-exceptions -fvisibility=hidden
-mexec-model=reactor'
+ WASM_LDFLAGS += ' -Wl,-error-limit=0 -Wl,-O3 -Wl,--lto-O3 -Wl,--strip-all'
+@@ -60,6 +62,23 @@ if (hasApk) {
+ writeFileSync(join(WASM_OUT, 'wasm_build_env.txt'), buildInfo)
+ }
+
++const writeWasmChunk = EXTERNAL_PATH
++ ? (path, dest) => {
++ const base64 = readFileSync(join(WASM_OUT, path)).toString('base64')
++ writeFileSync(join(WASM_OUT, dest), `
++const { Buffer } = require('node:buffer')
++
++module.exports = Buffer.from('${base64}', 'base64')
++`)
++ }
++ : (path, dest) => {
++ writeFileSync(join(WASM_OUT, dest), `
++const { fs } = require('node:fs')
++
++module.exports = fs.readFileSync(require.resolve('./${basename(path)}'))
++`)
++ }
++
+ // Build wasm binary
+ execSync(`${WASM_CC} ${WASM_CFLAGS} ${WASM_LDFLAGS} \
+ ${join(WASM_SRC, 'src')}/*.c \
+@@ -67,11 +86,7 @@ execSync(`${WASM_CC} ${WASM_CFLAGS} ${WASM_LDFLAGS} \
+ -o ${join(WASM_OUT, 'llhttp.wasm')} \
+ ${WASM_LDLIBS}`, { stdio: 'inherit' })
+
+-const base64Wasm = readFileSync(join(WASM_OUT,
'llhttp.wasm')).toString('base64')
+-writeFileSync(
+- join(WASM_OUT, 'llhttp-wasm.js'),
+- `module.exports = '${base64Wasm}'\n`
+-)
++writeWasmChunk('llhttp.wasm', 'llhttp-wasm.js')
+
+ // Build wasm simd binary
+ execSync(`${WASM_CC} ${WASM_CFLAGS} -msimd128 ${WASM_LDFLAGS} \
+@@ -80,8 +95,12 @@ execSync(`${WASM_CC} ${WASM_CFLAGS} -msimd128 ${WASM_LDFLAGS} \
+ -o ${join(WASM_OUT, 'llhttp_simd.wasm')} \
+ ${WASM_LDLIBS}`, { stdio: 'inherit' })
+
+-const base64WasmSimd = readFileSync(join(WASM_OUT,
'llhttp_simd.wasm')).toString('base64')
+-writeFileSync(
+- join(WASM_OUT, 'llhttp_simd-wasm.js'),
+- `module.exports = '${base64WasmSimd}'\n`
+-)
++writeWasmChunk('llhttp_simd.wasm', 'llhttp_simd-wasm.js')
++
++if (EXTERNAL_PATH) {
++ writeFileSync(join(ROOT, 'loader.js'), `
++'use strict'
++
++module.exports =
require('node:module').createRequire('${EXTERNAL_PATH}/loader.js')('./index-fetch.js')
++`)
++}
+diff --git a/lib/client.js b/lib/client.js
+index 22cb390..12798ac 100644
+--- a/lib/client.js
++++ b/lib/client.js
+@@ -493,7 +493,7 @@ async function lazyllhttp () {
+
+ let mod
+ try {
+- mod = await
WebAssembly.compile(Buffer.from(require('./llhttp/llhttp_simd-wasm.js'),
'base64'))
++ mod = await WebAssembly.compile(require('./llhttp/llhttp_simd-wasm.js'))
+ } catch (e) {
+ /* istanbul ignore next */
+
+@@ -501,7 +501,7 @@ async function lazyllhttp () {
+ // being enabled, but the occurring of this other error
+ // *
https://github.com/emscripten-core/emscripten/issues/11495
+ // got me to remove that check to avoid breaking Node 12.
+- mod = await WebAssembly.compile(Buffer.from(llhttpWasmData ||
require('./llhttp/llhttp-wasm.js'), 'base64'))
++ mod = await WebAssembly.compile(llhttpWasmData ||
require('./llhttp/llhttp-wasm.js'))
+ }
+
+ return await WebAssembly.instantiate(mod, {
+diff --git a/package.json b/package.json
+index 68ee4da..140e852 100644
+--- a/package.json
++++ b/package.json
+@@ -65,6 +65,7 @@
+ "*.d.ts",
+ "index.js",
+ "index-fetch.js",
++ "loader.js",
+ "lib",
+ "types",
+ "docs"
+--
+2.43.0
+
diff --git a/nodejs-undici.spec b/nodejs-undici.spec
index 74698dc..c85504a 100644
--- a/nodejs-undici.spec
+++ b/nodejs-undici.spec
@@ -20,6 +20,7 @@ Source4: %{npm_name}-sources.sh
# Upstream proposal:
https://github.com/nodejs/undici/pull/2403
Patch: 0001-feat-allow-customization-of-build-environment.patch
+Patch: 0002-Support-building-for-externally-shared-js-builtins-2.patch
# Binary artifacts in this package are aimed at the wasm32-wasi
"architecture".
%global _binaries_in_noarch_packages_terminate_build 0
@@ -63,7 +64,7 @@ export WASM_LDFLAGS='-nodefaultlibs'
export WASM_LDLIBS='-lc'
# `npm run build` uses docker; invoke the build script directly
-%{__nodejs} build/wasm.js
+env EXTERNAL_PATH='%{nodejs_sitelib}/%{npm_name}' %{__nodejs} build/wasm.js
npm --offline pack
%install
commit 8573fc267d13a919aa10d9ca209a8223f477d946
Author: Fedora Release Engineering <releng(a)fedoraproject.org>
Date: Thu Jan 25 09:10:56 2024 +0000
Rebuilt for
https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
commit 6042dd12a5756847dd4a08ae7000dd9960c7de00
Author: Yaakov Selkowitz <yselkowi(a)redhat.com>
Date: Mon Jan 15 13:52:46 2024 -0500
Do not attempt to build on s390x
lld is a build requirement of the WASI toolchain but is not yet
supported on s390x (although work is underway upstream). Therefore,
%nodejs_arches cannot be used here until that changes.
diff --git a/nodejs-undici.spec b/nodejs-undici.spec
index 42126cd..74698dc 100644
--- a/nodejs-undici.spec
+++ b/nodejs-undici.spec
@@ -24,7 +24,8 @@ Patch: 0001-feat-allow-customization-of-build-environment.patch
# Binary artifacts in this package are aimed at the wasm32-wasi
"architecture".
%global _binaries_in_noarch_packages_terminate_build 0
BuildArch: noarch
-ExclusiveArch: %{nodejs_arches} noarch
+# would be %%{nodejs_arches} noarch, but lld is not yet supported on s390x
+ExclusiveArch: %{ix86} x86_64 aarch64 ppc64le riscv64 noarch
BuildRequires: clang lld wasi-libc-devel
BuildRequires: nodejs-devel npm
commit 245453d25e1ca8357251c529edf147923e447aca
Author: Fedora Release Engineering <releng(a)fedoraproject.org>
Date: Sun Jan 21 09:49:03 2024 +0000
Rebuilt for
https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
commit 24ecdd7aa00af702086a9654264ae77560c6dde8
Author: Jan Staněk <jstanek(a)redhat.com>
Date: Tue Nov 28 15:06:46 2023 +0100
Update to version 5.28.1 (rhbz#2251486)
diff --git a/.gitignore b/.gitignore
index 5c0e49c..4be56c5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,7 @@
/undici-5.27.2-nm-prod.tgz
/undici-5.27.2-nm-dev.tgz
/undici-5.27.2-bundled-licenses.txt
+/undici-5.28.1-stripped.tar.gz
+/undici-5.28.1-nm-prod.tgz
+/undici-5.28.1-nm-dev.tgz
+/undici-5.28.1-bundled-licenses.txt
diff --git a/nodejs-undici.spec b/nodejs-undici.spec
index b37f838..42126cd 100644
--- a/nodejs-undici.spec
+++ b/nodejs-undici.spec
@@ -6,7 +6,7 @@
Name: nodejs-%{npm_name}
Summary: An HTTP/1.1 client, written from scratch for Node.js
-Version: 5.27.2
+Version: 5.28.1
Release: %autorelease
License: MIT
diff --git a/sources b/sources
index 5bc7fbc..4fa4912 100644
--- a/sources
+++ b/sources
@@ -1,4 +1,4 @@
-SHA512 (undici-5.27.2-stripped.tar.gz) =
3219eee32bc447135297f1dc30b79a05e5d09dcf7dc42efc9e07827d8fb44be666b7b8c4f744dd9e44ef1bf1adfb7ecd25977f35dabab30728d3758456b79276
-SHA512 (undici-5.27.2-nm-prod.tgz) =
943c004cca6d408267af3e14edaecd9613f3147667cb2a47a867d48c087f2f258133b6b282fd1f582cdc099f792c2edb72e8a0e56e598934407793c59bc3d743
-SHA512 (undici-5.27.2-nm-dev.tgz) =
7a1b81b1e98e93c39739ef7a975dc3d0d2d2f87f254579f669c5893fd6195b9b86e356476353ed593219de7ce6cc0b882fc39a999a368a9669345cfe84ac237e
-SHA512 (undici-5.27.2-bundled-licenses.txt) =
3e591adb16e09b1c6fb75eb97a6ac51cd06e0aeae2bd5950a15902346e2c9626cb50203bfd0e15c7e8c98af8f24b81c1ce6617c359e7c0e7d0a6366457c844ba
+SHA512 (undici-5.28.1-stripped.tar.gz) =
0224b75e48e36afb77ecce11ab7522a9694840fb44623262a7cc0bc4a44f7599f754495fc60ea3e999fc8919219c10828441967cc71e1baa4ff26a635ae44f44
+SHA512 (undici-5.28.1-nm-prod.tgz) =
cb830d0be6a43b7949c069766edeefde6d7b181e5016274dc726bc77e065e265fe0d72fe05da697ea00b311658cbfd2186ab134bdf114086abd045d5cb32e966
+SHA512 (undici-5.28.1-nm-dev.tgz) =
be64fb863f21befdbe82723ba37f058161987044b731c8fa1568282e0ccb1856c879522a2b45337fe8b26dfca513c1337cacb8fb93092ec463614533abb0748d
+SHA512 (undici-5.28.1-bundled-licenses.txt) =
3e591adb16e09b1c6fb75eb97a6ac51cd06e0aeae2bd5950a15902346e2c9626cb50203bfd0e15c7e8c98af8f24b81c1ce6617c359e7c0e7d0a6366457c844ba
commit 924c58e36bb707764b9c93170d7ea36e5fcc8a4c
Author: Jan Staněk <jstanek(a)redhat.com>
Date: Wed Nov 15 11:22:23 2023 +0100
Import sources into Fedora (rhbz#2249060)
diff --git a/sources b/sources
index d86d885..5bc7fbc 100644
--- a/sources
+++ b/sources
@@ -1,4 +1,4 @@
-SHA512 (undici-5.27.2-stripped.tar.gz) =
ac9ff51fe301a933714d255f023eab990c29a1c06efe29bb83f3fad38375e92cdc7656f76fbb1feb6d52326bcac781da30b3266d19eb64b0b040bd4fb8604097
-SHA512 (undici-5.27.2-nm-prod.tgz) =
6aa9d4abb1a5042ed76030acbe92d5f61ce71ce644741550336f9571464723e5774ad63052cf513b802b5bdbdd59b2c06b913534902e00c8302814377e00edc5
-SHA512 (undici-5.27.2-nm-dev.tgz) =
3158c55b19e06dbb00d56c6c6b719fe715b57a7a059bf456a8a5691b222580d4fd4d200ea411059d394b6202738d5a1a13dfa28234850552325a4d16df8bdf28
+SHA512 (undici-5.27.2-stripped.tar.gz) =
3219eee32bc447135297f1dc30b79a05e5d09dcf7dc42efc9e07827d8fb44be666b7b8c4f744dd9e44ef1bf1adfb7ecd25977f35dabab30728d3758456b79276
+SHA512 (undici-5.27.2-nm-prod.tgz) =
943c004cca6d408267af3e14edaecd9613f3147667cb2a47a867d48c087f2f258133b6b282fd1f582cdc099f792c2edb72e8a0e56e598934407793c59bc3d743
+SHA512 (undici-5.27.2-nm-dev.tgz) =
7a1b81b1e98e93c39739ef7a975dc3d0d2d2f87f254579f669c5893fd6195b9b86e356476353ed593219de7ce6cc0b882fc39a999a368a9669345cfe84ac237e
SHA512 (undici-5.27.2-bundled-licenses.txt) =
3e591adb16e09b1c6fb75eb97a6ac51cd06e0aeae2bd5950a15902346e2c9626cb50203bfd0e15c7e8c98af8f24b81c1ce6617c359e7c0e7d0a6366457c844ba
commit f756dffc05a56d95e08fdf115c8c2fff057d65a5
Author: Jan Staněk <jstanek(a)redhat.com>
Date: Wed Nov 15 11:14:26 2023 +0100
undici-sources: check for missing dependencies
[skip changelog]
diff --git a/undici-sources.sh b/undici-sources.sh
index c46e62a..da8e3ec 100755
--- a/undici-sources.sh
+++ b/undici-sources.sh
@@ -1,6 +1,16 @@
#!/bin/sh
-# deps: curl rpm npm nodejs-packaging-bundler
set -e
+check_deps() {
+ deps_ec=0
+ for dep in "$@"; do
+ command -v "$dep" >/dev/null || {
+ printf 'Missing dependency: %s\n' "$dep" >&2
+ deps_ec="$((deps_ec + 1))"
+ }
+ done
+ return "$deps_ec"
+}
+check_deps curl rpm npm nodejs-packaging-bundler
UNDICI_VERSION="$(rpm --specfile nodejs-undici.spec --qf
'%{VERSION}\n')"; readonly UNDICI_VERSION
commit 9365e7e7152a1ea4bbeba836166f8d6d8c23989f
Author: Jan Staněk <jstanek(a)redhat.com>
Date: Tue Nov 14 11:02:53 2023 +0100
add link to the upstream PR for our only patch
[skip changelog]
diff --git a/nodejs-undici.spec b/nodejs-undici.spec
index adc7e13..b37f838 100644
--- a/nodejs-undici.spec
+++ b/nodejs-undici.spec
@@ -18,6 +18,7 @@ Source2: %{npm_name}-%{version}-nm-dev.tgz
Source3: %{npm_name}-%{version}-bundled-licenses.txt
Source4: %{npm_name}-sources.sh
+# Upstream proposal:
https://github.com/nodejs/undici/pull/2403
Patch: 0001-feat-allow-customization-of-build-environment.patch
# Binary artifacts in this package are aimed at the wasm32-wasi
"architecture".
commit 9e562d3d4ced31ef9251cbeb681edd960b419f5e
Author: Jan Staněk <jstanek(a)redhat.com>
Date: Tue Nov 14 10:56:29 2023 +0100
co-own %{nodejs_sitelib} directory
This will ensure the directory is removed when the last package that owns it
is removed. Before, the directory would be kept (empty) on systems where
all nodejs and modules were removed.
diff --git a/nodejs-undici.spec b/nodejs-undici.spec
index f823758..adc7e13 100644
--- a/nodejs-undici.spec
+++ b/nodejs-undici.spec
@@ -81,6 +81,7 @@ npm --offline run test || :
%files
%doc README.md
%license LICENSE %{npm_name}-%{version}-bundled-licenses.txt
+%dir %{nodejs_sitelib}
%{nodejs_sitelib}/%{npm_name}
%changelog
commit cd3a130f92e5d0231c6cc0f6694c16fba4df5d56
Author: Jan Staněk <jstanek(a)redhat.com>
Date: Fri Nov 10 13:29:23 2023 +0100
update to version 5.27.2
diff --git a/.gitignore b/.gitignore
index 1141526..5c0e49c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,7 @@
/undici-5.26.4-nm-prod.tgz
/undici-5.26.4-nm-dev.tgz
/undici-5.26.4-bundled-licenses.txt
+/undici-5.27.2-stripped.tar.gz
+/undici-5.27.2-nm-prod.tgz
+/undici-5.27.2-nm-dev.tgz
+/undici-5.27.2-bundled-licenses.txt
diff --git a/nodejs-undici.spec b/nodejs-undici.spec
index 7fdfc3b..f823758 100644
--- a/nodejs-undici.spec
+++ b/nodejs-undici.spec
@@ -6,7 +6,7 @@
Name: nodejs-%{npm_name}
Summary: An HTTP/1.1 client, written from scratch for Node.js
-Version: 5.26.4
+Version: 5.27.2
Release: %autorelease
License: MIT
diff --git a/sources b/sources
index c51268c..d86d885 100644
--- a/sources
+++ b/sources
@@ -1,4 +1,4 @@
-SHA512 (undici-5.26.4-stripped.tar.gz) =
f50c3c731dc7cd8af9646fd7abd13e452ba258f66dc53be07feba827475828a16a7641934ae283cc9ca11bc8d0e348c0bfcb8ecccda2bb7afb6bdb01f5ddde63
-SHA512 (undici-5.26.4-nm-prod.tgz) =
2b6d0a2728289a91331314d7c40515a784d5d22dcc538fcbf33ffa09c826afd07c5605dff50d54d09b8010b9acdc1b00637e84461c274046ffbcb77bcbeda9a6
-SHA512 (undici-5.26.4-nm-dev.tgz) =
67bcd32c485c0385a4e7d9b1c703a23367c05438c6f6c34ac986056e4110b92d107fc7b0eec6d2dfb5036c7120d769fb2694cfd9dcccb3403ed639b9c993a9af
-SHA512 (undici-5.26.4-bundled-licenses.txt) =
3e591adb16e09b1c6fb75eb97a6ac51cd06e0aeae2bd5950a15902346e2c9626cb50203bfd0e15c7e8c98af8f24b81c1ce6617c359e7c0e7d0a6366457c844ba
+SHA512 (undici-5.27.2-stripped.tar.gz) =
ac9ff51fe301a933714d255f023eab990c29a1c06efe29bb83f3fad38375e92cdc7656f76fbb1feb6d52326bcac781da30b3266d19eb64b0b040bd4fb8604097
+SHA512 (undici-5.27.2-nm-prod.tgz) =
6aa9d4abb1a5042ed76030acbe92d5f61ce71ce644741550336f9571464723e5774ad63052cf513b802b5bdbdd59b2c06b913534902e00c8302814377e00edc5
+SHA512 (undici-5.27.2-nm-dev.tgz) =
3158c55b19e06dbb00d56c6c6b719fe715b57a7a059bf456a8a5691b222580d4fd4d200ea411059d394b6202738d5a1a13dfa28234850552325a4d16df8bdf28
+SHA512 (undici-5.27.2-bundled-licenses.txt) =
3e591adb16e09b1c6fb75eb97a6ac51cd06e0aeae2bd5950a15902346e2c9626cb50203bfd0e15c7e8c98af8f24b81c1ce6617c359e7c0e7d0a6366457c844ba