prebuild / docker-images

Docker images for cross compiling prebuilt binaries for Node.js native addons.
GNU General Public License v3.0
10 stars 7 forks source link

Strip binary not found in linux-armv6 #20

Closed vweevers closed 3 years ago

vweevers commented 3 years ago

Running prebuildify-cross -i linux-armv6 --napi --strip results in:

Error: spawn /usr/xcc/armv6-unknown-linux-gnueabihf/bin/strip ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)

We define it here:

https://github.com/prebuild/docker-images/blob/5c35ae480ad6b0c160416c812bda9684c54ea9f5/linux-armv6/Dockerfile#L23

And the value of CROSS_ROOT is:

$ docker run --rm -it ghcr.io/prebuild/linux-armv6:1 bash
node@474bb16d9bf2:/app$ echo $CROSS_ROOT
/usr/xcc/armv6-unknown-linux-gnueabihf

There's indeed no strip binary there. But there is one here:

node@474bb16d9bf2:/app$ file ${CROSS_ROOT}/bin/${CROSS_TRIPLE}-strip
/usr/xcc/armv6-unknown-linux-gnueabihf/bin/armv6-unknown-linux-gnueabihf-strip: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=9bfeb3fe97d894fd1e5bc28a8749c02205bd9eb3, for GNU/Linux 3.2.0, stripped

So we must change the Dockerfile to:

ENV PREBUILD_STRIP_BIN ${CROSS_ROOT}/bin/${CROSS_TRIPLE}-strip

Which matches the other linux-* images, e.g.:

https://github.com/prebuild/docker-images/blob/5c35ae480ad6b0c160416c812bda9684c54ea9f5/linux-arm64/Dockerfile#L23