hostNativeDirName function
Host platform subdirectory used by both the hooks' cache layout and the
in-repo prebuilt/ trees.
Linux ships both x86_64 and arm64, so this asks uname -m rather than
guessing: on an arm64 host the x86_64 file also exists, and preferring it by
existence hands the caller an incompatible ELF.
Implementation
String? hostNativeDirName() {
if (Platform.isMacOS) return 'macos_arm64';
if (Platform.isWindows) return 'windows_x86_64';
if (Platform.isLinux) {
final arch = _unameMachine();
if (arch == 'aarch64' || arch == 'arm64') return 'linux_arm64';
return 'linux_x86_64';
}
return null;
}