Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v5 prebuild on linux is in the wrong folder? #565

Open
albertowd opened this issue Mar 24, 2023 · 0 comments
Open

v5 prebuild on linux is in the wrong folder? #565

albertowd opened this issue Mar 24, 2023 · 0 comments
Labels

Comments

@albertowd
Copy link

Describe the bug
I think the 5.3.1 prebuilds are broken because my images from node:lts-bullseye (currently 18) stopped working when using prebuilds, but are working when not using prebuilds folder. The bullseye images do not compile binaries, at least I don't see it in any log message during npm ci process and I think it doesn't even have the necessary tools to compile without build-essentials installed before it. But even so, this command will generate a binary on node_modules/zeromq/build/Release/zmq.node that will be used with no problems, but the binary on node_modules/zeromq/prebuilds/linux-x64/node.abi108.node will crash the app.

Reproducing
On Dockerfile, deleting unused binaries after ci (the build folder is created with a zmq.node binary, but no compilation is displayed):

FROM node:lts-bullseye
CMD ["npm", "run", "start"]
WORKDIR /app/
COPY ./package*.json ./
RUN npm ci --omit=dev && \
    rm -r node_modules/zeromq/build/ \
        node_modules/zeromq/prebuilds/darwin-x64/ \
        node_modules/zeromq/prebuilds/linux-x64/electron* \
        node_modules/zeromq/prebuilds/linux-x64/node.abi[789]* \
        node_modules/zeromq/prebuilds/win32-ia32/ \
        node_modules/zeromq/prebuilds/win32-x64/
COPY ./build/ ./build/

When running this image, I've got this error:

node build/server.js

node:internal/modules/cjs/loader:1243
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /app/node_modules/zeromq/prebuilds/linux-x64/node.abi108.node)
    at Module._extensions..node (node:internal/modules/cjs/loader:1243:18)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
  ^C
    at require (node:internal/modules/cjs/helpers:103:18)
    at load (/app/node_modules/node-gyp-build/node-gyp-build.js:22:10)
    at Object.<anonymous> (/app/node_modules/zeromq/binding.js:1:43)

BUUUUUUUT, when a do not delete the build folder and delete all other binaries:

FROM node:lts-bullseye
CMD ["npm", "run", "start"]
WORKDIR /app/
COPY ./package*.json ./
RUN npm ci --omit=dev && \
    rm -r node_modules/zeromq/prebuilds/darwin-x64/ \
        node_modules/zeromq/prebuilds/linux-x64/ \
        node_modules/zeromq/prebuilds/win32-ia32/ \
        node_modules/zeromq/prebuilds/win32-x64/
COPY ./build/ ./build/

It works corretly:

node build/server.js

Couldn't connect to Log Manager!

Expected behavior
Start the container with no errors with the desired prebuild binary.

Tested on

  • OS: Docker image node:lts-bullseye (current LTS is NodeJs 18)
  • ZeroMQ.js version: 5.3.1

PS.: it would be great if you could make musl prebuilds to this version, as is the current stable too, alpine images are far thinner to work with. ;)
PS: using debian slim images, for some reason, makes the node com compile itself, as they can´t see there is prebuilds already

@albertowd albertowd added the bug label Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant