Level / leveldown

Pure C++ Node.js LevelDB binding. An abstract-leveldown compliant store.
MIT License
775 stars 177 forks source link

Pi Zero prebuilds #703

Closed christianbundy closed 4 years ago

christianbundy commented 4 years ago

Hi! Would it be possible to add prebuilds for the Pi Zero (armv6)? It looks like it's as simple as adding a line to package.json, but I wanted to reach out and ask first before opening a PR. Thanks!

ralphtheninja commented 4 years ago

I haven't been around for a while so I think @vweevers is the go to guy. Iirc it would be a matter of adding a docker image for it in https://github.com/prebuild/docker-images (which is invoked by prebuildify-cross). That docker image also needs to be built and pushed to docker hub.

Once that has been done we could tweak package.json.

christianbundy commented 4 years ago

Thanks for the info! Looks like dockcross already supports it -- I'll try a docker build locally and push up a branch if I can get it working. :rocket:

vweevers commented 4 years ago

The steps are roughly:

Anyone opposed to increasing our package size? (I don't care)

ralphtheninja commented 4 years ago

I don't think it would mean that much increase in package size. I.e. I don't care :)

vweevers commented 4 years ago

Image is available, but npx prebuildify-cross -i linux-armv6 -i linux-arm64 -t 8.14.0 --napi --strip throws an error at the end, not being able to find strip:

Error: spawn /usr/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-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)

It's expected to be at /usr/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-strip, but we have:

$ ls /usr/arm-linux-gnueabihf/bin/
ar  as  c++  g++  gcc  gfortran  ld  ld.bfd  ld.gold  nm  objcopy  objdump  ranlib  strip

Uhm.

$ ls -al /usr/bin/arm-linux-gnueabihf-strip
-rwxr-xr-x 1 root root 769100 Jan 19 03:15 /usr/bin/arm-linux-gnueabihf-strip
$ ls -al /usr/arm-linux-gnueabihf/bin/strip
-rwxr-xr-x 1 root root 769100 Jan 19 03:15 /usr/arm-linux-gnueabihf/bin/strip
christianbundy commented 4 years ago

wat

vweevers commented 4 years ago

We have to fix PREBUILD_STRIP_BIN but what is the right path?

christianbundy commented 4 years ago

It looks like these two are byte-for-byte exactly the same file:

They're both:

GNU strip (crosstool-NG linaro-1.13.1-4.8-2014.01 - Linaro GCC 2013.11) 2.24.0.20131220

There's also /usr/bin/x86_64-linux-gnu-strip, which is:

GNU strip (GNU Binutils for Debian) 2.28
vweevers commented 4 years ago

Let's go with /usr/arm-linux-gnueabihf/bin/strip, I guess 🤷‍♂

vweevers commented 4 years ago

Will publish 5.5.0 ~in a few hours~ soon, requires 2FA but I don't have access to OTP generator atm.

vweevers commented 4 years ago

Published.

christianbundy commented 4 years ago

Thank you!