Skip to content

Grpc.Tools - protoc fails on ubuntu 20.04.2 arm64 (but only when called by dotnet build) #26032

@peterwishart

Description

@peterwishart

What version of gRPC and what language are you using?

Grpc.Tools 2.37.0 / csharp

What operating system (Linux, Windows,...) and version?

Ubuntu 20.04.2 LTS aarch64 / Raspberry Pi4

What runtime / compiler are you using (e.g. python version or version of gcc)

.Net 5.0.202

What did you do?

Clone grpc/grpc-dotnet and cd to it.
Run source activate.sh
Edit build/dependencies.props to set example projects to use Grpc.AspNetCore 2.37.0
Cd to examples/Greeter/Server
dotnet build .

What did you expect to see?

Successful build (2.36 and below would fail as they lacked arm native tools)

What did you see instead?

Build fails with: grpc.tools/2.37.0/tools/linux_arm64/protoc" exited with code 139. (process stopped due to SIGSEGV?)
Debug log shows:

Task "ProtoCompile"
/home/username/.nuget/packages/grpc.tools/2.37.0/tools/linux_arm64/protoc --csharp_out=obj/Debug/net5.0 --plugin=protoc-gen-grpc=/home/username/.nuget/packages/grpc.tools/2.37.0/tools/linux_arm64/grpc_csharp_plugin --grpc_out=obj/Debug/net5.0 --grpc_opt=no_client --proto_path=/home/username/.nuget/packages/grpc.tools/2.37.0/build/native/include --proto_path=../Proto --dependency_out=obj/Debug/net5.0/830b0b44ffda90ec_greet.protodep --error_format=msvs ../Proto/greet.proto
1:7>/home/username/.nuget/packages/grpc.tools/2.37.0/build/_protobuf/Google.Protobuf.Tools.targets(280,5): error MSB6006: "/home/username/.nuget/packages/grpc.tools/2.37.0/tools/linux_arm64/protoc" exited with code 139. [/home/username/grpc-dotnet/examples/Greeter/Server/Server.csproj]
Done executing task "ProtoCompile" -- FAILED.

Running protoc using the logged commandline manually works and generates code - after this is done, dotnet build works.
I built protoc from latest github source and used that to replace the version shipped with Grpc.Tools 2.37.0, and the problem no longer occured on a clean build.

So it seems the tool only fails when both:

  • The binary shipped with NuGet package Grpc.Tools 2.37.0 is used
  • Its being run by a dotnet build

Anything else we should know about your project / environment?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions