zeromq / zeromq.js

:zap: Node.js bindings to the ØMQ library
http://zeromq.github.io/zeromq.js/
MIT License
1.42k stars 203 forks source link

Unable to build zeromq.beta 19 in docker #608

Closed Sceat closed 1 week ago

Sceat commented 2 months ago

Describe the bug Installation fails in docker

Error log 11.63 npm notice 11.63 npm notice New patch version of npm available! 10.5.0 -> 10.5.1 11.63 npm notice Changelog: 11.63 npm notice Run `npm install -g npm@10.5.1` to update! 11.63 npm notice 11.63 npm ERR! code 1 11.63 npm ERR! path /app/node_modules/zeromq 11.63 npm ERR! command failed 11.63 npm ERR! command sh -c (shx test -f ./script/build.js || run-s build.js) && cross-env npm_config_build_from_source=true aminya-node-gyp-build 11.64 npm ERR! make: Entering directory '/app/node_modules/zeromq/build' 11.64 npm ERR! TOUCH 7722eaf02fcc073df28ffd1fa831e71544edfd42.intermediate 11.64 npm ERR! ACTION binding_gyp_libzmq_target_build_libzmq 7722eaf02fcc073df28ffd1fa831e71544edfd42.intermediate 11.64 npm ERR! Downloading libzmq source from https://github.com/zeromq/libzmq/archive/20de92ac0a2b2b9a1869782a429df68f93c3625e.tar.gz 11.64 npm ERR! Building libzmq Release 11.64 npm ERR! cmake -S "libzmq-20de92ac0a2b2b9a1869782a429df68f93c3625e" -B ./build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="/app/node_modules/zeromq/build/libzmq" -DCMAKE_INSTALL_LIBDIR=lib -DBUILD_STATIC=ON -DBUILD_TESTS=OFF -DBUILD_SHARED=OFF -DWITH_DOCS=OFF -DWITH_LIBSODIUM=OFF 11.64 npm ERR! -- The C compiler identification is GNU 13.2.1 11.64 npm ERR! -- The CXX compiler identification is GNU 13.2.1 11.64 npm ERR! -- Detecting C compiler ABI info 11.64 npm ERR! -- Detecting C compiler ABI info - done 11.64 npm ERR! -- Check for working C compiler: /usr/bin/cc - skipped 11.64 npm ERR! -- Detecting C compile features 11.64 npm ERR! -- Detecting C compile features - done 11.64 npm ERR! -- Detecting CXX compiler ABI info 11.64 npm ERR! -- Detecting CXX compiler ABI info - done 11.64 npm ERR! -- Check for working CXX compiler: /usr/bin/c++ - skipped 11.64 npm ERR! -- Detecting CXX compile features 11.64 npm ERR! -- Detecting CXX compile features - done 11.64 npm ERR! -- Performing Test CMAKE_HAVE_LIBC_PTHREAD 11.64 npm ERR! -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success 11.64 npm ERR! -- Found Threads: TRUE 11.64 npm ERR! -- Detected ZMQ Version - 4.3.5 11.64 npm ERR! -- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) 11.64 npm ERR! -- Performing Test COMPILER_SUPPORTS_CXX11 11.64 npm ERR! -- Performing Test COMPILER_SUPPORTS_CXX11 - Success 11.64 npm ERR! -- Performing Test COMPILER_SUPPORTS_C11 11.64 npm ERR! -- Performing Test COMPILER_SUPPORTS_C11 - Success 11.64 npm ERR! -- Performing Test CXX_HAS_TAUT_WARNING 11.64 npm ERR! -- Performing Test CXX_HAS_TAUT_WARNING - Success 11.64 npm ERR! -- Performing Test CC_HAS_TAUT_WARNING 11.64 npm ERR! -- Performing Test CC_HAS_TAUT_WARNING - Success 11.64 npm ERR! -- Not building draft classes and methods 11.64 npm ERR! -- Using builtin sha1 11.64 npm ERR! -- Looking for strlcpy 11.64 npm ERR! -- Looking for strlcpy - found 11.64 npm ERR! -- Using tweetnacl for CURVE security 11.64 npm ERR! -- Looking for kqueue 11.64 npm ERR! -- Looking for kqueue - not found 11.64 npm ERR! -- Looking for epoll_create 11.64 npm ERR! -- Looking for epoll_create - found 11.64 npm ERR! -- Looking for epoll_create1 11.64 npm ERR! -- Looking for epoll_create1 - found 11.64 npm ERR! -- Using polling method in I/O threads: epoll 11.64 npm ERR! -- Using polling method in zmq_poll(er)_* API: poll 11.64 npm ERR! -- Looking for pselect 11.64 npm ERR! -- Looking for pselect - found 11.64 npm ERR! -- Using 64 bytes alignment for lock-free data structures 11.64 npm ERR! -- Looking for posix_memalign 11.64 npm ERR! -- Looking for posix_memalign - found 11.64 npm ERR! -- Looking for include file windows.h 11.64 npm ERR! -- Looking for include file windows.h - not found 11.64 npm ERR! -- Looking for include file condition_variable 11.64 npm ERR! -- Looking for include file condition_variable - found 11.64 npm ERR! -- Using condition_variable_t implementation: stl11 11.64 npm ERR! -- Looking for include file ifaddrs.h 11.64 npm ERR! -- Looking for include file ifaddrs.h - found 11.64 npm ERR! -- Looking for include file sys/uio.h 11.64 npm ERR! -- Looking for include file sys/uio.h - found 11.64 npm ERR! -- Looking for include file sys/eventfd.h 11.64 npm ERR! -- Looking for include file sys/eventfd.h - found 11.64 npm ERR! -- Checking whether EFD_CLOEXEC is supported 11.64 npm ERR! -- Performing Test ZMQ_HAVE_EVENTFD_CLOEXEC 11.64 npm ERR! -- Performing Test ZMQ_HAVE_EVENTFD_CLOEXEC - Success 11.64 npm ERR! -- Looking for if_nametoindex 11.64 npm ERR! -- Looking for if_nametoindex - found 11.64 npm ERR! -- Looking for SO_PEERCRED 11.64 npm ERR! -- Looking for SO_PEERCRED - found 11.64 npm ERR! -- Looking for LOCAL_PEERCRED 11.64 npm ERR! -- Looking for LOCAL_PEERCRED - not found 11.64 npm ERR! -- Looking for SO_BUSY_POLL 11.64 npm ERR! -- Looking for SO_BUSY_POLL - found 11.64 npm ERR! -- Looking for clock_gettime 11.64 npm ERR! -- Looking for clock_gettime - found 11.64 npm ERR! -- Looking for fork 11.64 npm ERR! -- Looking for fork - found 11.64 npm ERR! -- Looking for gethrtime 11.64 npm ERR! -- Looking for gethrtime - not found 11.64 npm ERR! -- Looking for mkdtemp 11.64 npm ERR! -- Looking for mkdtemp - found 11.64 npm ERR! -- Looking for accept4 11.64 npm ERR! -- Looking for accept4 - found 11.64 npm ERR! -- Looking for strnlen 11.64 npm ERR! -- Looking for strnlen - found 11.64 npm ERR! -- Performing Test HAVE_FLAG_-Wall 11.64 npm ERR! -- Performing Test HAVE_FLAG_-Wall - Failed 11.64 npm ERR! -- Performing Test HAVE_FLAG_-Wextra 11.64 npm ERR! -- Performing Test HAVE_FLAG_-Wextra - Failed 11.64 npm ERR! -- Performing Test HAVE_FLAG_-Wno-long-long 11.64 npm ERR! -- Performing Test HAVE_FLAG_-Wno-long-long - Failed 11.64 npm ERR! -- Performing Test HAVE_FLAG_-Wno-uninitialized 11.64 npm ERR! -- Performing Test HAVE_FLAG_-Wno-uninitialized - Failed 11.64 npm ERR! -- Performing Test HAVE_FLAG_-pedantic 11.64 npm ERR! -- Performing Test HAVE_FLAG_-pedantic - Failed 11.64 npm ERR! -- Checking whether noexcept is supported 11.64 npm ERR! -- Performing Test ZMQ_HAVE_NOEXCEPT 11.64 npm ERR! -- Performing Test ZMQ_HAVE_NOEXCEPT - Success 11.64 npm ERR! -- Checking whether SOCK_CLOEXEC is supported 11.64 npm ERR! -- Performing Test ZMQ_HAVE_SOCK_CLOEXEC 11.64 npm ERR! -- Performing Test ZMQ_HAVE_SOCK_CLOEXEC - Success 11.64 npm ERR! -- Checking whether O_CLOEXEC is supported 11.64 npm ERR! -- Performing Test ZMQ_HAVE_O_CLOEXEC 11.64 npm ERR! -- Performing Test ZMQ_HAVE_O_CLOEXEC - Success 11.64 npm ERR! -- Checking whether SO_BINDTODEVICE is supported 11.64 npm ERR! -- Performing Test ZMQ_HAVE_SO_BINDTODEVICE 11.64 npm ERR! -- Performing Test ZMQ_HAVE_SO_BINDTODEVICE - Success 11.64 npm ERR! -- Checking whether SO_KEEPALIVE is supported 11.64 npm ERR! -- Performing Test ZMQ_HAVE_SO_KEEPALIVE 11.64 npm ERR! -- Performing Test ZMQ_HAVE_SO_KEEPALIVE - Success 11.64 npm ERR! -- Checking whether SO_PRIORITY is supported 11.64 npm ERR! -- Performing Test ZMQ_HAVE_SO_PRIORITY 11.64 npm ERR! -- Performing Test ZMQ_HAVE_SO_PRIORITY - Success 11.64 npm ERR! -- Checking whether TCP_KEEPCNT is supported 11.64 npm ERR! -- Performing Test ZMQ_HAVE_TCP_KEEPCNT 11.64 npm ERR! -- Performing Test ZMQ_HAVE_TCP_KEEPCNT - Success 11.64 npm ERR! -- Checking whether TCP_KEEPIDLE is supported 11.64 npm ERR! -- Performing Test ZMQ_HAVE_TCP_KEEPIDLE 11.64 npm ERR! -- Performing Test ZMQ_HAVE_TCP_KEEPIDLE - Success 11.64 npm ERR! -- Checking whether TCP_KEEPINTVL is supported 11.64 npm ERR! -- Performing Test ZMQ_HAVE_TCP_KEEPINTVL 11.64 npm ERR! -- Performing Test ZMQ_HAVE_TCP_KEEPINTVL - Success 11.64 npm ERR! -- Checking whether TCP_KEEPALIVE is supported 11.64 npm ERR! -- Performing Test ZMQ_HAVE_TCP_KEEPALIVE 11.64 npm ERR! -- Performing Test ZMQ_HAVE_TCP_KEEPALIVE - Failed 11.64 npm ERR! -- Checking whether TIPC is supported 11.64 npm ERR! -- Performing Test ZMQ_HAVE_TIPC 11.64 npm ERR! -- Performing Test ZMQ_HAVE_TIPC - Failed 11.64 npm ERR! -- Checking pthread_setname signature 11.64 npm ERR! -- Performing Test ZMQ_HAVE_PTHREAD_SETNAME_1 11.64 npm ERR! -- Performing Test ZMQ_HAVE_PTHREAD_SETNAME_1 - Failed 11.64 npm ERR! -- Performing Test ZMQ_HAVE_PTHREAD_SETNAME_2 11.64 npm ERR! -- Performing Test ZMQ_HAVE_PTHREAD_SETNAME_2 - Success 11.64 npm ERR! -- Performing Test ZMQ_HAVE_PTHREAD_SETNAME_3 11.64 npm ERR! -- Performing Test ZMQ_HAVE_PTHREAD_SETNAME_3 - Failed 11.64 npm ERR! -- Performing Test ZMQ_HAVE_PTHREAD_SET_NAME 11.64 npm ERR! -- Performing Test ZMQ_HAVE_PTHREAD_SET_NAME - Failed 11.64 npm ERR! -- Checking pthread_setaffinity signature 11.64 npm ERR! -- Performing Test ZMQ_HAVE_PTHREAD_SET_AFFINITY 11.64 npm ERR! -- Performing Test ZMQ_HAVE_PTHREAD_SET_AFFINITY - Success 11.64 npm ERR! -- Checking whether getrandom is supported 11.64 npm ERR! -- Performing Test ZMQ_HAVE_GETRANDOM 11.64 npm ERR! -- Performing Test ZMQ_HAVE_GETRANDOM - Success 11.64 npm ERR! -- Could NOT find AsciiDoc (missing: ASCIIDOC_EXECUTABLE) 11.64 npm ERR! -- Configuring done (2.4s) 11.64 npm ERR! -- Generating done (0.0s) 11.64 npm ERR! -- Build files have been written to: /app/node_modules/zeromq/build/libzmq-staging/build 11.64 npm ERR! cmake --build ./build --config Release --target install 11.64 npm ERR! gmake[1]: Entering directory '/app/node_modules/zeromq/build/libzmq-staging/build' 11.64 npm ERR! [ 1%] Building C object CMakeFiles/objects.dir/external/sha1/sha1.c.o 11.64 npm ERR! [ 2%] Building C object CMakeFiles/objects.dir/src/tweetnacl.c.o 11.64 npm ERR! [ 3%] Building CXX object CMakeFiles/objects.dir/src/precompiled.cpp.o 11.64 npm ERR! [ 4%] Building CXX object CMakeFiles/objects.dir/src/address.cpp.o 11.64 npm ERR! [ 5%] Building CXX object CMakeFiles/objects.dir/src/channel.cpp.o 11.64 npm ERR! [ 6%] Building CXX object CMakeFiles/objects.dir/src/client.cpp.o 11.64 npm ERR! [ 7%] Building CXX object CMakeFiles/objects.dir/src/clock.cpp.o 11.64 npm ERR! [ 8%] Building CXX object CMakeFiles/objects.dir/src/ctx.cpp.o 11.64 npm ERR! [ 9%] Building CXX object CMakeFiles/objects.dir/src/curve_mechanism_base.cpp.o 11.64 npm ERR! [ 10%] Building CXX object CMakeFiles/objects.dir/src/curve_client.cpp.o 11.64 npm ERR! gmake[1]: Leaving directory '/app/node_modules/zeromq/build/libzmq-staging/build' 11.64 npm ERR! TOUCH Release/obj.target/libzmq.stamp 11.64 npm ERR! CXX(target) Release/obj.target/zeromq/src/context.o 11.64 npm ERR! rm 7722eaf02fcc073df28ffd1fa831e71544edfd42.intermediate 11.64 npm ERR! make: Leaving directory '/app/node_modules/zeromq/build' 11.64 npm ERR! No native build was found for platform=linux arch=arm64 runtime=node abi=120 uv=1 armv=8 libc=musl node=21.7.1 11.64 npm ERR! loaded from: /app/node_modules/zeromq 11.64 npm ERR! 11.64 npm ERR! gyp info it worked if it ends with ok 11.64 npm ERR! gyp info using node-gyp@10.0.1 11.64 npm ERR! gyp info using node@21.7.1 | linux | arm64 11.64 npm ERR! gyp info find Python using Python version 3.11.8 found at "/usr/bin/python3" 11.64 npm ERR! gyp http GET https://nodejs.org/download/release/v21.7.1/node-v21.7.1-headers.tar.gz 11.64 npm ERR! gyp http 200 https://nodejs.org/download/release/v21.7.1/node-v21.7.1-headers.tar.gz 11.64 npm ERR! gyp http GET https://nodejs.org/download/release/v21.7.1/SHASUMS256.txt 11.64 npm ERR! gyp http 200 https://nodejs.org/download/release/v21.7.1/SHASUMS256.txt 11.64 npm ERR! gyp info spawn /usr/bin/python3 11.64 npm ERR! gyp info spawn args [ 11.64 npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py', 11.64 npm ERR! gyp info spawn args 'binding.gyp', 11.64 npm ERR! gyp info spawn args '-f', 11.64 npm ERR! gyp info spawn args 'make', 11.64 npm ERR! gyp info spawn args '-I', 11.64 npm ERR! gyp info spawn args '/app/node_modules/zeromq/build/config.gypi', 11.64 npm ERR! gyp info spawn args '-I', 11.64 npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi', 11.64 npm ERR! gyp info spawn args '-I', 11.64 npm ERR! gyp info spawn args '/root/.cache/node-gyp/21.7.1/include/node/common.gypi', 11.64 npm ERR! gyp info spawn args '-Dlibrary=shared_library', 11.64 npm ERR! gyp info spawn args '-Dvisibility=default', 11.64 npm ERR! gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/21.7.1', 11.64 npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp', 11.64 npm ERR! gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/21.7.1/<(target_arch)/node.lib', 11.64 npm ERR! gyp info spawn args '-Dmodule_root_dir=/app/node_modules/zeromq', 11.64 npm ERR! gyp info spawn args '-Dnode_engine=v8', 11.64 npm ERR! gyp info spawn args '--depth=.', 11.64 npm ERR! gyp info spawn args '--no-parallel', 11.64 npm ERR! gyp info spawn args '--generator-output', 11.64 npm ERR! gyp info spawn args 'build', 11.64 npm ERR! gyp info spawn args '-Goutput_dir=.' 11.64 npm ERR! gyp info spawn args ] 11.64 npm ERR! gyp info spawn make 11.64 npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] 11.64 npm ERR! CMake Warning (dev) at CMakeLists.txt:2 (project): 11.64 npm ERR! cmake_minimum_required() should be called prior to this top-level project() 11.64 npm ERR! call. Please see the cmake-commands(7) manual for usage documentation of 11.64 npm ERR! both commands. 11.64 npm ERR! This warning is for project developers. Use -Wno-dev to suppress it. 11.64 npm ERR! 11.64 npm ERR! CMake Deprecation Warning at CMakeLists.txt:7 (cmake_minimum_required): 11.64 npm ERR! Compatibility with CMake < 3.5 will be removed from a future version of 11.64 npm ERR! CMake. 11.64 npm ERR! 11.64 npm ERR! Update the VERSION argument value or use a ... suffix to tell 11.64 npm ERR! CMake that the project does not need compatibility with older versions. 11.64 npm ERR! 11.64 npm ERR! 11.64 npm ERR! In file included from /usr/include/c++/13.2.1/ext/alloc_traits.h:34, 11.64 npm ERR! from /usr/include/c++/13.2.1/bits/stl_tree.h:67, 11.64 npm ERR! from /usr/include/c++/13.2.1/map:62, 11.64 npm ERR! from /app/node_modules/zeromq/build/libzmq-staging/libzmq-20de92ac0a2b2b9a1869782a429df68f93c3625e/src/metadata.hpp:33, 11.64 npm ERR! from /app/node_modules/zeromq/build/libzmq-staging/libzmq-20de92ac0a2b2b9a1869782a429df68f93c3625e/src/msg.hpp:40, 11.64 npm ERR! from /app/node_modules/zeromq/build/libzmq-staging/libzmq-20de92ac0a2b2b9a1869782a429df68f93c3625e/src/curve_client.cpp:35: 11.64 npm ERR! /usr/include/c++/13.2.1/bits/alloc_traits.h: In instantiation of 'struct std::__allocator_traits_base::__rebind, unsigned char, void>': 11.64 npm ERR! /usr/include/c++/13.2.1/bits/alloc_traits.h:94:11: required by substitution of 'template using std::__alloc_rebind = typename std::__allocator_traits_base::__rebind<_Alloc, _Up>::type [with _Alloc = zmq::secure_allocator_t; _Up = unsigned char]' 11.64 npm ERR! /usr/include/c++/13.2.1/bits/alloc_traits.h:228:8: required by substitution of 'template template using std::allocator_traits< >::rebind_alloc = std::__alloc_rebind<_Alloc, _Tp> [with _Tp = unsigned char; _Alloc = zmq::secure_allocator_t]' 11.64 npm ERR! /usr/include/c++/13.2.1/ext/alloc_traits.h:126:65: required from 'struct __gnu_cxx::__alloc_traits, unsigned char>::rebind' 11.64 npm ERR! /usr/include/c++/13.2.1/bits/stl_vector.h:88:21: required from 'struct std::_Vector_base >' 11.64 npm ERR! /usr/include/c++/13.2.1/bits/stl_vector.h:425:11: required from 'class std::vector >' 11.64 npm ERR! /app/node_modules/zeromq/build/libzmq-staging/libzmq-20de92ac0a2b2b9a1869782a429df68f93c3625e/src/curve_client_tools.hpp:64:76: required from here 11.64 npm ERR! /usr/include/c++/13.2.1/bits/alloc_traits.h:70:31: error: static assertion failed: allocator_traits::rebind_alloc must be A 11.64 npm ERR! 70 | _Tp>::value, 11.64 npm ERR! | ^~~~~ 11.64 npm ERR! /usr/include/c++/13.2.1/bits/alloc_traits.h:70:31: note: 'std::integral_constant::value' evaluates to false 11.64 npm ERR! cc1plus: note: unrecognized command-line option '-Wno-tautological-constant-compare' may have been intended to silence earlier diagnostics 11.64 npm ERR! gmake[3]: *** [CMakeFiles/objects.dir/build.make:202: CMakeFiles/objects.dir/src/curve_client.cpp.o] Error 1 11.64 npm ERR! gmake[2]: *** [CMakeFiles/Makefile2:85: CMakeFiles/objects.dir/all] Error 2 11.64 npm ERR! gmake[1]: *** [Makefile:136: all] Error 2 11.64 npm ERR! In file included from ../src/context.h:4, 11.64 npm ERR! from ../src/context.cc:2: 11.64 npm ERR! ../src/prefix.h:8:10: fatal error: zmq.h: No such file or directory 11.64 npm ERR! 8 | #include 11.64 npm ERR! | ^~~~~~~ 11.64 npm ERR! compilation terminated. 11.64 npm ERR! make: *** [zeromq.target.mk:125: Release/obj.target/zeromq/src/context.o] Error 1 11.64 npm ERR! gyp ERR! build error 11.64 npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2 11.64 npm ERR! gyp ERR! stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:209:23) 11.64 npm ERR! gyp ERR! System Linux 6.4.16-linuxkit 11.64 npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" 11.64 npm ERR! gyp ERR! cwd /app/node_modules/zeromq 11.64 npm ERR! gyp ERR! node -v v21.7.1 11.64 npm ERR! gyp ERR! node-gyp -v v10.0.1 11.64 npm ERR! gyp ERR! not ok 11.64 11.64 npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2024-04-04T15_10_25_551Z-debug-0.log ------ Dockerfile:8 -------------------- 6 | 7 | COPY package.json package-lock.json ./ 8 | >>> RUN npm install zeromq@6.0.0-beta.19 --build-from-source 9 | COPY . . 10 | -------------------- ERROR: failed to solve: process "/bin/sh -c npm install zeromq@6.0.0-beta.19 --build-from-source" did not complete successfully: exit code: 1

Reproducing try to docker build .

FROM node:21-alpine

WORKDIR /app

RUN apk add cmake python3 make curl g++

COPY package.json package-lock.json ./
RUN npm install zeromq@6.0.0-beta.19 --build-from-source
COPY . .

CMD npm run start

Expected behavior A clear and concise description of what you expected to happen.

Tested on

  • OS: Mac M1
  • ZeroMQ.js version: 6.0.0-beta.19
pshenmic commented 1 month ago

fatal error: zmq.h: No such file or directory

I think it misses zeromq installed

aminya commented 1 week ago

This should have been fixed in the last release