Skip to content

Commit 5fe4cae

Browse files
authored
Fix arm64 for MacOS (#289)
1 parent dcdd2f8 commit 5fe4cae

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

builder/core/host.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ def current_os():
2525

2626

2727
def current_arch():
28-
if current_os() == 'linux':
28+
if current_os() == 'linux' or current_os() == 'macos':
2929
machine_id = os.uname()[4]
30-
m = re.match(r'^(aarch64|armv[6-8])', machine_id.strip())
30+
m = re.match(r'^(aarch64|armv[6-8]|arm64)', machine_id.strip())
3131
if m:
3232
arch = m.group(1)
3333
if arch == 'aarch64':
3434
arch = 'armv8'
3535
return arch
36-
return ('x64' if sys.maxsize > 2**32 else 'x86')
36+
return 'x64' if sys.maxsize > 2**32 else 'x86'
3737

3838

3939
def current_platform():

builder/imports/golang.py

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
'windows-x64': 'https://go.dev/dl/go1.21.5.windows-amd64.zip',
2020
'windows-x86': 'https://go.dev/dl/go1.21.5.windows-386.zip',
2121
'macos-x64': 'https://go.dev/dl/go1.21.5.darwin-amd64.tar.gz',
22+
'macos-armv8': 'https://go.dev/dl/go1.21.5.darwin-arm64.tar.gz',
2223
}
2324

2425

builder/imports/jdk.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
'windows-x64': 'https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u242-b08/OpenJDK8U-jdk_x64_windows_hotspot_8u242b08.zip',
2020
'windows-x86': 'https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u242-b08/OpenJDK8U-jdk_x86-32_windows_hotspot_8u242b08.zip',
2121
'macos-x64': 'https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u242-b08/OpenJDK8U-jdk_x64_mac_hotspot_8u242b08.tar.gz',
22+
'macos-armv8': 'https://corretto.aws/downloads/resources/8.422.05.1/amazon-corretto-8.422.05.1-macosx-aarch64.tar.gz',
2223
}
2324

2425

@@ -95,7 +96,7 @@ def install(self, env):
9596
fetch_and_extract(url, filename, install_dir)
9697
os.remove(filename)
9798

98-
jdk_home = glob.glob(os.path.join(install_dir, 'jdk*'))[0]
99+
jdk_home = glob.glob(os.path.join(install_dir, '*jdk*'))[0]
99100
assert jdk_home
100101

101102
# OSX is special and has a Contents/Home folder inside the distro

0 commit comments

Comments
 (0)