diff --git a/multiversx_sdk_cli/config.py b/multiversx_sdk_cli/config.py index 32bc427c..fb0e0659 100644 --- a/multiversx_sdk_cli/config.py +++ b/multiversx_sdk_cli/config.py @@ -129,7 +129,7 @@ def get_defaults() -> dict[str, Any]: return { "dependencies.golang.resolution": "SDK", "dependencies.golang.tag": "go1.23.10", - "dependencies.golang.urlTemplate.linux": "https://golang.org/dl/{TAG}.linux-amd64.tar.gz", + "dependencies.golang.urlTemplate.linux": "https://golang.org/dl/{TAG}.linux-{ARCH}.tar.gz", "dependencies.golang.urlTemplate.osx": "https://golang.org/dl/{TAG}.darwin-amd64.tar.gz", "dependencies.golang.urlTemplate.windows": "https://golang.org/dl/{TAG}.windows-amd64.zip", "dependencies.testwallets.tag": "v1.0.0", diff --git a/multiversx_sdk_cli/dependencies/modules.py b/multiversx_sdk_cli/dependencies/modules.py index 3d2c4df9..5bb88ef2 100644 --- a/multiversx_sdk_cli/dependencies/modules.py +++ b/multiversx_sdk_cli/dependencies/modules.py @@ -1,4 +1,5 @@ import logging +import platform import os import shutil from os import path @@ -122,13 +123,22 @@ def get_parent_directory(self) -> Path: return config.get_dependency_parent_directory(self.key) def _get_download_url(self, tag: str) -> str: - platform = workstation.get_platform() + plat = workstation.get_platform() - url = config.get_dependency_url(self.key, tag, platform) + url = config.get_dependency_url(self.key, tag, plat) if not url: - raise errors.PlatformNotSupported(self.key, platform) - - url = url.replace("{TAG}", tag) + raise errors.PlatformNotSupported(self.key, plat) + + machine = platform.machine().lower() + arch_map = { + "x86_64": "amd64", + "amd64": "amd64", + "aarch64": "arm64", + "arm64": "arm64", + } + arch = arch_map.get(machine, "amd64") + + url = url.replace("{TAG}", tag).replace("{ARCH}", arch) return url def _get_archive_path(self, tag: str) -> Path: