discordjs / opus

Native opus bindings for node
MIT License
192 stars 55 forks source link

Unable to install on linux arm64 #118

Closed bokherus closed 2 years ago

bokherus commented 2 years ago

Please describe the problem you are having in as much detail as possible: Fail to install the dependency due to prebuild binaries is not available for linux arm64.

Include a reproducible code sample here, if possible: Error logs from github action running from a self-hosted linux machine

#9 [base 6/6] RUN yarn install --prod
#9 0.402 yarn install v1.22.15
#9 0.504 [1/5] Validating package.json...
#9 0.508 [2/5] Resolving packages...
#9 0.740 [3/5] Fetching packages...
#9 11.50 info fsevents@2.3.2: The platform "linux" is incompatible with this module.
#9 11.50 info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
#9 11.50 [4/5] Linking dependencies...
#9 12.77 [5/5] Building fresh packages...
#9 13.39 error /usr/app/node_modules/@discordjs/opus: Command failed.
#9 13.39 Exit code: 1
#9 13.39 Command: node-pre-gyp install --fallback-to-build
#9 13.39 Arguments: 
#9 13.39 Directory: /usr/app/node_modules/@discordjs/opus
#9 13.39 Output:
#9 13.39 node-pre-gyp info it worked if it ends with ok
#9 13.39 node-pre-gyp info using node-pre-gyp@0.4.2
#9 13.39 node-pre-gyp info using node@16.13.2 | linux | arm64
#9 13.39 node-pre-gyp info check checked for "/usr/app/node_modules/@discordjs/opus/prebuild/node-v93-napi-v3-linux-arm64-musl-1.2.2/opus.node" (not found)
#9 13.39 node-pre-gyp http GET https://github.com/discordjs/opus/releases/download/v0.7.0/opus-v0.7.0-node-v93-napi-v3-linux-arm64-musl-1.2.2.tar.gz
#9 13.39 node-pre-gyp ERR! install response status 404 Not Found on https://github.com/discordjs/opus/releases/download/v0.7.0/opus-v0.7.0-node-v93-napi-v3-linux-arm64-musl-1.2.2.tar.gz 
#9 13.39 node-pre-gyp WARN Pre-built binaries not installable for @discordjs/opus@0.7.0 and node@16.13.2 (node-v93 ABI, musl) (falling back to source compile with node-gyp) 
#9 13.39 node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/discordjs/opus/releases/download/v0.7.0/opus-v0.7.0-node-v93-napi-v3-linux-arm64-musl-1.2.2.tar.gz 
#9 13.39 gyp info it worked if it ends with ok
#9 13.39 gyp info using node-gyp@8.3.0
#9 13.39 gyp info using node@16.13.2 | linux | arm64
#9 13.39 gyp info ok 
#9 13.39 gyp info it worked if it ends with ok
#9 13.39 gyp info using node-gyp@8.3.0
#9 13.39 gyp info using node@16.13.2 | linux | arm64
#9 13.39 gyp ERR! find Python 
#9 13.39 gyp ERR! find Python Python is not set from command line or npm configuration
#9 13.39 gyp ERR! find Python Python is not set from environment variable PYTHON
#9 13.39 gyp ERR! find Python checking if "python3" can be used
#9 13.39 gyp ERR! find Python - "python3" is not in PATH or produced an error
#9 13.39 gyp ERR! find Python checking if "python" can be used
#9 13.39 gyp ERR! find Python - "python" is not in PATH or produced an error
#9 13.39 gyp ERR! find Python 
#9 13.39 gyp ERR! find Python **********************************************************
#9 13.39 gyp ERR! find Python You need to install the latest version of Python.
#9 13.39 gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
#9 13.39 gyp ERR! find Python you can try one of the following options:
#9 13.39 gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
#9 13.39 gyp ERR! find Python   (accepted by both node-gyp and npm)
#9 13.39 gyp ERR! find Python - Set the environment variable PYTHON
#9 13.39 gyp ERR! find Python - Set the npm configuration variable python:
#9 13.39 gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
#9 13.39 gyp ERR! find Python For more information consult the documentation at:
#9 13.39 gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
#9 13.39 gyp ERR! find Python **********************************************************
#9 13.39 gyp ERR! find Python 
#9 13.39 gyp ERR! configure error 
#9 13.39 gyp ERR! stack Error: Could not find any Python installation to use
#9 13.39 gyp ERR! stack     at PythonFinder.fail (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:330:47)
#9 13.39 gyp ERR! stack     at PythonFinder.runChecks (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:159:21)
#9 13.39 gyp ERR! stack     at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:202:16)
#9 13.39 gyp ERR! stack     at PythonFinder.execFileCallback (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:294:16)
#9 13.39 gyp ERR! stack     at exithandler (node:child_process:404:5)
#9 13.39 gyp ERR! stack     at ChildProcess.errorhandler (node:child_process:416:5)
#9 13.39 gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
#9 13.39 gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:288:12)
#9 13.39 gyp ERR! stack     at onErrorNT (node:internal/child_process:477:16)
#9 13.39 gyp ERR! stack     at processTicksAndRejections (node:internal/process/task_queues:83:21)
#9 13.39 gyp ERR! System Linux 4.14.256-197.484.amzn2.aarch64
#9 13.39 gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/usr/app/node_modules/@discordjs/opus/prebuild/node-v93-napi-v3-linux-arm64-musl-1.2.2/opus.node" "--module_name=opus" "--module_path=/usr/app/node_modules/@discordjs/opus/prebuild/node-v93-napi-v3-linux-arm64-musl-1.2.2" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"
#9 13.39 gyp ERR! cwd /usr/app/node_modules/@discordjs/opus
#9 13.39 gyp ERR! node -v v16.13.2
#9 13.39 gyp ERR! node-gyp -v v8.3.0
#9 13.39 gyp ERR! not ok 
#9 13.39 node-pre-gyp ERR! build error 
#9 13.39 node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/app/node_modules/@discordjs/opus/prebuild/node-v93-napi-v3-linux-arm64-musl-1.2.2/opus.node --module_name=opus --module_path=/usr/app/node_modules/@discordjs/opus/prebuild/node-v93-napi-v3-linux-arm64-musl-1.2.2 --napi_version=8 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
#9 13.39 node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/app/node_modules/@discordjs/node-pre-gyp/lib/util/compile.js:85:20)
#9 13.39 node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
#9 13.39 node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1064:16)
#9 13.39 node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
#9 13.39 node-pre-gyp ERR! System Linux 4.14.256-197.484.amzn2.aarch64
#9 13.39 node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/app/node_modules/@discordjs/opus/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
#9 13.39 node-pre-gyp ERR! cwd /usr/app/node_modules/@discordjs/opus
#9 13.39 node-pre-gyp ERR! node -v v16.13.2
#9 13.39 node-pre-gyp ERR! node-pre-gyp -v v0.4.2
#9 13.39 node-pre-gyp ERR! not ok 
#9 13.39 Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/app/node_modules/@discordjs/opus/prebuild/node-v93-napi-v3-linux-arm64-musl-1.2.2/opus.node --module_name=opus --module_path=/usr/app/node_modules/@discordjs/opus/prebuild/node-v93-napi-v3-linux-arm64-musl-1.2.2 --napi_version=8 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
#9 13.39 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
#9 ERROR: process "/bin/sh -c yarn install --prod" did not complete successfully: exit code: 1

Further details:

iCrawl commented 2 years ago

Error: Could not find any Python installation to use

bokherus commented 2 years ago

Hi @iCrawl, I'm not sure if I understand this correctly. Is it possible to avoid node-pre-gyp falls back to source compile and required python and gcc dependency of node-gyp for builds on linux arm64?

9 13.39 node-pre-gyp info check checked for "/usr/app/node_modules/@discordjs/opus/prebuild/node-v93-napi-v3-linux-arm64-musl-1.2.2/opus.node" (not found)
#9 13.39 node-pre-gyp http GET https://github.com/discordjs/opus/releases/download/v0.7.0/opus-v0.7.0-node-v93-napi-v3-linux-arm64-musl-1.2.2.tar.gz
#9 13.39 node-pre-gyp ERR! install response status 404 Not Found on https://github.com/discordjs/opus/releases/download/v0.7.0/opus-v0.7.0-node-v93-napi-v3-linux-arm64-musl-1.2.2.tar.gz 
#9 13.39 node-pre-gyp WARN Pre-built binaries not installable for @discordjs/opus@0.7.0 and node@16.13.2 (node-v93 ABI, musl) (falling back to source compile with node-gyp) 
#9 13.39 node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/discordjs/opus/releases/download/v0.7.0/opus-v0.7.0-node-v93-napi-v3-linux-arm64-musl-1.2.2.tar.gz

As checked on the releases it seems only opus-v0.7.0-node-v93-napi-v3-linux-x64-musl-1.2.2.tar.gz is available.

iCrawl commented 2 years ago

No, we simply cannot build for every possible gcc version out there, only the ones that are installed by github runners.

bokherus commented 2 years ago

I see, that's pretty reasonable.