Skip to content
Snippets Groups Projects
Commit 7d489f6a authored by Jan Tattermusch's avatar Jan Tattermusch
Browse files

use process architecture instead of OS architecture

parent 8665e94b
No related branches found
No related tags found
No related merge requests found
......@@ -60,7 +60,7 @@ namespace Grpc.Tools
: RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ? OsKind.MacOsX
: OsKind.Unknown;
switch (RuntimeInformation.OSArchitecture)
switch (RuntimeInformation.ProcessArchitecture)
{
case Architecture.X86: Cpu = CpuKind.X86; break;
case Architecture.X64: Cpu = CpuKind.X64; break;
......@@ -86,17 +86,7 @@ namespace Grpc.Tools
}
// Hope we are not building on ARM under Xamarin!
Cpu = Environment.Is64BitOperatingSystem ? CpuKind.X64 : CpuKind.X86;
// See https://github.com/grpc/grpc/issues/18543
// Problem: Is64BitOperatingSystem returns "true" inside a 32-bit docker container.
// Workaround: Mono is 64-bit by default on linux, so we get around
// this by assuming 32-bit mono linux process means
// we should invoke 32-bit version of protoc.
if (Os == OsKind.Linux && !Environment.Is64BitProcess)
{
Cpu = CpuKind.X86;
}
Cpu = Environment.Is64BitProcess ? CpuKind.X64 : CpuKind.X86;
#endif
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment