Skip to content

Commit

Permalink
src: added version information for undici in the process.versions
Browse files Browse the repository at this point in the history
Attempted to update undici version when the update scripts are run
Fixes: nodejs#45260
Refs: nodejs#45599
  • Loading branch information
debadree25 committed Nov 25, 2022
1 parent fec0fbc commit d96aa4d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/node_metadata.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
#include <unicode/uversion.h>
#endif // NODE_HAVE_I18N_SUPPORT

// version definitions of pure js deps
#define UNDICI_VERSION "5.12.0"

namespace node {

namespace per_process {
Expand Down Expand Up @@ -89,6 +92,7 @@ Metadata::Versions::Versions() {
std::to_string((BrotliEncoderVersion() & 0xFFF000) >> 12) +
"." +
std::to_string(BrotliEncoderVersion() & 0xFFF);
undici = UNDICI_VERSION;

#if HAVE_OPENSSL
openssl = GetOpenSSLVersion();
Expand Down
1 change: 1 addition & 0 deletions src/node_metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ namespace node {
V(nghttp2) \
V(napi) \
V(llhttp) \
V(undici) \

#if HAVE_OPENSSL
#define NODE_VERSIONS_KEY_CRYPTO(V) V(openssl)
Expand Down
7 changes: 7 additions & 0 deletions tools/update-undici.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ rm -f deps/undici/undici.js
"$NODE" "$NPM" install --global-style --no-bin-links --ignore-scripts undici
cd node_modules/undici
"$NODE" "$NPM" run build:node
# get the new version of undici
UNDICI_VERSION=$("$NODE" -p "require('./package.json').version")
# update this version information in src/node_metadata.cc
sed -i '' "s/UNDICI_VERSION \"[0-9.]*\"/UNDICI_VERSION \"$UNDICI_VERSION\"/" "$ROOT/src/node_metadata.cc"
# commit these changes
git add "$ROOT/src/node_metadata.cc"
git commit -m "src: update undici version to $UNDICI_VERSION"
)

mv undici-tmp/node_modules/undici deps/undici/src
Expand Down

0 comments on commit d96aa4d

Please sign in to comment.