Skip to content

Commit 5f33f7d

Browse files
authored
Use x86_64 version of artifact tool for M1 macs (using Rosetta) (#1210)
* Use x86_64 version of artifact tool for M1 macs (using Rosetta) * Update artifacttool_updater.py
1 parent be8b5a8 commit 5f33f7d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

azure-devops/azext_devops/dev/common/artifacttool_updater.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,18 @@ def _get_current_release(organization, override_version):
158158
# Distro returns empty strings on Windows currently, so don't even send
159159
distro_name = distro.id() or None
160160
distro_version = distro.version() or None
161+
os_name = platform.system()
162+
arch = platform.machine()
163+
164+
# For M1 macs, there is no version of artifact tool. However, the x86_64
165+
# version can run under Rosetta, so we use that instead.
166+
if os_name == "Darwin" and arch in ["amd64", "arm64"]:
167+
arch = "x86_64"
168+
161169
release = client.get_clienttool_release(
162170
"ArtifactTool",
163-
os_name=platform.system(),
164-
arch=platform.machine(),
171+
os_name=os_name,
172+
arch=arch,
165173
distro_name=distro_name,
166174
distro_version=distro_version,
167175
version=override_version)

0 commit comments

Comments
 (0)