Skip to content

Commit

Permalink
Use x86 protoc binaries on arm64 Windows (#32017)
Browse files Browse the repository at this point in the history
  • Loading branch information
tonydnewell authored and wanlin31 committed May 18, 2023
1 parent a7607cc commit 6d53449
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/csharp/Grpc.Tools.Tests/ProtoToolsPlatformTaskTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ public void CpuIsArm64()
{
Assert.AreEqual("x64", _task.Cpu);
}
// On windows arm64, x86 is used until a native protoc is shipped
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
Assert.AreEqual("x86", _task.Cpu);
}
else
{
Assert.AreEqual("arm64", _task.Cpu);
Expand Down
5 changes: 5 additions & 0 deletions src/csharp/Grpc.Tools/ProtoToolsPlatform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ public override bool Execute()
{
Cpu = "x64";
}
// Use x86 on Windows arm64 until a native protoc is shipped
else if (Os == "windows" && Cpu == "arm64")
{
Cpu = "x86";
}

return true;
}
Expand Down

0 comments on commit 6d53449

Please sign in to comment.