proper support for macOS/Rosetta: let "uname -m" report arm64 instead of x86_64;
authorwenzelm
Tue, 11 May 2021 16:55:42 +0200
changeset 73929 70d3c7009a65
parent 73928 7404f2e1d092
child 73930 0d79ac2eb106
child 73932 6c56f2ebe157
proper support for macOS/Rosetta: let "uname -m" report arm64 instead of x86_64;
src/Pure/Admin/build_polyml.scala
--- a/src/Pure/Admin/build_polyml.scala	Tue May 11 16:30:24 2021 +0200
+++ b/src/Pure/Admin/build_polyml.scala	Tue May 11 16:55:42 2021 +0200
@@ -63,9 +63,16 @@
     /* bash */
 
     def bash(
-      cwd: Path, script: String, redirect: Boolean = false, echo: Boolean = false): Process_Result =
+      cwd: Path, script: String,
+      redirect: Boolean = false,
+      echo: Boolean = false): Process_Result =
     {
-      progress.bash(mingw.bash_script(script), cwd = cwd.file, redirect = redirect, echo = echo)
+      val script1 =
+        if (platform.is_arm && platform.is_macos) {
+          "arch -arch arm64 bash -c " + Bash.string(script)
+        }
+        else mingw.bash_script(script)
+      progress.bash(script1, cwd = cwd.file, redirect = redirect, echo = echo)
     }