node-re2 icon indicating copy to clipboard operation
node-re2 copied to clipboard

ARM64 prebuild binaries

Open viceice opened this issue 2 years ago • 8 comments

We at renovate are using re2 and have users who like to use it on ARM64 systems, so currently we would need to buildtools, as there are no prebuild binaries.

So i would suggest to also prebuild ARM64 binaries.

Some binaries are already build in docker images, so the docker ARM64 emulation can be used on linux host.

  • renovatebot/renovate#9229
  • https://docs.docker.com/desktop/multi-arch/

viceice avatar Jul 08 '21 05:07 viceice

I'm all for it. I need to learn how to do it unless somebody donates the code, or helps with it.

uhop avatar Jul 08 '21 21:07 uhop

Ok, i've updated the description a little bit, because this feature is requested by some users, but we maintainer have no direct interest, as we don't currently use or require ARM64 so this has a low prio and wait for the comunity to send pr's to make this happen.

viceice avatar Jul 09 '21 06:07 viceice

I've also seen, that the ARM64 qemu docker emulation is very slow when trying to compile binaries, so maybe some cross compilation would make it alot faster.

https://github.com/nodejs/node-gyp/issues/829

viceice avatar Jul 09 '21 06:07 viceice

The big question is how to set it up using GitHub Actions, which I use to prebuild binaries. Any working example is greatly appreciated. Obviously, I can rebuild them separately, e.g., on a local computer then submit them to a release, but it is more hassle and more chances to forget something.

uhop avatar Jul 09 '21 20:07 uhop

Basically you need to enable docker arm emulator

      - uses: docker/setup-qemu-action@v1
      - uses: docker/setup-buildx-action@v1

The you need to add --platform Linux/arm64 arg to docker build / run command.

Maybe you need to use buildpack / buildx.

https://github.com/containerbase/buildpack/pull/47/files

viceice avatar Jul 10 '21 06:07 viceice

+1 to this! When I do time npm install re2 on my M1 MacBook pro it does a full build and it takes quite a while:

real	0m40.293s
user	0m31.297s
sys	0m3.959s

samatcolumn avatar Mar 14 '22 09:03 samatcolumn

@uhop any update here?

ilpianista avatar Jul 21 '22 14:07 ilpianista

I still don't know how to build for the M1 MacBook using Github Actions. PRs are welcomed!

uhop avatar Jul 21 '22 17:07 uhop

Until GitHub Actions provide ARM-based Windows and Mac runners, I don’t see how it can be done.

Closing for now.

uhop avatar Dec 19 '22 02:12 uhop