Skip to content

Commit

Permalink
Fix macOS dotnet root discovery (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
filmor authored Jan 3, 2023
1 parent 717e797 commit a56d77c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions clr_loader/util/find.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
import os.path
import platform
import shutil
import sys
from pathlib import Path
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit a56d77c

Please sign in to comment.