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

It doesn't build on arm64 architecture due to Node.js Fibers package #48

Open
shawnguo2 opened this issue Jun 3, 2018 · 2 comments
Open

Comments

@shawnguo2
Copy link

Hi,

I'm trying to do an arm64 native build of rocket.chat docker image. The problem I'm facing is that there is a prebuilt Fibers package for x64, but it has to be built from source on arm64. However, the build fails with -slim node image from which some tools like python are missing.

  • x64 architecture

fibers@2.0.0 install /app/bundle/programs/server/node_modules/fibers
node build.js || nodejs build.js
linux-x64-57 exists; testing
Binary is fine; exiting

  • arm64 architecture

fibers@2.0.0 install /app/bundle/programs/server/node_modules/fibers
node build.js || nodejs build.js
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:483:19)
gyp ERR! stack at PythonFinder. (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:397:16)
gyp ERR! stack at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:68:16)
gyp ERR! stack at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:42:5
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/node_modules/isexe/mode.js:8:5
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Linux 4.17.0-rc4-00005-g8f0d93ff4870
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
gyp ERR! cwd /app/bundle/programs/server/node_modules/fibers
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-gyp exited with code: 1
Please make sure you are using a supported platform and node version. If you
would like to compile fibers on this machine please make sure you have setup your
build environment--
Windows + OS X instructions here: https://github.com/nodejs/node-gyp
Ubuntu users please run: sudo apt-get install g++ build-essential
Alpine users please run: sudo apk add python make g++

It can be successfully built with changing base image from node:8.9-slim to node:8.9 in Dockerfile.

fibers@2.0.0 install /app/bundle/programs/server/node_modules/fibers
node build.js || nodejs build.js
make: Entering directory '/app/bundle/programs/server/node_modules/fibers/build'
CXX(target) Release/obj.target/fibers/src/fibers.o
CXX(target) Release/obj.target/fibers/src/coroutine.o
CC(target) Release/obj.target/fibers/src/libcoro/coro.o
SOLINK_MODULE(target) Release/obj.target/fibers.node
COPY Release/fibers.node
make: Leaving directory '/app/bundle/programs/server/node_modules/fibers/build'
Installed in /app/bundle/programs/server/node_modules/fibers/bin/linux-arm64-57/fibers.node

But is it the correct fix? Thanks.

Shawn

khasim added a commit to khasim/Docker.Official.Image that referenced this issue Aug 8, 2018
While trying to build Rocket.chat for ARM64 we found the Fibers package missing. There is a prebuilt Fibers package for x64, but it has to be built from source on arm64. However, the build fails with -slim node image from which some tools like python are missing.

Therefore we request the Rocket.chat project switch to using the non slim version of node image.

The issue was reported earlier here : RocketChat#48
khasim added a commit to khasim/Docker.Official.Image that referenced this issue Aug 8, 2018
While trying to build Rocket.chat for ARM64 we found the Fibers package missing. There is a pre-built Fibers package for x64, but it has to be built from source on arm64. However, the build fails with -slim node image from which some tools like python are missing.

Therefore we request the Rocket.chat project switch to using the non slim version of node image.

The issue was reported earlier here : RocketChat#48
@tianon
Copy link
Collaborator

tianon commented Aug 13, 2018

I'm not the image maintainer here, but IMO it'd be better to figure out what packages are necessary and install just those -- the difference between node:8.11-slim and node:8.11 is pretty significant:

$ docker images 'node:8.11*'
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
node                8.11-slim           1d5555ef5229        3 weeks ago         182MB
node                8.11                ed145ef978c4        3 weeks ago         673MB

I imagine the necessary build dependencies could probably even be added and subsequently removed in the same RUN line to save even more space on the arm64v8 build (to ensure it's got rough size parity with amd64). I think the hard part is going to be determining which architectures we need to install the build dependencies on, but perhaps that'd be fine to be a hard-coded list for now?

@lag-linaro
Copy link

#60

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants