Skip to content

Commit

Permalink
Use x86_64 version of artifact tool for M1 macs (using Rosetta) (#1210)
Browse files Browse the repository at this point in the history
* Use x86_64 version of artifact tool for M1 macs (using Rosetta)

* Update artifacttool_updater.py
  • Loading branch information
dalemyers committed Oct 13, 2021
1 parent be8b5a8 commit 5f33f7d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions azure-devops/azext_devops/dev/common/artifacttool_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,18 @@ def _get_current_release(organization, override_version):
# Distro returns empty strings on Windows currently, so don't even send
distro_name = distro.id() or None
distro_version = distro.version() or None
os_name = platform.system()
arch = platform.machine()

# For M1 macs, there is no version of artifact tool. However, the x86_64
# version can run under Rosetta, so we use that instead.
if os_name == "Darwin" and arch in ["amd64", "arm64"]:
arch = "x86_64"

release = client.get_clienttool_release(
"ArtifactTool",
os_name=platform.system(),
arch=platform.machine(),
os_name=os_name,
arch=arch,
distro_name=distro_name,
distro_version=distro_version,
version=override_version)
Expand Down

0 comments on commit 5f33f7d

Please sign in to comment.