Skip to content

gateleen-hook-js build not portable to non-glibc systems #551

@hiddenalpha

Description

@hiddenalpha

Seems as "gateleen-hook-js" tries to use non-portable nodejs binary.

Disclaimer: I do not need a solution to this. This is to document why gateleen cannot build on alpine for future reference. To prevent others to waste time with it again.

For example try "mvn install" gateleen on alpine:

$ cat /etc/*release*

3.15.9
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.15.9
PRETTY_NAME="Alpine Linux v3.15"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"

Reproducer Input:

true \
  && su root -c "apk add curl maven redis openjdk11-jre-headless" \
  && su root -c "rc-update add redis && /etc/init.d/redis start" \
  && mkdir -p ~/work/gateleen && cd ~/work/gateleen \
  && curl -sSL https://github.com/swisspush/gateleen/archive/refs/tags/v2.0.3.tar.gz \
      | tar --strip-components 1 -xz \
  && mvn clean install -PpublicRepos -DskipTests \
  && true

Reproducer Output:

[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for org.swisspush.gateleen:gateleen-hook-js:jar:2.0.3
[WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.apache.maven.plugins:maven-dependency-plugin @ line 129, column 21
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-jar-plugin is missing. @ line 28, column 21
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 

<... cropped away usual maven noise ...>

[INFO] --------------< org.swisspush.gateleen:gateleen-hook-js >---------------
[INFO] Building gateleen-hook-js 2.0.3                                  [20/25]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ gateleen-hook-js ---
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0:enforce (enforce-maven) @ gateleen-hook-js ---
[INFO] 
[INFO] --- frontend-maven-plugin:1.6:install-node-and-npm (install node and npm profile trigged) @ gateleen-hook-js ---
[INFO] Installing node version v8.9.4
[INFO] Downloading https://nodejs.org/dist/v8.9.4/node-v8.9.4-linux-x64.tar.gz to /home/user/.m2/repository/com/github/eirslett/node/8.9.4/node-8.9.4-linux-x64.tar.gz
[INFO] No proxies configured
[INFO] No proxy was configured, downloading directly
[INFO] Unpacking /home/user/.m2/repository/com/github/eirslett/node/8.9.4/node-8.9.4-linux-x64.tar.gz into /home/user/work/gateleen/gateleen-hook-js/node/tmp
[INFO] Copying node binary from /home/user/work/gateleen/gateleen-hook-js/node/tmp/node-v8.9.4-linux-x64/bin/node to /home/user/work/gateleen/gateleen-hook-js/node/node
[INFO] Installed node locally.
[INFO] Installing npm version 6.14.8
[INFO] Downloading http://registry.npmjs.org/npm/-/npm-6.14.8.tgz to /home/user/.m2/repository/com/github/eirslett/npm/6.14.8/npm-6.14.8.tar.gz
[INFO] No proxies configured
[INFO] No proxy was configured, downloading directly
[INFO] Unpacking /home/user/.m2/repository/com/github/eirslett/npm/6.14.8/npm-6.14.8.tar.gz into /home/user/work/gateleen/gateleen-hook-js/node/node_modules
[INFO] Installed npm locally.
[INFO] 
[INFO] --- maven-dependency-plugin:2.10:unpack-dependencies (unpack org.webjars dependencies) @ gateleen-hook-js ---
[INFO] Unpacking /home/user/.m2/repository/org/webjars/angularjs/1.5.8/angularjs-1.5.8.jar to /home/user/work/gateleen/gateleen-hook-js/target/webjars with includes "**/*.js" and excludes ""
[INFO] 
[INFO] --- frontend-maven-plugin:1.6:npm (npm install regular) @ gateleen-hook-js ---
[INFO] Running 'npm --userconfig /home/user/work/gateleen/gateleen-hook-js/.npmrc-public install' in /home/user/work/gateleen/gateleen-hook-js
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for gateleen 2.0.3:
[INFO] 
[INFO] gateleen ........................................... SUCCESS [  1.151 s]
[INFO] gateleen-testhelper ................................ SUCCESS [  1.609 s]
[INFO] gateleen-core ...................................... SUCCESS [  3.353 s]
[INFO] gateleen-cache ..................................... SUCCESS [  0.715 s]
[INFO] gateleen-validation ................................ SUCCESS [  0.768 s]
[INFO] gateleen-kafka ..................................... SUCCESS [  0.726 s]
[INFO] gateleen-logging ................................... SUCCESS [  0.705 s]
[INFO] gateleen-monitoring ................................ SUCCESS [  0.427 s]
[INFO] gateleen-routing ................................... SUCCESS [  0.997 s]
[INFO] gateleen-packing ................................... SUCCESS [  0.096 s]
[INFO] gateleen-delta ..................................... SUCCESS [  0.402 s]
[INFO] gateleen-queue ..................................... SUCCESS [  1.483 s]
[INFO] gateleen-delegate .................................. SUCCESS [  0.406 s]
[INFO] gateleen-expansion ................................. SUCCESS [  1.178 s]
[INFO] gateleen-merge ..................................... SUCCESS [  0.172 s]
[INFO] gateleen-user ...................................... SUCCESS [  0.451 s]
[INFO] gateleen-security .................................. SUCCESS [  0.545 s]
[INFO] gateleen-scheduler ................................. SUCCESS [  0.907 s]
[INFO] gateleen-hook ...................................... SUCCESS [  0.861 s]
[INFO] gateleen-hook-js ................................... FAILURE [ 20.718 s]
[INFO] gateleen-qos ....................................... SKIPPED
[INFO] gateleen-player .................................... SKIPPED
[INFO] gateleen-runconfig ................................. SKIPPED
[INFO] gateleen-playground ................................ SKIPPED
[INFO] gateleen-test ...................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  37.894 s
[INFO] Finished at: 2024-01-19T15:04:40+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.6:npm (npm install regular) on project gateleen-hook-js: Failed to run task: 'npm --userconfig /home/user/work/gateleen/gateleen-hook-js/.npmrc-public install' failed. java.io.IOException: Cannot run program "/home/user/work/gateleen/gateleen-hook-js/node/node" (in directory "/home/user/work/gateleen/gateleen-hook-js"): error=2, No such file or directory -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :gateleen-hook-js

However, the file is present and is an actual ELF executable. In addition, it is also set to be executable:

$ file /home/user/work/gateleen/gateleen-hook-js/node/node

/home/user/work/gateleen/gateleen-hook-js/node/node: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.18, BuildID[sha1]=5394b4ef0f944ed5ff0312400db27189f4bcc587, with debug_info, not stripped
$ ls -Ahl /home/user/work/gateleen/gateleen-hook-js/node/node

-rwxr-xr-x    1 user     user       33.6M Jan 19 15:12 /home/user/work/gateleen/gateleen-hook-js/node/node

I assume the problem lies in the dependencies:

$ readelf -d gateleen-hook-js/node/node
 ...
 0x0000000000000001 (NEEDED)             Shared library: [libdl.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [librt.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libpthread.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 ...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions