From c9a6ac8e8227824af1175d9e5b180f2aa516a7f3 Mon Sep 17 00:00:00 2001 From: Benedikt Reinartz Date: Tue, 3 Jan 2023 11:57:01 +0100 Subject: [PATCH] Fix macOS dotnet root discovery --- clr_loader/util/find.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/clr_loader/util/find.py b/clr_loader/util/find.py index 22ba843..d5d7b89 100644 --- a/clr_loader/util/find.py +++ b/clr_loader/util/find.py @@ -1,5 +1,5 @@ import os -import os.path +import platform import shutil import sys from pathlib import Path @@ -42,7 +42,8 @@ def find_dotnet_root() -> Path: prog_files = Path(prog_files) dotnet_root = prog_files / "dotnet" elif sys.platform == "darwin": - if sys.maxsize > 2**32: # is_64bits + if "ARM64" in os.uname().version and platform.machine() == "x86_64": + # Apple Silicon in Rosetta 2 mode dotnet_root = Path("/usr/local/share/dotnet/x64") else: dotnet_root = Path("/usr/local/share/dotnet")