zeromq.js icon indicating copy to clipboard operation
zeromq.js copied to clipboard

Add Linux ARM Prebuilds to CI

Open jcmalek opened this issue 2 years ago • 19 comments

Describe the bug I think that the v6.0.0-beta.7 release: v6.0.0-beta.7 may have lost support for a generic linux ARM build and/or no longer has 32-bit ARM support and the latest builds are now specific to MacOS/darwin. (Maybe happened during move from Travis to GitHub actions)

Reproducing In previous versions there existed prebuilt code for /prebuilds/linux-arm and /prebuilds/linux-arm64, now I am only seeing /prebuilds/darwin-arm64 which may be unusable on more generic linux based 32-bit ARM systems.

Expected behavior Please restore support for generic linux-arm and linux-arm64. This may just be a build naming issue if you aren't actually using anything specific to MacOS/darwin.

Tested on

  • Linux distro: ARM i.MX 7 Yocto Poky 4.0.12 (kirkstone) (Open-Embedded Linux)
  • ZeroMQ.js version: 6.0.0-beta.19

jcmalek avatar Dec 05 '23 17:12 jcmalek

The prebuilds might have been not uploaded by the CI. We can release with those

aminya avatar Dec 06 '23 07:12 aminya

I don't think the arm 32 and 64 prebuilds are even built anymore in the CI recipe but I haven't looked closely.

On Wed, Dec 6, 2023 at 2:21 AM Amin Yahyaabadi @.***> wrote:

The prebuilds might have been not uploaded by the CI. We can release with those

— Reply to this email directly, view it on GitHub https://github.com/zeromq/zeromq.js/issues/590#issuecomment-1842228882, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANA6Z5MEEMBIO5EX6LVCJ2LYIAMJDAVCNFSM6AAAAABAIA5DAWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBSGIZDQOBYGI . You are receiving this because you authored the thread.Message ID: @.***>

jcmalek avatar Dec 18 '23 18:12 jcmalek

PRs for adding that to CI are welcome!

aminya avatar Dec 19 '23 23:12 aminya

Maybe if I have a chance in the New Year. Thanks Amin!

On Tue, Dec 19, 2023 at 6:30 PM Amin Yahyaabadi @.***> wrote:

PRs for adding that to CI are welcome!

— Reply to this email directly, view it on GitHub https://github.com/zeromq/zeromq.js/issues/590#issuecomment-1863613460, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANA6Z5MNU6IWYOGVQ3IZAWLYKIPRDAVCNFSM6AAAAABAIA5DAWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRTGYYTGNBWGA . You are receiving this because you authored the thread.Message ID: @.***>

jcmalek avatar Dec 20 '23 23:12 jcmalek

Could this be the cause why I'm getting this error while installing zeromq inside a Docker container?

No native build was found for platform=linux arch=arm64 runtime=node abi=108 uv=1 armv=8 libc=glibc node=18.17.0

The container's image is declared as:

FROM node:18.17.0

enzoferey avatar Jan 02 '24 10:01 enzoferey

This may be the same error as me: https://github.com/zeromq/zeromq.js/issues/594

dawadam avatar Jan 02 '24 13:01 dawadam

Downgrading to zeromq@^5.3.1 fixed the issue for me, so I can confirm the corresponding prebuild was there at some point before.

enzoferey avatar Jan 02 '24 14:01 enzoferey

Yes, that is the same error we get. It looks like they stopped building the generic linux ARM builds when they switched CI systems. I think it is just a matter of updating their CI "recipe" but I haven't had time to look at it myself.

On Tue., Jan. 2, 2024, 5:37 a.m. Enzo Ferey, @.***> wrote:

Could this be the cause why I'm getting this error while installing zeromq inside a Docker container?

No native build was found for platform=linux arch=arm64 runtime=node abi=108 uv=1 armv=8 libc=glibc node=18.17.0

The container's image is declared as:

FROM node:18.17.0

— Reply to this email directly, view it on GitHub https://github.com/zeromq/zeromq.js/issues/590#issuecomment-1873857662, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANA6Z5L5AO2TCQVUD6POAY3YMPPOPAVCNFSM6AAAAABAIA5DAWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZTHA2TONRWGI . You are receiving this because you authored the thread.Message ID: @.***>

jcmalek avatar Jan 02 '24 15:01 jcmalek

We can add ARM builds to CI, but we will need to use Qemu for ARM emulation. Travis used to support ARM, but GitHub Actions doesn't natively.

We can probably use something like this to make it easier: https://github.com/marketplace/actions/run-on-architecture

aminya avatar Jan 02 '24 15:01 aminya

anyone working on this?

ShaharHD avatar May 15 '24 16:05 ShaharHD

@ShaharHD Not now, but PRs are welcome.

aminya avatar May 15 '24 16:05 aminya

@ShaharHD Not now, but PRs are welcome.

Started to try and work on this, but when I try to follow the basic Build from source I'm faliing with:

git clone https://github.com/zeromq/zeromq.js.git
cd zeromq.js
npm install

During the npm install it tries to execute the build - and it fails on the following:

> tsc -p ./src/tsconfig.json && run-s build.library.compat

node_modules/@types/glob/index.d.ts:29:42 - error TS2694: Namespace '"/Users/shahar/Develop/github/zeromq.js/node_modules/minimatch/dist/cjs/index"' has no exported member 'IOptions'.

29     interface IOptions extends minimatch.IOptions {
                                            ~~~~~~~~

node_modules/@types/glob/index.d.ts:74:30 - error TS2724: '"/Users/shahar/Develop/github/zeromq.js/node_modules/minimatch/dist/cjs/index"' has no exported member named 'IMinimatch'. Did you mean 'Minimatch'?

74         minimatch: minimatch.IMinimatch;
                                ~~~~~~~~~~


Found 2 errors in the same file, starting at: node_modules/@types/glob/index.d.ts:29

running npm install again, ignores that error it seems

but now running npm run build, still shows the same error as above

This is running on a Ubuntu v20.04.16 LTS WSL on an Intel core i7

Am I doing anything wrong?

ShaharHD avatar May 16 '24 20:05 ShaharHD

You should probably use pnpm instead of npm.

aminya avatar May 16 '24 20:05 aminya

You should probably use pnpm instead of npm.

pnpm resolved the issue on the linux machine.

The README.md needs to be updated as well :)

FYI, the pnpm install does not work properly on Apple silicon based macOS (I'm guessing something broken with the rebuild scripts)

ShaharHD avatar May 16 '24 20:05 ShaharHD

Small update, I managed to manualy build the arm version without any issue. Did some small changes in the prebuild an build files, but nothing major.

I'm now working on adding the relevant build steps. I cannot use the alpine version, but there's no issue with Ubuntu v20 - can I use the docker image of ubuntu 20.0x? (its much bigger than alpine, but it has the required build tools as part of apt and not manual tricky is needed)

ShaharHD avatar May 21 '24 00:05 ShaharHD

Yes, feel free to use Ubuntu. PRs are very welcome for the changes!

aminya avatar May 21 '24 02:05 aminya

While I'm working on the PR, @jcmalek if you still in the need for it, attached is the arm64 linux version of the library (glibc only for now)

This file needs to be unzipped and copied manually (for now) into node_modules/zeromq/prebuilds/linux-arm64

node.napi.glibc.node.zip

ShaharHD avatar May 21 '24 20:05 ShaharHD

Thanks so much for working on this @ShaharHD! We'll definitely use this once it is merged. Much appreciated :)

jcmalek avatar May 27 '24 14:05 jcmalek

@ShaharHD Could you make a pull request with your progress? We can work on it together to finish it.

aminya avatar Jun 17 '24 19:06 aminya