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

[Bug] Docker build fails on ARM_64 (aarch64v8) #3595

Closed
pdlloyd opened this issue Aug 10, 2023 · 0 comments · Fixed by #3596
Closed

[Bug] Docker build fails on ARM_64 (aarch64v8) #3595

pdlloyd opened this issue Aug 10, 2023 · 0 comments · Fixed by #3596
Labels
Awaiting Reproduction Can we reproduce the reported bug?

Comments

@pdlloyd
Copy link
Contributor

pdlloyd commented Aug 10, 2023

Describe the Bug

When performing a production build of the OHIF Viewer inside the included Docker container while running on an ARM_64 (aarch64v8) processor, Yarn eventually fails with the following error:

151.9 verbose 109.656568006 Error: /usr/src/app/node_modules/@parcel/watcher: Command failed.
151.9 Exit code: 1
151.9 Command: node-gyp-build
151.9 Arguments: 
151.9 Directory: /usr/src/app/node_modules/@parcel/watcher
151.9 Output:
151.9 /usr/src/app/node_modules/node-gyp-build/node-gyp-build.js:60
151.9   throw new Error('No native build was found for ' + target + '\n    loaded from: ' + dir + '\n')
151.9   ^
151.9 
151.9 Error: No native build was found for platform=linux arch=arm64 runtime=node abi=93 uv=1 armv=8 libc=glibc node=16.15.0
151.9     loaded from: /usr/src/app/node_modules/@parcel/watcher
151.9 
151.9     at Function.load.resolve.load.path (/usr/src/app/node_modules/node-gyp-build/node-gyp-build.js:60:9)
151.9     at load (/usr/src/app/node_modules/node-gyp-build/node-gyp-build.js:22:30)
151.9     at Object.<anonymous> (/usr/src/app/node_modules/node-gyp-build/build-test.js:19:19)
151.9     at Module._compile (node:internal/modules/cjs/loader:1105:14)
151.9     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
151.9     at Module.load (node:internal/modules/cjs/loader:981:32)
151.9     at Function.Module._load (node:internal/modules/cjs/loader:822:12)
151.9     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
151.9     at node:internal/main/run_main_module:17:47
151.9 
151.9 gyp info it worked if it ends with ok
151.9 gyp info using [email protected]
151.9 gyp info using [email protected] | linux | arm64
151.9 gyp ERR! find Python 
151.9 gyp ERR! find Python Python is not set from command line or npm configuration
151.9 gyp ERR! find Python Python is not set from environment variable PYTHON
151.9 gyp ERR! find Python checking if "python3" can be used
151.9 gyp ERR! find Python - "python3" is not in PATH or produced an error
151.9 gyp ERR! find Python checking if "python" can be used
151.9 gyp ERR! find Python - "python" is not in PATH or produced an error
151.9 gyp ERR! find Python 
151.9 gyp ERR! find Python **********************************************************
151.9 gyp ERR! find Python You need to install the latest version of Python.
151.9 gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
151.9 gyp ERR! find Python you can try one of the following options:
151.9 gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
151.9 gyp ERR! find Python   (accepted by both node-gyp and npm)
151.9 gyp ERR! find Python - Set the environment variable PYTHON
151.9 gyp ERR! find Python - Set the npm configuration variable python:
151.9 gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
151.9 gyp ERR! find Python For more information consult the documentation at:
151.9 gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
151.9 gyp ERR! find Python **********************************************************
151.9 gyp ERR! find Python 
151.9 gyp ERR! configure error 
151.9 gyp ERR! stack Error: Could not find any Python installation to use
151.9 gyp ERR! stack     at PythonFinder.fail (/usr/src/app/node_modules/node-gyp/lib/find-python.js:330:47)
151.9 gyp ERR! stack     at PythonFinder.runChecks (/usr/src/app/node_modules/node-gyp/lib/find-python.js:159:21)
151.9 gyp ERR! stack     at PythonFinder.<anonymous> (/usr/src/app/node_modules/node-gyp/lib/find-python.js:202:16)
151.9 gyp ERR! stack     at PythonFinder.execFileCallback (/usr/src/app/node_modules/node-gyp/lib/find-python.js:294:16)
151.9 gyp ERR! stack     at exithandler (node:child_process:406:5)
151.9 gyp ERR! stack     at ChildProcess.errorhandler (node:child_process:418:5)
151.9 gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
151.9 gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
151.9 gyp ERR! stack     at onErrorNT (node:internal/child_process:478:16)
151.9 gyp ERR! stack     at processTicksAndRejections (node:internal/process/task_queues:83:21)
151.9 gyp ERR! System Linux 6.2.0-26-generic
151.9 gyp ERR! command "/usr/local/bin/node" "/usr/src/app/node_modules/.bin/node-gyp" "rebuild"
151.9 gyp ERR! cwd /usr/src/app/node_modules/@parcel/watcher
151.9 gyp ERR! node -v v16.15.0
151.9 gyp ERR! node-gyp -v v9.4.0
151.9 gyp ERR! not ok
151.9     at ProcessTermError.ExtendableBuiltin (/opt/yarn-v1.22.18/lib/cli.js:721:66)
151.9     at ProcessTermError.MessageError (/opt/yarn-v1.22.18/lib/cli.js:750:123)
151.9     at new ProcessTermError (/opt/yarn-v1.22.18/lib/cli.js:790:113)
151.9     at ChildProcess.<anonymous> (/opt/yarn-v1.22.18/lib/cli.js:25783:17)
151.9     at ChildProcess.emit (node:events:527:28)
151.9     at maybeClose (node:internal/child_process:1092:16)
151.9     at Socket.<anonymous> (node:internal/child_process:451:11)
151.9     at Socket.emit (node:events:527:28)
151.9     at Pipe.<anonymous> (node:net:709:12)
151.9 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
151.9 verbose 109.708245825 
151.9 verbose 109.708635426 husky > Setting up git hooks
151.9 spawnSync git ENOENT
151.9 husky > Failed to install

I believe this is due to the fact that @parcel/watcher is a native C++ module which has to be built for the architecture it's running on. Yarn detects this discrepancy and triggers node-gyp to recompile @parcel/watcher. node-gyp fails, however, because it depends on Python v3.7+, make, and GCC. These dependencies are not included in the node:16.15.0-slim Docker image used to build the Viewer.

Steps to Reproduce

  1. Be running an ARM_64 (aarch64v8) machine with git and docker installed.
  2. git clone --recursive https://github.com/OHIF/Viewers.git
  3. cd Viewers
  4. sudo docker build . -t ohif-viewer-image

The current behavior

The build of the Docker image fails.

The expected behavior

The build finishes successfully, producing a local Docker image.

OS

Ubuntu Linux 22.04.3 LTS

Node version

node:16.15.0-slim (Docker image)

Browser

Any

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Reproduction Can we reproduce the reported bug?
Projects
None yet
1 participant