[Pkg-javascript-devel] Bug#1068912: bookworm-pu: package node-undici/5.15.0+dfsg1+~cs20.10.9.3-1+deb12u4

Jérémy Lal kapouer at melix.org
Sat Apr 13 10:52:38 BST 2024


Package: release.debian.org
Severity: normal
Tags: bookworm
X-Debbugs-Cc: node-undici at packages.debian.org, Debian Javascript Maintainers <pkg-javascript-devel at lists.alioth.debian.org>
Control: affects -1 + src:node-undici
User: release.debian.org at packages.debian.org
Usertags: pu

[ Reason ]
node-undici: FTBFS with nodejs 18.19.0+dfsg-6~deb12u1
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1063530

[ Impact ]
node-undici FTBFS, also several other packages need node-undici
to properly export its typescript types, which it currently doesn't.

[ Tests ]
(What automated or manual tests cover the affected code?)
Rebuild+Autopkgtest should be enough to cover the affected code.
All this is caused by a regression introduced by nodejs 18.19.0+dfsg-6~deb12u1

[ Risks ]
No further risks.

[ Checklist ]
  [x] *all* changes are documented in the d/changelog
  [x] I reviewed all changes and I approve them
  [x] attach debdiff against the package in (old)stable
  [x] the issue is verified as fixed in unstable

[ Changes ]
  * Import upstream patch that moves index.d.ts to types/ (closes #1063530)
  * Force @types/node to use local copy of undici-types
  * Fix build failures on lld 15+

[ Other info ]
node-zx, node-v8-compile-cache, node-babel7 will also be proposed,
to fix their tests suites w.r.t. the aforementioned regression.
-------------- next part --------------
diff -Nru node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/changelog node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/changelog
--- node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/changelog	2023-12-21 11:14:59.000000000 +0100
+++ node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/changelog	2024-04-13 11:22:02.000000000 +0200
@@ -1,3 +1,12 @@
+node-undici (5.15.0+dfsg1+~cs20.10.9.3-1+deb12u4) UNRELEASED; urgency=medium
+
+  [ Ryan Gonzalez ]
+  * Import upstream patch that moves index.d.ts to types/ (closes #1063530)
+  * Force @types/node to use local copy of undici-types
+  * Fix build failures on lld 15+
+
+ -- J?r?my Lal <kapouer at melix.org>  Sat, 13 Apr 2024 11:22:02 +0200
+
 node-undici (5.15.0+dfsg1+~cs20.10.9.3-1+deb12u3) bookworm-security; urgency=medium
 
   * Team upload.
diff -Nru node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/gbp.conf node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/gbp.conf
--- node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/gbp.conf	2023-12-21 11:08:13.000000000 +0100
+++ node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/gbp.conf	2024-04-13 11:19:52.000000000 +0200
@@ -1,4 +1,5 @@
 [DEFAULT]
+debian-branch = bookworm
 pristine-tar=True
 filter=[ '.gitignore', '.travis.yml', '.git*' ]
 component=['llhttp', 'llparse', 'llparse-frontend', 'llparse-builder', 'binary-search']
diff -Nru node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/nodejs/build node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/nodejs/build
--- node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/nodejs/build	2023-12-21 11:08:13.000000000 +0100
+++ node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/nodejs/build	2024-04-13 11:18:29.000000000 +0200
@@ -10,7 +10,7 @@
 #  - direct clang call
 clang -nodefaultlibs --sysroot=/usr -target wasm32-unknown-wasi \
 	-Ofast -fno-exceptions -fvisibility=hidden \
-	-mexec-model=reactor -Wl,-lc -Wl,-error-limit=0 -Wl,-O3 \
+	-mexec-model=reactor -Wl,-lc -Wl,--error-limit=0 -Wl,-O3 \
 	-Wl,--lto-O3 -Wl,--strip-all -Wl,--allow-undefined \
 	-Wl,--export-dynamic -Wl,--export-table -Wl,--export=malloc \
 	-Wl,--export=free \
diff -Nru node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/nodejs/extcopies node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/nodejs/extcopies
--- node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/nodejs/extcopies	1970-01-01 01:00:00.000000000 +0100
+++ node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/nodejs/extcopies	2024-04-13 11:18:29.000000000 +0200
@@ -0,0 +1 @@
+ at types/node
diff -Nru node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/nodejs/extlinks node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/nodejs/extlinks
--- node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/nodejs/extlinks	2022-10-22 13:28:40.000000000 +0200
+++ node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/nodejs/extlinks	2024-04-13 11:18:29.000000000 +0200
@@ -1,4 +1,3 @@
 busboy
 @types/debug
- at types/node
 @types/semver
diff -Nru node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/patches/Add-publish-types-script-2273.patch node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/patches/Add-publish-types-script-2273.patch
--- node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/patches/Add-publish-types-script-2273.patch	1970-01-01 01:00:00.000000000 +0100
+++ node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/patches/Add-publish-types-script-2273.patch	2024-04-13 11:18:29.000000000 +0200
@@ -0,0 +1,341 @@
+From: Ethan Arrowood <ethan at arrowood.dev>
+Date: Wed, 20 Sep 2023 15:02:42 -0600
+Subject: Add publish types script (#2273)
+
+* add publish types script
+
+* use postpublish script
+
+* 5.24.0-test.0
+
+* 5.24.0-test.1
+
+* uncomment
+
+* 5.24.0-test.2
+
+* simplify automation
+
+* 5.24.0-test.3
+
+* fix script
+
+* 5.24.0-test.4
+
+* fix script
+
+* 5.24.0-test.5
+
+* undici-type at 5.24.0-test.5
+
+* restore versions
+
+* delete generated file
+
+* Update update-undici-types-version.js
+
+Co-authored-by: Superchupu <53496941+SuperchupuDev at users.noreply.github.com>
+
+* fix contributor list and fix types export
+
+* this should fix types
+
+* one more adjustment
+
+* 5.24.0-test.6
+
+* undici-types at 5.24.0-test.6
+
+* revert versions and add README for undici-types
+
+---------
+
+Co-authored-by: Superchupu <53496941+SuperchupuDev at users.noreply.github.com>
+Origin: upstream, https://github.com/nodejs/undici/commit/5c2e597bd938ce99a0246f9dfbfac6d3f3a31be9
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1063530
+---
+ index.d.ts                             | 55 ++--------------------------------
+ package.json                           | 32 +++++++++++++++++++-
+ scripts/update-undici-types-version.js | 18 +++++++++++
+ types/README.md                        |  6 ++++
+ types/index.d.ts                       | 54 +++++++++++++++++++++++++++++++++
+ types/package.json                     | 55 ++++++++++++++++++++++++++++++++++
+ 6 files changed, 166 insertions(+), 54 deletions(-)
+ create mode 100644 scripts/update-undici-types-version.js
+ create mode 100644 types/README.md
+ create mode 100644 types/index.d.ts
+ create mode 100644 types/package.json
+
+diff --git a/index.d.ts b/index.d.ts
+index e914634..83a786d 100644
+--- a/index.d.ts
++++ b/index.d.ts
+@@ -1,54 +1,3 @@
+-import Dispatcher from'./types/dispatcher'
+-import { setGlobalDispatcher, getGlobalDispatcher } from './types/global-dispatcher'
+-import { setGlobalOrigin, getGlobalOrigin } from './types/global-origin'
+-import Pool from'./types/pool'
+-import { RedirectHandler, DecoratorHandler } from './types/handlers'
+-
+-import BalancedPool from './types/balanced-pool'
+-import Client from'./types/client'
+-import buildConnector from'./types/connector'
+-import errors from'./types/errors'
+-import Agent from'./types/agent'
+-import MockClient from'./types/mock-client'
+-import MockPool from'./types/mock-pool'
+-import MockAgent from'./types/mock-agent'
+-import mockErrors from'./types/mock-errors'
+-import ProxyAgent from'./types/proxy-agent'
+-import { request, pipeline, stream, connect, upgrade } from './types/api'
+-
+-export * from './types/cookies'
+-export * from './types/fetch'
+-export * from './types/file'
+-export * from './types/filereader'
+-export * from './types/formdata'
+-export * from './types/diagnostics-channel'
+-export * from './types/websocket'
+-export { Interceptable } from './types/mock-interceptor'
+-
+-export { Dispatcher, BalancedPool, Pool, Client, buildConnector, errors, Agent, request, stream, pipeline, connect, upgrade, setGlobalDispatcher, getGlobalDispatcher, setGlobalOrigin, getGlobalOrigin, MockClient, MockPool, MockAgent, mockErrors, ProxyAgent, RedirectHandler, DecoratorHandler }
++export * from './types/index'
++import Undici from './types/index'
+ export default Undici
+-
+-declare namespace Undici {
+-  var Dispatcher: typeof import('./types/dispatcher').default
+-  var Pool: typeof import('./types/pool').default;
+-  var RedirectHandler: typeof import ('./types/handlers').RedirectHandler
+-  var DecoratorHandler: typeof import ('./types/handlers').DecoratorHandler
+-  var createRedirectInterceptor: typeof import ('./types/interceptors').createRedirectInterceptor
+-  var BalancedPool: typeof import('./types/balanced-pool').default;
+-  var Client: typeof import('./types/client').default;
+-  var buildConnector: typeof import('./types/connector').default;
+-  var errors: typeof import('./types/errors').default;
+-  var Agent: typeof import('./types/agent').default;
+-  var setGlobalDispatcher: typeof import('./types/global-dispatcher').setGlobalDispatcher;
+-  var getGlobalDispatcher: typeof import('./types/global-dispatcher').getGlobalDispatcher;
+-  var request: typeof import('./types/api').request;
+-  var stream: typeof import('./types/api').stream;
+-  var pipeline: typeof import('./types/api').pipeline;
+-  var connect: typeof import('./types/api').connect;
+-  var upgrade: typeof import('./types/api').upgrade;
+-  var MockClient: typeof import('./types/mock-client').default;
+-  var MockPool: typeof import('./types/mock-pool').default;
+-  var MockAgent: typeof import('./types/mock-agent').default;
+-  var mockErrors: typeof import('./types/mock-errors').default;
+-  var fetch: typeof import('./types/fetch').fetch;
+-}
+diff --git a/package.json b/package.json
+index 44e2146..5c76ff9 100644
+--- a/package.json
++++ b/package.json
+@@ -11,12 +11,41 @@
+     "url": "git+https://github.com/nodejs/undici.git"
+   },
+   "license": "MIT",
+-  "author": "Matteo Collina <hello at matteocollina.com>",
+   "contributors": [
++    {
++      "name": "Daniele Belardi",
++      "url": "https://github.com/dnlup",
++      "author": true
++    },
++    {
++      "name": "Ethan Arrowood",
++      "url": "https://github.com/ethan-arrowood",
++      "author": true
++    },
++    {
++      "name": "Matteo Collina",
++      "url": "https://github.com/mcollina",
++      "author": true
++    },
++    {
++      "name": "Matthew Aitken",
++      "url": "https://github.com/KhafraDev",
++      "author": true
++    },
+     {
+       "name": "Robert Nagy",
+       "url": "https://github.com/ronag",
+       "author": true
++    },
++    {
++      "name": "Szymon Marczak",
++      "url": "https://github.com/szmarczak",
++      "author": true
++    },
++    {
++      "name": "Tomas Della Vedova",
++      "url": "https://github.com/delvedor",
++      "author": true
+     }
+   ],
+   "keywords": [
+@@ -64,6 +93,7 @@
+     "bench:run": "CONNECTIONS=1 node --experimental-wasm-simd benchmarks/benchmark.js; CONNECTIONS=50 node --experimental-wasm-simd benchmarks/benchmark.js",
+     "serve:website": "docsify serve .",
+     "prepare": "husky install",
++    "postpublish": "node scripts/update-undici-types-version.js && cd types && npm publish",
+     "fuzz": "jsfuzz test/fuzzing/fuzz.js corpus"
+   },
+   "devDependencies": {
+diff --git a/scripts/update-undici-types-version.js b/scripts/update-undici-types-version.js
+new file mode 100644
+index 0000000..2308e97
+--- /dev/null
++++ b/scripts/update-undici-types-version.js
+@@ -0,0 +1,18 @@
++const fs = require('node:fs')
++const path = require('node:path')
++const childProcess = require('node:child_process')
++
++const packageJSONPath = path.join(__dirname, '..', 'package.json')
++const packageJSONRaw = fs.readFileSync(packageJSONPath, 'utf-8')
++const packageJSON = JSON.parse(packageJSONRaw)
++const version = packageJSON.version
++
++const packageTypesJSONPath = path.join(__dirname, '..', 'types', 'package.json')
++const packageTypesJSONRaw = fs.readFileSync(packageTypesJSONPath, 'utf-8')
++const packageTypesJSON = JSON.parse(packageTypesJSONRaw)
++packageTypesJSON.version = version
++
++fs.writeFileSync(packageTypesJSONPath, JSON.stringify(packageTypesJSON, null, 2))
++
++childProcess.execSync('git add types/package.json', { cwd: path.join(__dirname, '..') })
++childProcess.execSync(`git commit -n -m 'undici-types@${version}'`, { cwd: path.join(__dirname, '..') })
+diff --git a/types/README.md b/types/README.md
+new file mode 100644
+index 0000000..20a721c
+--- /dev/null
++++ b/types/README.md
+@@ -0,0 +1,6 @@
++# undici-types
++
++This package is a dual-publish of the [undici](https://www.npmjs.com/package/undici) library types. The `undici` package **still contains types**. This package is for users who _only_ need undici types (such as for `@types/node`). It is published alongside every release of `undici`, so you can always use the same version.
++
++- [GitHub nodejs/undici](https://github.com/nodejs/undici)
++- [Undici Documentation](https://undici.nodejs.org/#/)
+diff --git a/types/index.d.ts b/types/index.d.ts
+new file mode 100644
+index 0000000..4afadd6
+--- /dev/null
++++ b/types/index.d.ts
+@@ -0,0 +1,54 @@
++import Dispatcher from'./dispatcher'
++import { setGlobalDispatcher, getGlobalDispatcher } from './global-dispatcher'
++import { setGlobalOrigin, getGlobalOrigin } from './global-origin'
++import Pool from'./pool'
++import { RedirectHandler, DecoratorHandler } from './handlers'
++
++import BalancedPool from './balanced-pool'
++import Client from'./client'
++import buildConnector from'./connector'
++import errors from'./errors'
++import Agent from'./agent'
++import MockClient from'./mock-client'
++import MockPool from'./mock-pool'
++import MockAgent from'./mock-agent'
++import mockErrors from'./mock-errors'
++import ProxyAgent from'./proxy-agent'
++import { request, pipeline, stream, connect, upgrade } from './api'
++
++export * from './cookies'
++export * from './fetch'
++export * from './file'
++export * from './filereader'
++export * from './formdata'
++export * from './diagnostics-channel'
++export * from './websocket'
++export { Interceptable } from './mock-interceptor'
++
++export { Dispatcher, BalancedPool, Pool, Client, buildConnector, errors, Agent, request, stream, pipeline, connect, upgrade, setGlobalDispatcher, getGlobalDispatcher, setGlobalOrigin, getGlobalOrigin, MockClient, MockPool, MockAgent, mockErrors, ProxyAgent, RedirectHandler, DecoratorHandler }
++export default Undici
++
++declare namespace Undici {
++  var Dispatcher: typeof import('./dispatcher').default
++  var Pool: typeof import('./pool').default;
++  var RedirectHandler: typeof import ('./handlers').RedirectHandler
++  var DecoratorHandler: typeof import ('./handlers').DecoratorHandler
++  var createRedirectInterceptor: typeof import ('./interceptors').createRedirectInterceptor
++  var BalancedPool: typeof import('./balanced-pool').default;
++  var Client: typeof import('./client').default;
++  var buildConnector: typeof import('./connector').default;
++  var errors: typeof import('./errors').default;
++  var Agent: typeof import('./agent').default;
++  var setGlobalDispatcher: typeof import('./global-dispatcher').setGlobalDispatcher;
++  var getGlobalDispatcher: typeof import('./global-dispatcher').getGlobalDispatcher;
++  var request: typeof import('./api').request;
++  var stream: typeof import('./api').stream;
++  var pipeline: typeof import('./api').pipeline;
++  var connect: typeof import('./api').connect;
++  var upgrade: typeof import('./api').upgrade;
++  var MockClient: typeof import('./mock-client').default;
++  var MockPool: typeof import('./mock-pool').default;
++  var MockAgent: typeof import('./mock-agent').default;
++  var mockErrors: typeof import('./mock-errors').default;
++  var fetch: typeof import('./fetch').fetch;
++}
+diff --git a/types/package.json b/types/package.json
+new file mode 100644
+index 0000000..f5690fc
+--- /dev/null
++++ b/types/package.json
+@@ -0,0 +1,55 @@
++{
++  "name": "undici-types",
++  "version": "5.24.0",
++  "description": "A stand-alone types package for Undici",
++  "homepage": "https://undici.nodejs.org",
++  "bugs": {
++    "url": "https://github.com/nodejs/undici/issues"
++  },
++  "repository": {
++    "type": "git",
++    "url": "git+https://github.com/nodejs/undici.git"
++  },
++  "license": "MIT",
++  "types": "index.d.ts",
++  "files": [
++    "*.d.ts"
++  ],
++  "contributors": [
++    {
++      "name": "Daniele Belardi",
++      "url": "https://github.com/dnlup",
++      "author": true
++    },
++    {
++      "name": "Ethan Arrowood",
++      "url": "https://github.com/ethan-arrowood",
++      "author": true
++    },
++    {
++      "name": "Matteo Collina",
++      "url": "https://github.com/mcollina",
++      "author": true
++    },
++    {
++      "name": "Matthew Aitken",
++      "url": "https://github.com/KhafraDev",
++      "author": true
++    },
++    {
++      "name": "Robert Nagy",
++      "url": "https://github.com/ronag",
++      "author": true
++    },
++    {
++      "name": "Szymon Marczak",
++      "url": "https://github.com/szmarczak",
++      "author": true
++    },
++    {
++      "name": "Tomas Della Vedova",
++      "url": "https://github.com/delvedor",
++      "author": true
++    }
++  ]
++}
diff -Nru node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/patches/build-Fix-incorrect-syntax-for-error-limit.patch node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/patches/build-Fix-incorrect-syntax-for-error-limit.patch
--- node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/patches/build-Fix-incorrect-syntax-for-error-limit.patch	1970-01-01 01:00:00.000000000 +0100
+++ node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/patches/build-Fix-incorrect-syntax-for-error-limit.patch	2024-04-13 11:18:29.000000000 +0200
@@ -0,0 +1,26 @@
+From: Ryan Gonzalez <ryan.gonzalez at collabora.com>
+Date: Mon, 12 Feb 2024 18:00:22 -0600
+Subject: build: Fix incorrect syntax for --error-limit
+
+lld 15+ removed support for single dashes:
+
+https://github.com/llvm/llvm-project/commit/87628f5804e23a40986692f6cdcf66654ce3f017
+
+Signed-off-by: Ryan Gonzalez <ryan.gonzalez at collabora.com>
+---
+ llhttp/bin/build_wasm.ts | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/llhttp/bin/build_wasm.ts b/llhttp/bin/build_wasm.ts
+index d0fb1ad..7286432 100644
+--- a/llhttp/bin/build_wasm.ts
++++ b/llhttp/bin/build_wasm.ts
+@@ -61,7 +61,7 @@ execSync(`${WASI_ROOT}/bin/clang \
+  -fvisibility=hidden \
+  -mexec-model=reactor \
+  -Wl,-lc \
+- -Wl,-error-limit=0 \
++ -Wl,--error-limit=0 \
+  -Wl,-O3 \
+  -Wl,--lto-O3 \
+  -Wl,--strip-all \
diff -Nru node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/patches/series node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/patches/series
--- node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/patches/series	2023-12-21 11:14:59.000000000 +0100
+++ node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/patches/series	2024-04-13 11:18:29.000000000 +0200
@@ -10,3 +10,5 @@
 update-httpbin.org-test-timeout.patch
 CVE-2023-45143.patch
 generate-undici-package-types.patch
+Add-publish-types-script-2273.patch
+build-Fix-incorrect-syntax-for-error-limit.patch
diff -Nru node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/rules node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/rules
--- node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/rules	2022-07-20 12:53:10.000000000 +0200
+++ node-undici-5.15.0+dfsg1+~cs20.10.9.3/debian/rules	2024-04-13 11:18:29.000000000 +0200
@@ -10,6 +10,11 @@
 %:
 	dh $@
 
+override_dh_auto_build:
+	# Override the global undici-types with our local copy.
+	cp -r types node_modules/undici-types
+	dh_auto_build --buildsystem=nodejs
+
 override_dh_auto_test:
 	# autopkgtest only
 


More information about the Pkg-javascript-devel mailing list