From abda444816d150871d85c5eea7cd38cda03d0305 Mon Sep 17 00:00:00 2001 From: omerlevran46 <44589502+omerlevran46@users.noreply.github.com> Date: Fri, 8 Jul 2022 13:09:35 -0700 Subject: [PATCH] [fuchsia] build_fuchsia_artifacts.py use the tools from the proper (flutter/engine#34542) directory --- .../tools/fuchsia/build_fuchsia_artifacts.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/tools/fuchsia/build_fuchsia_artifacts.py b/engine/src/flutter/tools/fuchsia/build_fuchsia_artifacts.py index 0768d5206cb..c9171372510 100755 --- a/engine/src/flutter/tools/fuchsia/build_fuchsia_artifacts.py +++ b/engine/src/flutter/tools/fuchsia/build_fuchsia_artifacts.py @@ -48,8 +48,20 @@ def GetFuchsiaSDKPath(): return os.path.join(_src_root_dir, 'fuchsia', 'sdk', host_os) +def GetHostArchFromPlatform(): + host_arch = platform.machine() + # platform.machine() returns AMD64 on 64-bit Windows. + if host_arch in ['x86_64', 'AMD64']: + return 'x64' + elif host_arch == 'aarch64': + return 'arm64' + raise Exception('Unsupported host architecture: %s' % host_arch) + + def GetPMBinPath(): - return os.path.join(GetFuchsiaSDKPath(), 'tools', 'pm') + return os.path.join( + GetFuchsiaSDKPath(), 'tools', GetHostArchFromPlatform(), 'pm' + ) def RunExecutable(command):