Skip to content

Commit a56d77c

Browse files
authored
Fix macOS dotnet root discovery (#45)
1 parent 717e797 commit a56d77c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clr_loader/util/find.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import os
2-
import os.path
2+
import platform
33
import shutil
44
import sys
55
from pathlib import Path
@@ -42,7 +42,8 @@ def find_dotnet_root() -> Path:
4242
prog_files = Path(prog_files)
4343
dotnet_root = prog_files / "dotnet"
4444
elif sys.platform == "darwin":
45-
if sys.maxsize > 2**32: # is_64bits
45+
if "ARM64" in os.uname().version and platform.machine() == "x86_64":
46+
# Apple Silicon in Rosetta 2 mode
4647
dotnet_root = Path("/usr/local/share/dotnet/x64")
4748
else:
4849
dotnet_root = Path("/usr/local/share/dotnet")

0 commit comments

Comments
 (0)