Commit 4bd1522a authored by Nico Weber's avatar Nico Weber Committed by LUCI CQ

gclient: Stop running git under "arch" on macOS

We now have an arm python binary, so this should no longer be needed.

Bug: 1103326,1184767,1103236
Change-Id: I5510bf2c61adc2d0d505a886956a6677303df271
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2888957
Auto-Submit: Nico Weber <thakis@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@google.com>
Reviewed-by: 's avatarDirk Pranke <dpranke@google.com>
parent 4bedb9d8
......@@ -1377,22 +1377,6 @@ class GitWrapper(SCMWrapper):
revision = self._Capture(['rev-parse', 'FETCH_HEAD'])
return revision
def _IsRunningUnderRosetta(self):
if sys.platform != 'darwin':
return False
if self._running_under_rosetta is None:
# If we are running under Rosetta, platform.machine() is
# 'x86_64'; we need to use a sysctl to see if we're being
# translated.
import ctypes
libSystem = ctypes.CDLL("libSystem.dylib")
ret = ctypes.c_int(0)
size = ctypes.c_size_t(4)
e = libSystem.sysctlbyname(ctypes.c_char_p(b'sysctl.proc_translated'),
ctypes.byref(ret), ctypes.byref(size), None, 0)
self._running_under_rosetta = e == 0 and ret.value == 1
return self._running_under_rosetta
def _Run(self, args, options, **kwargs):
# Disable 'unused options' warning | pylint: disable=unused-argument
kwargs.setdefault('cwd', self.checkout_path)
......@@ -1401,18 +1385,6 @@ class GitWrapper(SCMWrapper):
env = scm.GIT.ApplyEnvVars(kwargs)
cmd = ['git'] + args
if self._IsRunningUnderRosetta():
# We currently only ship an Intel Python binary in depot_tools.
# Intel binaries run under Rosetta on ARM Macs, and by default
# prefer to run their subprocesses as Intel under Rosetta too.
# Intel git running under Rosetta has a bug where it fails to
# clone src.git (rdar://7868319), so until we ship a native
# ARM python3 binary, explicitly use `arch` to let git run
# the native ARM slice instead of the Intel slice.
# TODO(thakis): Remove this again once we ship an arm64 python3
# binary.
cmd = ['arch', '-arch', 'arm64e', '-arch', 'arm64'] + cmd
gclient_utils.CheckCallAndFilter(cmd, env=env, **kwargs)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment