Closed shotor closed 1 year ago
We don't provide Linux arm64 binaries for the same reason that we don't provide Mac M1 binaries: we don't have the environment available to do the build. Protobuf is a pain to cross-compile because of how it bootstraps itself, so we are only providing binaries that we can build on the corresponding environment. M1 build machines are at least on the roadmap for GitHub Actions, so we expect to support them eventually, but Linux arm64 is not on that roadmap, so we have no plans to provide Linux arm64 binaries.
If you want to use a Raspberry Pie, I suggest performing the build on another machine and then transferring the output files to the Pie. The grpc-tools
package is just a build tool; it is not needed at runtime.
@murgatroid99 Is this the item that is blocking the arm64 pipeline? If so it just shipped out and I just wanted to point it out and potentially give an update on this for the community.
Disregard that looks like it was the wrong item after doing some more reading. My bad.
We were able to do a local build, upload that to an S3 bucket, and then configure npm
to look there for binaries.
Here's the rough steps to follow
grpc-node
(including recursive submodules)./packages/grpc-tools/build_binaries.sh
jq
and cmake
)./artifacts
to your S3 bucket, marking it as public - it needs to keep the same path in the bucket as it had in artifacts
- for us that was grpc-tools/v1.11.2/
npm
to prefer our S3 bucket for the binaries by adding the following to .npmrc
in the repo
grpc_tools_binary_host_mirror=https://YOURBUCKETNAME.s3.amazonaws.com/nodejs-precompiled-binaries/
We also did the same thing for grpc-node
's native package, only that was easier to build as we could use the node-pre-gyp
automatic source fallback and then node-pre-gyp package
to create the tarball.
@Mills-2 Could you expand on why it wouldn't work? I did a local compile on my M1, and it works if I use @glenjamin's solution, but before diving into this and providing a PR I'd love to know what the blocker would have been.
My understanding is that the project doesn't want to provide pre-compiled binaries that were not created by a publicly visible CI provider.
So while it's possible to create binaries in an ad-hoc manner on individual M1 machines, there isn't yet a good way to hook this into the automated build tooling for the project.
@glenjamin yea that makes sense, but Github's M1 agents that @Mills-2 linked to would hypothetically work?
Thanks for the suggestion btw, @glenjamin, works great for us so far.
@janpieterz The issue I linked is for self-hosted runners. This issue is blocked by github hosted runners. It is still in future implementation on the roadmap for github.
I'm happy to donate an arm mac to the grpc team for the self hosted runner.
Version 1.11.3 now has Mac M1/arm64 binaries.
A great notification to wake up to. Thanks to all the people who made that happen.
Any chance the latest version can be published to NPM as well?
Edit: was just looking at the wrong package @grpc/grpc-js
. Of course this was about grpc-tools
The latest version is 1.11.3 and it is on NPM.
@murgatroid99 I updated to that new version and it worked a treat. Thank you!
Version 1.11.3 now has Mac M1/arm64 binaries.
Updated too and works great now without any work arounds. Thank you! 🙏
Still missing linux arm64 binary 😢
https://node-precompiled-binaries.grpc.io/grpc-tools/v1.11.3/linux-arm64.tar.gz
Version 1.11.3 now has Mac M1/arm64 binaries.
Still not available for linux (exp: if you have a docker image):
response status 404 Not Found on https://node-precompiled-binaries.grpc.io/grpc-tools/v1.11.3/linux-arm64.tar.gz
so I've added the following to my dockerfile
RUN npm_config_target_arch=x64 npm i grpc-tools
@source-transformer Excuse me, but how does this work? Assuming you have an arm64 Linux image, how is it able to run x64 binaries? Wouldn't that result in an error anyway?
Or do you just install the package but not actually use its components which require x64 binaries?
Or do you just install the package but not actually use its components which require x64 binaries?
Correct - I should have qualified my answer with - you can't actually run grpc-tools on your container. I had tried the following:
npm_config_target_arch=x86 npm i grpc-tools
In the hopes of getting a binary that potentially could be run. But, honestly that was just a shot in the dark as to the correct label/alias for the 32 bit build/architecture. I wasn't sure how to get a listing of supported architectures.
In my case - it isn't necessary to actually run grpc-tools on my docker container - since those tools are "devDependencies" and their output is actually copied to the docker image.
Will it support linux arm64 in the future? I'm looking forward to it.
A while back we made an alternative mirror for this... https://github.com/ZCube/grpc-precompiled-binaries
A while back we made an alternative mirror for this... https://github.com/ZCube/grpc-precompiled-binaries
How to bulid linux arm64? when I follow with this document: https://github.com/grpc/grpc-node/blob/master/packages/grpc-tools/build_binaries.sh。Error occurred:
...
[ 99%] Linking CXX executable protoc
[100%] Linking CXX executable grpc_node_plugin
/usr/bin/ld: cannot find -lstdc++
collect2: error: ld returned 1 exit status
gmake[2]: *** [grpc_node_plugin] Error 1
gmake[1]: *** [CMakeFiles/grpc_node_plugin.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
[100%] Built target protoc
gmake: *** [all] Error 2
ldconfig -p | less
libstdc++.so.6 (libc6,AArch64) => /lib64/libstdc++.so.6
libstdc++.so (libc6,AArch64) => /usr/local/lib/libstdc++.so
libssl3.so (libc6,AArch64) => /lib64/libssl3.so
I'll have to look again, it's been a while. I know it was pretty simple, though.
2 years later this issue still open
node-pre-gyp info it worked if it ends with ok | 88s
-- | --
86 | node-pre-gyp info using node-pre-gyp@1.0.10 | 88s
87 | node-pre-gyp info using node@16.17.1 \| linux \| x64 | 88s
88 | node-pre-gyp info check checked for "/drone/src/node_modules/grpc-tools/bin/grpc_tools.node" (not found) | 88s
89 | node-pre-gyp http GET https://node-precompiled-binaries.grpc.io/grpc-tools/v1.12.3/linux-x64.tar.gz | 88s
90 | node-pre-gyp ERR! install request to https://node-precompiled-binaries.grpc.io/grpc-tools/v1.12.3/linux-x64.tar.gz failed, reason: read ECONNRESET | 88s
91 | node-pre-gyp ERR! install error
@murgatroid99 and other contributors, are you planning to add support for the arm architecture? if you don't have enough time for that, I'd like to try to add arm support to your library.
I have no immediate plans to add this myself. If someone contributes a build change that produces ARM binaries for grpc-tools, I will accept it and publish them.
As soon as I remember how I did it, I'll integrate it into the build system and make a PR. (I hope that this message showing up multiple times is just a glitch in the GitHub app on my phone.)
@murgatroid99 I just finished a patch. https://github.com/RedstoneWizard08/grpc-node Successful build: https://github.com/RedstoneWizard08/grpc-node/actions/runs/3981949215/jobs/6826020346
PR: #2333
Merged!
The Linux ARM64 binary is now available in version 1.12.4.
Version 1.11.3 now has Mac M1/arm64 binaries.
actually it hasn't: https://github.com/grpc/grpc-node/issues/2378
Is it planned to support M2 architecture as well?
The latest version is 1.11.3 and it is on NPM.
Which repo are we talking about here? It sounds like folks have gotten grpc-node to work on Mac M series, is there a concise set of instructions I can follow?
Problem description
Can't install grpc-tools on arm architecture (raspberry pi) because of missing precompiled binaries.
Is it possible to build these at all?
Reproduction steps
npm init npm install grpc-tools
Environment
Additional context