setup-protoc
setup-protoc copied to clipboard
Support linux arm64/aarch64 architecture
The releases for arm64/aarch64 are already provided on the Protobuf releases page https://github.com/protocolbuffers/protobuf/releases and thus can easily be supported
Just tried this a little bit ago but for some reason I'm getting the following:
protoc-gen-grpc: program not found or is not executable
Please specify a program using absolute path or make sure the program is available in your PATH system variable
--grpc_out: protoc-gen-grpc: Plugin failed with status code 1.
Could you provide a step by step please? I tried this in AWS Graviton EC2 instances (linux-arm64) and it seemed to have worked properly.
Could you perhaps be missing the grpc plugin for arm64 instead?
Just used the action as is and tried to generate my plugin as usual.
Hmm, I can't be sure of your setup but it's possible that the grpc plugin is missing from your setup. I tried the following on the AWS arm64 instances:
syntax = "proto3";
option go_package = "./helloworld";
package helloworld;
// The greeting service definition.
service Greeter {
// Sends a greeting
rpc SayHello (HelloRequest) returns (HelloReply) {}
}
// The request message containing the user's name.
message HelloRequest {
string name = 1;
}
// The response message containing the greetings
message HelloReply {
string message = 1;
}
Generating C++ artifacts wihtout gRPC worked out of the box:
$ protoc --cpp_out=. helloworld.proto
Generating C++ artifacts with gRPC gave the error that gRPC plugin was missing:
$ protoc --cpp_out=. --cpp_grpc_out=. helloworld.proto
protoc-gen-cpp_grpc: program not found or is not executabl
which could be fixed by building the plugin for C++ via https://github.com/grpc/grpc
I tried the same for go artifacts and I had to download the plugins (for go code generation and gRPC) myself:
$ go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
$ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
After that they worked as well:
$ protoc --go_out=. --go-grpc_out=. helloworld.proto
I'm pretty sure you're missing the gRPC plugin for your language which you can obtain from https://github.com/grpc/grpc
Could be that for x86_64 they're pre-included for some languages, but I can't be sure. For almost all languages that I worked with (Go, Javascript, Python, Java, Kotlin) I'd always had to install the plugins.
The c# one was the one failing for me
Could you perhaps try installing the Nuget GRPC package as specified here?https://github.com/grpc/grpc/tree/master/src/csharp#how-to-use
To be able to generate code from Protocol Buffer (
.proto
) file definitions, add the Grpc.Tools NuGet package which provides code generation integrated into your build.
np, I will just use a different action. This doesn't seem to work for my needs out of the box
@per1234 Hi! Are you still working on this?
I think the erroneous line of the action is here:
const arch: string = osArch == "x64" ? "x86_64" : "x86_32";
I guess the function could be modified to take another parameter which defaults to "x86" (to avoid breaking backwards-compatibility) but lets users request the arm version.
I tried working on this myself. I can run npm install
and npm run test
just fine, all OK, but I get failures on npm run build
:
% npm run build
> [email protected] build
> tsc
node_modules/keyv/src/index.d.ts:60:32 - error TS2304: Cannot find name 'AsyncGenerator'.
60 iterator(namespace?: string): AsyncGenerator<any, void, any>;
~~~~~~~~~~~~~~
Found 1 error.
Any ideas? I'm on WSFL, Ubuntu, using node v16.17.1
Hi @adamchalmers. I am not able to reproduce the problem. However, this project use Node.js 12.x, so please use that version for development.
I highly recommend the excellent nvm tool for managing multiple installations of Node.js:
https://github.com/nvm-sh/nvm
I realize it is very unfortunate that the project has not been updated to use the current LTS version of Node.js. I also realize that it is unacceptable that this information is not documented anywhere. I hope we will eventually manage to pay off all the tech debt and make this project something that is maintainable and contributor friendly. But for now we just have to make the best of what we have to work with.
No worries! I tried again using node 12 and I still get the same error when I try to build.
# node --version
v12.16.1
# npm --version
6.13.4
Does this require having a Typescript compiler installed? Are there any other local dependencies whose version I should check?
Update: This was solved by running npm install typescript --save-dev
-- not sure if this means the main repo should be modified somehow. Seems to be assuming the presence of typescript, but shouldn't that be installed by npm install
?
Any word on when this is coming, would be super useful for local actions runs on apple silicon.
Implemented in 1.3.0. Thanks to @adamchalmers contribution :partying_face:
/cc @nbaztec @0xAlcibiades