Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 948393 - net-libs/nodejs-22.12.0-r1: Too low dev-libs/libuv dependency
Summary: net-libs/nodejs-22.12.0-r1: Too low dev-libs/libuv dependency
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: William Hubbs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-19 10:26 UTC by Mart Raudsepp
Modified: 2025-02-01 10:19 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mart Raudsepp gentoo-dev 2025-01-19 10:26:54 UTC
nodejs-22.12.0-r1 failed to compile for me due to missing UV_UDP_REUSEPORT symbol, which was added in libuv. I'm not sure when exactly, but I'm guessing it might be this ChangeLog entry from libuv-1.49.0:

* unix: support SO_REUSEPORT with load balancing for UDP (Andy Pan)

I had 1.48.0 for the failure, and nodejs compiles fine after upgrading to libuv-1.49.2 first. Please adjust minimum dependencies accordingly, and maybe have upstream update their libuv dep accordingly as well.

At least libuv-1.49.2 does provide the symbol while 1.48.0 didn't within enum uv_udp_flags:

  /*
   * Indicates if SO_REUSEPORT will be set when binding the handle.
   * This sets the SO_REUSEPORT socket option on supported platforms.
   * Unlike UV_UDP_REUSEADDR, this flag will make multiple threads or
   * processes that are binding to the same address and port "share"
   * the port, which means incoming datagrams are distributed across
   * the receiving sockets among threads or processes.
   *
   * This flag is available only on Linux 3.9+, DragonFlyBSD 3.6+,
   * FreeBSD 12.0+, Solaris 11.4, and AIX 7.2.5+ for now.
   */
  UV_UDP_REUSEPORT = 64,


build failure snippet follows, as this is an obvious missing symbol case with older libuv, should be no need for full build.log nor emerge --info:

FAILED: obj/src/libnode.udp_wrap.o 
clang++ -MMD -MF obj/src/libnode.udp_wrap.o.d -D_GLIBCXX_USE_CXX11_ABI=1 -DNODE_OPENSSL_CONF_NAME=nodejs_conf -DNODE_OPENSSL_CERT_STORE -DICU_NO_USER_DATA_OVERRIDE -D__STDC_FORMAT_MACROS '-DNODE_ARCH="arm64"' '-DNODE_PLATFORM="linux"' -DNODE_WANT_INTERNALS=1 -DV8_DEPRECATION_WARNINGS=1 '-DNODE_OPENSSL_SYSTEM_CERT_PATH=""' -DSQLITE_ENABLE_SESSION -DNODE_USE_NODE_CODE_CACHE=1 -DHAVE_INSPECTOR=1 -D__POSIX__ -DNODE_USE_V8_PLATFORM=1 -DNODE_V8_SHARED_RO_HEAP -DNODE_HAVE_I18N_SUPPORT=1 -DHAVE_OPENSSL=1 -DHAVE_AMARO=1 -I../../src -I../../deps/postject -Igen -Igen/include -Igen/src -I../../deps/googletest/include -I../../deps/histogram/src -I../../deps/histogram/include -I../../deps/simdjson -I../../deps/simdutf -I../../deps/ada -I../../deps/nbytes/include -I../../deps/ncrypto -I../../deps/v8/include -I../../deps/llhttp/include -I../../deps/uvwasi/include -Wall -Wextra -Wno-unused-parameter -pthread -Wall -Wextra -Wno-unused-parameter -Werror=unused-result -Werror=undefined-inline -Werror=extra-semi -mbranch-protection=standard -fno-omit-frame-pointer -mcpu=apple-m2 -O3 -pipe -mbranch-protection=standard -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-default-version=4 -gdwarf-4 -Werror=odr -Werror=strict-aliasing -frecord-gcc-switches -mbranch-protection=none -fno-rtti -fno-exceptions -fno-strict-aliasing -std=gnu++20  -c ../../src/udp_wrap.cc -o obj/src/libnode.udp_wrap.o
../../src/udp_wrap.cc:234:35: error: use of undeclared identifier 'UV_UDP_REUSEPORT'; did you mean 'UV_UDP_REUSEADDR'?
  234 |   NODE_DEFINE_CONSTANT(constants, UV_UDP_REUSEPORT);
      |                                   ^~~~~~~~~~~~~~~~
      |                                   UV_UDP_REUSEADDR
../../src/node.h:1033:54: note: expanded from macro 'NODE_DEFINE_CONSTANT'
 1033 |         v8::Number::New(isolate, static_cast<double>(constant));               \
      |                                                      ^
/usr/include/uv.h:654:3: note: 'UV_UDP_REUSEADDR' declared here
  654 |   UV_UDP_REUSEADDR = 4,
      |   ^
1 error generated.
Comment 1 Jesús P Rey (Chuso) 2025-02-01 10:19:46 UTC
I had the same issue (although with the UV_TCP_REUSEADDR symbol instead).

Upgrading from dev-libs/libuv-1.48.0 to dev-libs/libuv-1.49.2 also fixed it for me.