Closed yesudeep closed 3 years ago
uv_poll_init_socket is definitely not removed and even if it was, it wouldn't give you a linker error it would give you a compiler error. You just need to figure out how to twist all those fancy Bazel knobs of yours.
I'm not sure which Bazel knobs I'd have to turn on to get the compiler to warn me, but I'll certainly look into it.
libuv
and the function has clearly been removed. This is the only reference to the function on that branch:libuv on master took 3m4s
❯ git grep 'uv_poll_init_socket'
docs/code/uvwget/main.c: int r = uv_poll_init_socket(loop, &context->poll_handle, sockfd);
I'll see whether I can switch to an older branch to accommodate building uSockets, but it's likely this change will affect uSockets in the future.
uv_poll_init_socket
is created by the compiler, which should have been a warning on MSVC. However, clang warns me:❯ bazel run //third_party/cc/test:usockets_example
...
INFO: Analyzed target //third_party/cc/test:usockets_example (32 packages loaded, 768 targets configured).
INFO: Found 1 target...
INFO: From Compiling src/eventing/libuv.c:
external/usockets/src/eventing/libuv.c:88:5: warning: implicit declaration of function 'uv_poll_init_socket' is invalid in C99 [-Wimplicit-function-declaration]
uv_poll_init_socket(loop->uv_loop, p->uv_p, p->fd);
^
1 warning generated.
INFO: From Compiling src/unix/udp.c:
external/libuv/src/unix/udp.c:951:3: warning: ISO C90 forbids mixing declarations and code [-Wdeclaration-after-statement]
STATIC_ASSERT(sizeof(mreq.gsr_group) >= sizeof(*multicast_addr));
^
external/libuv/src/uv-common.h:52:8: note: expanded from macro 'STATIC_ASSERT'
void uv__static_assert(int static_assert_failed[1 - 2 * !(expr)])
^
1 warning generated.
ERROR: /usr/home/yesudeep/code/foo/third_party/cc/test/BUILD.bazel:460:10: Linking third_party/cc/test/usockets_example failed: (Exit 1): clang failed: error executing command
...
/usr/bin/clang -o bazel-out/freebsd-fastbuild/bin/third_party/cc/test/usockets_example bazel-out/freebsd-fastbuild/bin/third_party/cc/test/_objs/usockets_example/usockets_example.pic.o bazel-out/freebsd-fastbuild/bin/external/fmt/libfmt.a bazel-out/freebsd-fastbuild/bin/external/usockets/libusockets.a bazel-out/freebsd-fastbuild/bin/external/boringssl/libssl.a bazel-out/freebsd-fastbuild/bin/external/boringssl/libcrypto.a bazel-out/freebsd-fastbuild/bin/external/libuv/liblibuv.a bazel-out/freebsd-fastbuild/bin/external/com_microsoft_mimalloc/libmimalloc.a -pthread -lpthread -lpthread -ldl -lm -pthread -lm -Wl,-S -lstdc++ -Wl,-z,relro,-z,now -no-canonical-prefixes)
Execution platform: @local_config_platform//:host
ld: error: undefined symbol: uv_poll_init_socket
>>> referenced by libuv.c
>>> libuv.pic.o:(us_poll_start) in archive bazel-out/freebsd-fastbuild/bin/external/usockets/libusockets.a
clang: error: linker command failed with exit code 1 (use -v to see invocation)
HTH.
Show me the exact commit it was removed.
What version does Node.js use?
Okay for some reason Node.js 16 is still on libuv 1.x and this changed back in 2017 for 2.0. Okay we are not compatible with libuv 2.
Error when building a usockets test example with
LIBUS_USE_LIBUV=1
defined.OS and compiler:
Compiler: MSVC/14.29.30133 OS: Windows 11 (x86_64)
Probable cause:
The
uv_poll_init_socket
API function has been removed fromlibuv
.See: https://github.com/libuv/libuv/pull/1166