Skip to content

Commit c541153

Browse files
authored
tools: add version update to external dependencies
Refs: nodejs/security-wg#973 Most of the duplicated code in all the dependencies updaters has been moved in the `utils.sh` file PR-URL: #48081 Refs: nodejs/security-wg#973 Reviewed-By: Marco Ippolito <[email protected]>
1 parent 1b4ce69 commit c541153

27 files changed

+316
-420
lines changed

doc/contributing/maintaining/maintaining-dependencies.md

Lines changed: 79 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,30 @@ directories to create the Node.js binaries.
88
All dependencies are located within the `deps` directory.
99
This a list of all the dependencies:
1010

11-
* [acorn][]
12-
* [ada][]
13-
* [base64][]
14-
* [brotli][]
15-
* [c-ares][]
16-
* [cjs-module-lexer][]
11+
* [acorn 8.8.2][]
12+
* [ada 2.5.0][]
13+
* [base64 0.5.0][]
14+
* [brotli 1.0.9][]
15+
* [c-ares 1.19.0][]
16+
* [cjs-module-lexer 1.2.2][]
1717
* [corepack][]
1818
* [googletest][]
19-
* [histogram][]
20-
* [icu-small][]
21-
* [llhttp][]
22-
* [minimatch][]
23-
* [nghttp2][]
24-
* [ngtcp2][]
25-
* [npm][]
26-
* [openssl][]
27-
* [postject][]
28-
* [simdutf][]
29-
* [undici][]
30-
* [uv][]
31-
* [uvwasi][]
32-
* [V8][]
33-
* [zlib][]
19+
* [histogram 0.11.8][]
20+
* [icu-small 73.1][]
21+
* [libuv 1.44.2][]
22+
* [llhttp 8.1.0][]
23+
* [minimatch 9.0.0][]
24+
* [nghttp2 1.53.0][]
25+
* [nghttp3 0.7.0][]
26+
* [ngtcp2 0.8.1][]
27+
* [npm 9.6.7][]
28+
* [openssl 3.0.8][]
29+
* [postject 1.0.0-alpha.6][]
30+
* [simdutf 3.2.9][]
31+
* [undici 5.22.1][]
32+
* [uvwasi 0.0.16][]
33+
* [V8 11.3.244.8][]
34+
* [zlib 1.2.13][]
3435

3536
Any code which meets one or more of these conditions should
3637
be managed as a dependency:
@@ -136,48 +137,49 @@ Most dependencies are automatically updated by
136137
[dependency-update-action][] that runs weekly.
137138
However, it is possible to manually update a dependency by running
138139
the corresponding script in `tools/update-deps`.
139-
[OpenSSL][] has its own update action: [update-openssl-action][].
140+
[OpenSSL](https://github.com/openssl/openssl) has its own update action:
141+
[update-openssl-action][].
140142
[npm-cli-bot](https://github.com/npm/cli/blob/latest/.github/workflows/create-node-pr.yml)
141-
takes care of [npm][] update, it is maintained by the npm team.
143+
takes care of npm update, it is maintained by the npm team.
142144

143145
## Dependency list
144146

145-
### acorn
147+
### acorn 8.8.2
146148

147149
The [acorn](https://github.com/acornjs/acorn) dependency is a JavaScript parser.
148150
[acorn-walk](https://github.com/acornjs/acorn/tree/master/acorn-walk) is
149151
an abstract syntax tree walker for the ESTree format.
150152

151-
### ada
153+
### ada 2.5.0
152154

153155
The [ada](https://github.com/ada-url/ada) dependency is a
154156
fast and spec-compliant URL parser written in C++.
155157

156-
### base64
158+
### base64 0.5.0
157159

158160
The [base64](https://github.com/aklomp/base64) dependency is a base64
159161
stream encoding/decoding library in C99 with SIMD and OpenMP acceleration.
160162
It also contains wrapper functions to encode/decode simple
161163
length-delimited strings.
162164

163-
### brotli
165+
### brotli 1.0.9
164166

165167
The [brotli](https://github.com/google/brotli) dependency is
166168
used for the homonym generic-purpose lossless compression algorithm.
167169

168-
### c-ares
170+
### c-ares 1.19.0
169171

170172
The [c-ares](https://github.com/c-ares/c-ares) is a C library
171173
for asynchronous DNS requests.
172174

173-
### cjs-module-lexer
175+
### cjs-module-lexer 1.2.2
174176

175177
The [cjs-module-lexer](https://github.com/nodejs/node/tree/HEAD/deps/cjs-module-lexer)
176178
dependency is used within the Node.js ESM implementation to detect the
177179
named exports of a CommonJS module.
178180
See [maintaining-cjs-module-lexer][] for more information.
179181

180-
## corepack
182+
### corepack
181183

182184
The [corepack](https://github.com/nodejs/corepack) dependency is a
183185
zero-runtime-dependency Node.js script that acts as a bridge between
@@ -192,36 +194,47 @@ by Node.js by default.
192194
The [googletest](https://github.com/google/googletest) dependency is Google’s
193195
C++ testing and mocking framework.
194196

195-
### histogram
197+
### histogram 0.11.8
196198

197199
The [histogram](https://github.com/HdrHistogram/HdrHistogram_c) dependency is
198200
a C port of High Dynamic Range (HDR) Histogram.
199201

200-
### icu-small
202+
### icu-small 73.1
201203

202204
The [icu](http://site.icu-project.org) is widely used set of C/C++
203205
and Java libraries providing Unicode and Globalization
204206
support for software applications.
205207
See [maintaining-icu][] for more informations.
206208

207-
### llhttp
209+
### libuv 1.44.2
210+
211+
The [libuv](https://github.com/libuv/libuv) dependency is a
212+
multi-platform support library with a focus on asynchronous I/O.
213+
It was primarily developed for use by Node.js.
214+
215+
### llhttp 8.1.0
208216

209217
The [llhttp](https://github.com/nodejs/llhttp) dependency is
210218
the http parser used by Node.js.
211219
See [maintaining-http][] for more informations.
212220

213-
### minimatch
221+
### minimatch 9.0.0
214222

215223
The [minimatch](https://github.com/isaacs/minimatch) dependency is a
216224
minimal matching utility.
217225

218-
### nghttp2
226+
### nghttp2 1.53.0
219227

220228
The [nghttp2](https://github.com/nghttp2/nghttp2) dependency is a C library
221229
implementing HTTP/2 protocol.
222230
See [maintaining-http][] for more informations.
223231

224-
### ngtcp2
232+
### nghttp3 0.7.0
233+
234+
The [nghttp3](https://github.com/ngtcp2/nghttp3) dependency is HTTP/3 library
235+
written in C. See ngtcp2 for more informations.
236+
237+
### ngtcp2 0.8.1
225238

226239
The ngtcp2 and nghttp3 dependencies provide the core functionality for
227240
QUIC and HTTP/3.
@@ -241,7 +254,7 @@ The `nghttp3` library depends on `ngtcp2`. Both should always be updated
241254
together. From `ngtcp2` we only want the contents of the `lib` and `crypto`
242255
directories; from `nghttp3` we only want the contents of the `lib` directory.
243256

244-
### npm
257+
### npm 9.6.7
245258

246259
The [npm](https://github.com/npm/cli) dependency is
247260
the package manager for JavaScript.
@@ -256,7 +269,7 @@ are at the discretion of the release and LTS teams.
256269
This process only covers full updates to new versions of npm. Cherry-picked
257270
changes can be reviewed and landed via the normal consensus seeking process.
258271

259-
### openssl
272+
### openssl 3.0.8
260273

261274
The [openssl](https://github.com/quictls/openssl) dependency is a
262275
fork of OpenSSL to enable QUIC.
@@ -268,77 +281,72 @@ the main openssl/openssl releases with the addition of APIs to support
268281
the QUIC protocol.
269282
See [maintaining-openssl][] for more informations.
270283

271-
### postject
284+
### postject 1.0.0-alpha.6
272285

273286
The [postject](https://github.com/nodejs/postject) dependency is used for the
274287
[Single Executable strategic initiative](https://github.com/nodejs/single-executable).
275288

276-
### simdutf
289+
### simdutf 3.2.9
277290

278291
The [simdutf](https://github.com/simdutf/simdutf) dependency is
279292
a C++ library for fast UTF-8 decoding and encoding.
280293

281-
### undici
294+
### undici 5.22.1
282295

283296
The [undici](https://github.com/nodejs/undici) dependency is an HTTP/1.1 client,
284297
written from scratch for Node.js..
285298
See [maintaining-http][] for more informations.
286299

287-
### uv
288-
289-
The [libuv](https://github.com/libuv/libuv) dependency is a
290-
multi-platform support library with a focus on asynchronous I/O.
291-
It was primarily developed for use by Node.js.
292-
293-
### uvwasi
300+
### uvwasi 0.0.16
294301

295302
The [uvwasi](https://github.com/nodejs/uvwasi) dependency implements
296303
the WASI system call API, so that WebAssembly runtimes can easily
297304
implement WASI calls.
298305
Under the hood, uvwasi leverages libuv where possible for maximum portability.
299306
See [maintaining-web-assembly][] for more informations.
300307

301-
### V8
308+
### V8 11.3.244.8
302309

303310
[V8](https://chromium.googlesource.com/v8/v8.git/) is Google's open source
304311
high-performance JavaScript and WebAssembly engine, written in C++.
305312
See [maintaining-V8][] for more informations.
306313

307-
### zlib
314+
### zlib 1.2.13
308315

309316
The [zlib](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/zlib)
310317
dependency lossless data-compression library,
311318
it comes from the Chromium team's zlib fork which incorporated
312319
performance improvements not currently available in standard zlib.
313320

314-
[acorn]: #acorn
315-
[ada]: #ada
316-
[base64]: #base64
317-
[brotli]: #brotli
318-
[c-ares]: #c-ares
319-
[cjs-module-lexer]: #cjs-module-lexer
321+
[acorn 8.8.2]: #acorn-882
322+
[ada 2.5.0]: #ada-250
323+
[base64 0.5.0]: #base64-050
324+
[brotli 1.0.9]: #brotli-109
325+
[c-ares 1.19.0]: #c-ares-1190
326+
[cjs-module-lexer 1.2.2]: #cjs-module-lexer-122
320327
[corepack]: #corepack
321328
[dependency-update-action]: ../../../.github/workflows/tools.yml
322329
[googletest]: #googletest
323-
[histogram]: #histogram
324-
[icu-small]: #icu-small
325-
[llhttp]: #llhttp
330+
[histogram 0.11.8]: #histogram-0118
331+
[icu-small 73.1]: #icu-small-731
332+
[libuv 1.44.2]: #libuv-1442
333+
[llhttp 8.1.0]: #llhttp-810
326334
[maintaining-V8]: ./maintaining-V8.md
327335
[maintaining-cjs-module-lexer]: ./maintaining-cjs-module-lexer.md
328336
[maintaining-http]: ./maintaining-http.md
329337
[maintaining-icu]: ./maintaining-icu.md
330338
[maintaining-openssl]: ./maintaining-openssl.md
331339
[maintaining-web-assembly]: ./maintaining-web-assembly.md
332-
[minimatch]: #minimatch
333-
[nghttp2]: #nghttp2
334-
[ngtcp2]: #ngtcp2
335-
[npm]: #npm
336-
[openssl]: #openssl
337-
[postject]: #postject
338-
[simdutf]: #simdutf
339-
[undici]: #undici
340+
[minimatch 9.0.0]: #minimatch-900
341+
[nghttp2 1.53.0]: #nghttp2-1530
342+
[nghttp3 0.7.0]: #nghttp3-070
343+
[ngtcp2 0.8.1]: #ngtcp2-081
344+
[npm 9.6.7]: #npm-967
345+
[openssl 3.0.8]: #openssl-308
346+
[postject 1.0.0-alpha.6]: #postject-100-alpha6
347+
[simdutf 3.2.9]: #simdutf-329
348+
[undici 5.22.1]: #undici-5221
340349
[update-openssl-action]: ../../../.github/workflows/update-openssl.yml
341-
[uv]: #uv
342-
[uvwasi]: #uvwasi
343-
[v8]: #v8
344-
[zlib]: #zlib
350+
[uvwasi 0.0.16]: #uvwasi-0016
351+
[v8 11.3.244.8]: #v8-1132448
352+
[zlib 1.2.13]: #zlib-1213

tools/dep_updaters/update-acorn-walk.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,14 @@ ROOT=$(cd "$(dirname "$0")/../.." && pwd)
1212
[ -x "$NODE" ] || NODE=$(command -v node)
1313
NPM="$ROOT/deps/npm/bin/npm-cli.js"
1414

15+
# shellcheck disable=SC1091
16+
. "$ROOT/tools/dep_updaters/utils.sh"
17+
1518
NEW_VERSION=$("$NODE" "$NPM" view acorn-walk dist-tags.latest)
1619
CURRENT_VERSION=$("$NODE" -p "require('./deps/acorn/acorn-walk/package.json').version")
1720

18-
echo "Comparing $NEW_VERSION with $CURRENT_VERSION"
19-
20-
if [ "$NEW_VERSION" = "$CURRENT_VERSION" ]; then
21-
echo "Skipped because Acorn-walk is on the latest version."
22-
exit 0
23-
fi
21+
# This function exit with 0 if new version and current version are the same
22+
compare_dependency_version "acorn-walk" "$NEW_VERSION" "$CURRENT_VERSION"
2423

2524
cd "$( dirname "$0" )/../.." || exit
2625

tools/dep_updaters/update-acorn.sh

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,14 @@ ROOT=$(cd "$(dirname "$0")/../.." && pwd)
1212
[ -x "$NODE" ] || NODE=$(command -v node)
1313
NPM="$ROOT/deps/npm/bin/npm-cli.js"
1414

15+
# shellcheck disable=SC1091
16+
. "$ROOT/tools/dep_updaters/utils.sh"
17+
1518
NEW_VERSION=$("$NODE" "$NPM" view acorn dist-tags.latest)
1619
CURRENT_VERSION=$("$NODE" -p "require('./deps/acorn/acorn/package.json').version")
1720

18-
echo "Comparing $NEW_VERSION with $CURRENT_VERSION"
19-
20-
if [ "$NEW_VERSION" = "$CURRENT_VERSION" ]; then
21-
echo "Skipped because Acorn is on the latest version."
22-
exit 0
23-
fi
21+
# This function exit with 0 if new version and current version are the same
22+
compare_dependency_version "acorn" "$NEW_VERSION" "$CURRENT_VERSION"
2423

2524
cd "$( dirname "$0" )/../.." || exit
2625

@@ -50,14 +49,7 @@ mv acorn-tmp/node_modules/acorn deps/acorn
5049

5150
rm -rf acorn-tmp/
5251

53-
echo "All done!"
54-
echo ""
55-
echo "Please git add acorn, commit the new version:"
56-
echo ""
57-
echo "$ git add -A deps/acorn src/acorn_version.h"
58-
echo "$ git commit -m \"deps: update acorn to $NEW_VERSION\""
59-
echo ""
60-
61-
# The last line of the script should always print the new version,
62-
# as we need to add it to $GITHUB_ENV variable.
63-
echo "NEW_VERSION=$NEW_VERSION"
52+
# Update the version number on maintaining-dependencies.md
53+
# and print the new version as the last line of the script as we need
54+
# to add it to $GITHUB_ENV variable
55+
finalize_version_update "acorn" "$NEW_VERSION" "src/acorn_version.h"

tools/dep_updaters/update-ada.sh

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,8 @@ EOF
2525

2626
CURRENT_VERSION=$(grep "#define ADA_VERSION" "$DEPS_DIR/ada/ada.h" | sed -n "s/^.*VERSION \"\(.*\)\"/\1/p")
2727

28-
echo "Comparing $NEW_VERSION with $CURRENT_VERSION"
29-
30-
if [ "$NEW_VERSION" = "$CURRENT_VERSION" ]; then
31-
echo "Skipped because ada is on the latest version."
32-
exit 0
33-
fi
28+
# This function exit with 0 if new version and current version are the same
29+
compare_dependency_version "ada" "$NEW_VERSION" "$CURRENT_VERSION"
3430

3531
echo "Making temporary workspace..."
3632

@@ -63,14 +59,7 @@ mv "$DEPS_DIR/ada/"*.gyp "$DEPS_DIR/ada/README.md" "$WORKSPACE/"
6359
rm -rf "$DEPS_DIR/ada"
6460
mv "$WORKSPACE" "$DEPS_DIR/ada"
6561

66-
echo "All done!"
67-
echo ""
68-
echo "Please git add ada, commit the new version:"
69-
echo ""
70-
echo "$ git add -A deps/ada"
71-
echo "$ git commit -m \"deps: update ada to $NEW_VERSION\""
72-
echo ""
73-
74-
# The last line of the script should always print the new version,
75-
# as we need to add it to $GITHUB_ENV variable.
76-
echo "NEW_VERSION=$NEW_VERSION"
62+
# Update the version number on maintaining-dependencies.md
63+
# and print the new version as the last line of the script as we need
64+
# to add it to $GITHUB_ENV variable
65+
finalize_version_update "ada" "$NEW_VERSION"

0 commit comments

Comments
 (0)