Skip to content

arm64 musl modules that are cross-built by prebuildify are not recognized #2

@serg3k

Description

@serg3k

When I try building arm64 musl addon
locally on my arm64 MacBookPro
using following command:
prebuildify --napi -t 18.16.0 --strip --arch arm64 --platform linux --libc musl --tag-libc

So that binary is available in prebuilds folder:

$ ll packages/tdl/prebuilds/linux-arm64
total 328
-rwxr-xr-x  1 user  staff    91K Dec 13 10:15 node.napi.musl.node

And then try npm install-ing this tdl package inside of docker container that is running on images based on node:18-alpine.

Then node-gyp-build does not recognize that musl binary actually exists in the package:

#10 [6/7] RUN cd ~/.n8n/ && mkdir nodes && cd nodes && npm install tdl@7.4.0-9
#10 sha256:8a0c514eea926357cdef486ceab0e3ac428cb8f53a944a74c1d328089fe34524
#10 1.001 npm ERR! code 1
#10 1.002 npm ERR! path /home/node/.n8n/nodes/node_modules/tdl
#10 1.003 npm ERR! command failed
#10 1.003 npm ERR! command sh -c node-gyp-build
#10 1.003 npm ERR! gyp ERR! find Python
#10 1.003 npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration
#10 1.003 npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
#10 1.003 npm ERR! gyp ERR! find Python checking if "python3" can be used
#10 1.003 npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error
#10 1.003 npm ERR! gyp ERR! find Python checking if "python" can be used
#10 1.004 npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error
#10 1.004 npm ERR! gyp ERR! find Python
#10 1.004 npm ERR! gyp ERR! find Python **********************************************************
#10 1.004 npm ERR! gyp ERR! find Python You need to install the latest version of Python.
#10 1.004 npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
#10 1.004 npm ERR! gyp ERR! find Python you can try one of the following options:
#10 1.004 npm ERR! gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
#10 1.004 npm ERR! gyp ERR! find Python   (accepted by both node-gyp and npm)
#10 1.004 npm ERR! gyp ERR! find Python - Set the environment variable PYTHON
#10 1.004 npm ERR! gyp ERR! find Python - Set the npm configuration variable python:
#10 1.004 npm ERR! gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
#10 1.004 npm ERR! gyp ERR! find Python For more information consult the documentation at:
#10 1.005 npm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
#10 1.005 npm ERR! gyp ERR! find Python **********************************************************
#10 1.005 npm ERR! gyp ERR! find Python
#10 1.005 npm ERR! gyp ERR! configure error
#10 1.005 npm ERR! gyp ERR! stack Error: Could not find any Python installation to use
#10 1.005 npm ERR! gyp ERR! stack     at PythonFinder.fail (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:330:47)
#10 1.005 npm ERR! gyp ERR! stack     at PythonFinder.runChecks (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:159:21)
#10 1.005 npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:202:16)
#10 1.005 npm ERR! gyp ERR! stack     at PythonFinder.execFileCallback (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:294:16)
#10 1.005 npm ERR! gyp ERR! stack     at exithandler (node:child_process:430:5)
#10 1.005 npm ERR! gyp ERR! stack     at ChildProcess.errorhandler (node:child_process:442:5)
#10 1.005 npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:517:28)
#10 1.005 npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:290:12)
#10 1.005 npm ERR! gyp ERR! stack     at onErrorNT (node:internal/child_process:477:16)
#10 1.005 npm ERR! gyp ERR! stack     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
#10 1.005 npm ERR! gyp ERR! System Linux 5.15.49-linuxkit
#10 1.006 npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
#10 1.006 npm ERR! gyp ERR! cwd /home/node/.n8n/nodes/node_modules/tdl
#10 1.006 npm ERR! gyp ERR! node -v v18.18.2
#10 1.006 npm ERR! gyp ERR! node-gyp -v v9.3.1
#10 1.006 npm ERR! gyp ERR! not ok
#10 1.007
#10 1.008 npm ERR! A complete log of this run can be found in:
#10 1.008 npm ERR!     /home/node/.npm/_logs/2023-12-13T09_19_54_338Z-debug-0.log
#10 ERROR: executor failed running [/bin/sh -c cd ~/.n8n/ && mkdir nodes && cd nodes && npm install tdl@7.4.0-9]: exit code: 1
------
 > [6/7] RUN cd ~/.n8n/ && mkdir nodes && cd nodes && npm install tdl@7.4.0-9:
------
executor failed running [/bin/sh -c cd ~/.n8n/ && mkdir nodes && cd nodes && npm install tdl@7.4.0-9]: exit code: 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions