RocketChat / RocketChat/Docker.Official.Image

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

Open
#48 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Dockerfile
Stars
337
Forks
228
Avg merge
3d 10h
Merged PRs (30d)
5

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Dockerfile and compare the node:8.9-slim and node:8.9 base images used for the Rocket.Chat image. Reproduce the arm64 build and inspect the fibers/node-gyp failure involving the missing Python tool. Done means the Docker image builds successfully on arm64 with the selected base image.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, node.js
Domain
build-system, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.