Closed intxgo closed 8 months ago
So, I just commented for now, but I'm a little worried that Architecture
and NativeArchitecture
might be functionally the same on linux.
Code looks fine, but I'm personally curious if we have a way to test the behavior of this under linux? On Darwin we have Rosetta, but is there some similar linux utility we're hoping to support?
Linux multiarch, that's how we run x86-64 tools in linux on Apple macbooks, etc
It's quite the contrary, we want to fail gracefully in products which cannot be run in emulation instead of giving the false impression that something is wrong with them.
Adds
NativeArchitecture
toHostInfo
to empower applications to detect if they are run in emulation.Modern desktop operating systems ported to the ARM architecture include capabilities to run x86 applications via binary translation to ease the technological transition. This is usually fine, except for applications that rely on a specific native platform, such as for installing native drivers.
Testing
Tested in the following configurations:
ARM64 CPU
macOS
native binary
AMD64 binary
Linux
native binary
AMD64 binary
Windows
N/A as Go doesn't support GOOS=Windows GOARCH=arm64
AMD64 CPU
macOS
native binary
ARM64 binary
N/A as Rosetta 2 is not supported on Intel platform
Linux
native binary
ARM64 binary
Windows
native binary
ARM64 binary
N/A as Go doesn't support GOOS=Windows GOARCH=arm64