Forking grpc-tools
Background
grpc-tools
does NOT provides an official prebuilt binary for darwin_arm64, which breaks our bazel workspace on Apple Silicon.
See grpc-node #1405 for further details.
Current Workaround
As a workaround, we're hosting a mirror for grpc-tools
. Here's a link hosting the mirror:
You can use the mirror as follows:
npm_config_grpc_tools_binary_host_mirror="https://github.com/lmt-swallow/grpc-node/raw/b6b48a83af92d5c9e88feb2e10d7b624bff6638f/artifacts/" \
yarn install
Steps to host a binary for a latest version
NOTE: the following steps require Apple Silicon at hand.
- Merge the upstream to the hosting repository (lmt-swallow/grpc-node).
- On pushing to
master
of the mirror, a workflow generates binaries for x86_x64 and ia32 and uploads the artifacts like this. Run the workflow somehow, download the combined artifacts, and extract it. - Build a binary for Apple Silicon on your machine with Apple Silicon as follows. Then you'll see a generate file like
artifacts/grpc-tools/vX.XX.X/darwin-arm64.tar.gz
.
cd packages/grpc-tools && \
git submodule update --init --recursive && \
./build_binaries.sh
- In your local machine, copy all
{os}-{arch}.tar.gz
in the downloaded artifacts intoartifacts/grpc-tools/{version}
under the cloned repository. The repository structure may be as follows:
grpc-tools/
└── v1.11.2
├── darwin-arm64.tar.gz
├── darwin-x64.tar.gz
├── linux-x64.tar.gz
├── win32-ia32.tar.gz
└── win32-x64.tar.gz
- In your local machine, commit all
tar.gz
underartifacts
and push the commit like this - All set! Now you can use
https://github.com/lmt-swallow/grpc-node/raw/{commit hash}/artifacts/
as a valid value fornpm_config_grpc_tools_binary_host_mirror
.