From 55c8f6afcb9fa68a65173b6eac079e36dd59ca79 Mon Sep 17 00:00:00 2001 From: godofredoc Date: Mon, 5 Jun 2023 15:12:13 -0700 Subject: [PATCH] Use the arm64 dsymutil on Mac M1 machines (#42533) Use the right binary architectures on scripts running dsymutil. This is to fix the problem of bad architecture binary for builds running on dart internal: https://github.com/flutter/flutter/issues/128098 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style --- sky/tools/create_embedder_framework.py | 4 +++- sky/tools/create_full_ios_framework.py | 4 +++- sky/tools/create_ios_framework.py | 4 +++- sky/tools/create_macos_framework.py | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/sky/tools/create_embedder_framework.py b/sky/tools/create_embedder_framework.py index 357095785272e..bd55a5674a281 100755 --- a/sky/tools/create_embedder_framework.py +++ b/sky/tools/create_embedder_framework.py @@ -5,6 +5,7 @@ # found in the LICENSE file. import argparse +import platform import subprocess import shutil import sys @@ -14,8 +15,9 @@ os.path.join(os.path.realpath(__file__), '..', '..', '..', '..') ) +ARCH_SUBPATH = 'mac-arm64' if platform.processor() == 'arm' else 'mac-x64' DSYMUTIL = os.path.join( - os.path.dirname(__file__), '..', '..', '..', 'buildtools', 'mac-x64', + os.path.dirname(__file__), '..', '..', '..', 'buildtools', ARCH_SUBPATH, 'clang', 'bin', 'dsymutil' ) diff --git a/sky/tools/create_full_ios_framework.py b/sky/tools/create_full_ios_framework.py index 3c1e0f979cd32..5858ddefb7b12 100644 --- a/sky/tools/create_full_ios_framework.py +++ b/sky/tools/create_full_ios_framework.py @@ -9,14 +9,16 @@ import argparse import os +import platform import shutil import subprocess import sys from create_xcframework import create_xcframework # pylint: disable=import-error +ARCH_SUBPATH = 'mac-arm64' if platform.processor() == 'arm' else 'mac-x64' DSYMUTIL = os.path.join( - os.path.dirname(__file__), '..', '..', '..', 'buildtools', 'mac-x64', + os.path.dirname(__file__), '..', '..', '..', 'buildtools', ARCH_SUBPATH, 'clang', 'bin', 'dsymutil' ) diff --git a/sky/tools/create_ios_framework.py b/sky/tools/create_ios_framework.py index f0815df23d745..a95ec4131ca48 100755 --- a/sky/tools/create_ios_framework.py +++ b/sky/tools/create_ios_framework.py @@ -5,6 +5,7 @@ # found in the LICENSE file. import argparse +import platform import subprocess import shutil import sys @@ -12,8 +13,9 @@ from create_xcframework import create_xcframework # pylint: disable=import-error +ARCH_SUBPATH = 'mac-arm64' if platform.processor() == 'arm' else 'mac-x64' DSYMUTIL = os.path.join( - os.path.dirname(__file__), '..', '..', '..', 'buildtools', 'mac-x64', + os.path.dirname(__file__), '..', '..', '..', 'buildtools', ARCH_SUBPATH, 'clang', 'bin', 'dsymutil' ) diff --git a/sky/tools/create_macos_framework.py b/sky/tools/create_macos_framework.py index bbe047fad0a2c..c1382527ad4c2 100755 --- a/sky/tools/create_macos_framework.py +++ b/sky/tools/create_macos_framework.py @@ -5,6 +5,7 @@ # found in the LICENSE file. import argparse +import platform import subprocess import shutil import sys @@ -14,8 +15,9 @@ os.path.join(os.path.realpath(__file__), '..', '..', '..', '..') ) +ARCH_SUBPATH = 'mac-arm64' if platform.processor() == 'arm' else 'mac-x64' DSYMUTIL = os.path.join( - os.path.dirname(__file__), '..', '..', '..', 'buildtools', 'mac-x64', + os.path.dirname(__file__), '..', '..', '..', 'buildtools', ARCH_SUBPATH, 'clang', 'bin', 'dsymutil' )