Skip to content

Commit 3c99638

Browse files
Merge pull request #563 from multiversx/golang-arch-based-installation
Install golang based on system architecture
2 parents e7fdd23 + 2cdf22b commit 3c99638

2 files changed

Lines changed: 16 additions & 6 deletions

File tree

multiversx_sdk_cli/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def get_defaults() -> dict[str, Any]:
129129
return {
130130
"dependencies.golang.resolution": "SDK",
131131
"dependencies.golang.tag": "go1.23.10",
132-
"dependencies.golang.urlTemplate.linux": "https://golang.org/dl/{TAG}.linux-amd64.tar.gz",
132+
"dependencies.golang.urlTemplate.linux": "https://golang.org/dl/{TAG}.linux-{ARCH}.tar.gz",
133133
"dependencies.golang.urlTemplate.osx": "https://golang.org/dl/{TAG}.darwin-amd64.tar.gz",
134134
"dependencies.golang.urlTemplate.windows": "https://golang.org/dl/{TAG}.windows-amd64.zip",
135135
"dependencies.testwallets.tag": "v1.0.0",

multiversx_sdk_cli/dependencies/modules.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import logging
2+
import platform
23
import os
34
import shutil
45
from os import path
@@ -122,13 +123,22 @@ def get_parent_directory(self) -> Path:
122123
return config.get_dependency_parent_directory(self.key)
123124

124125
def _get_download_url(self, tag: str) -> str:
125-
platform = workstation.get_platform()
126+
plat = workstation.get_platform()
126127

127-
url = config.get_dependency_url(self.key, tag, platform)
128+
url = config.get_dependency_url(self.key, tag, plat)
128129
if not url:
129-
raise errors.PlatformNotSupported(self.key, platform)
130-
131-
url = url.replace("{TAG}", tag)
130+
raise errors.PlatformNotSupported(self.key, plat)
131+
132+
machine = platform.machine().lower()
133+
arch_map = {
134+
"x86_64": "amd64",
135+
"amd64": "amd64",
136+
"aarch64": "arm64",
137+
"arm64": "arm64",
138+
}
139+
arch = arch_map.get(machine, "amd64")
140+
141+
url = url.replace("{TAG}", tag).replace("{ARCH}", arch)
132142
return url
133143

134144
def _get_archive_path(self, tag: str) -> Path:

0 commit comments

Comments
 (0)