Skip to content

Commit

Permalink
Fix arm64 for MacOS (#289)
Browse files Browse the repository at this point in the history
  • Loading branch information
waahm7 authored Jul 17, 2024
1 parent dcdd2f8 commit 5fe4cae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions builder/core/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ def current_os():


def current_arch():
if current_os() == 'linux':
if current_os() == 'linux' or current_os() == 'macos':
machine_id = os.uname()[4]
m = re.match(r'^(aarch64|armv[6-8])', machine_id.strip())
m = re.match(r'^(aarch64|armv[6-8]|arm64)', machine_id.strip())
if m:
arch = m.group(1)
if arch == 'aarch64':
arch = 'armv8'
return arch
return ('x64' if sys.maxsize > 2**32 else 'x86')
return 'x64' if sys.maxsize > 2**32 else 'x86'


def current_platform():
Expand Down
1 change: 1 addition & 0 deletions builder/imports/golang.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
'windows-x64': 'https://go.dev/dl/go1.21.5.windows-amd64.zip',
'windows-x86': 'https://go.dev/dl/go1.21.5.windows-386.zip',
'macos-x64': 'https://go.dev/dl/go1.21.5.darwin-amd64.tar.gz',
'macos-armv8': 'https://go.dev/dl/go1.21.5.darwin-arm64.tar.gz',
}


Expand Down
3 changes: 2 additions & 1 deletion builder/imports/jdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
'windows-x64': 'https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u242-b08/OpenJDK8U-jdk_x64_windows_hotspot_8u242b08.zip',
'windows-x86': 'https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u242-b08/OpenJDK8U-jdk_x86-32_windows_hotspot_8u242b08.zip',
'macos-x64': 'https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u242-b08/OpenJDK8U-jdk_x64_mac_hotspot_8u242b08.tar.gz',
'macos-armv8': 'https://corretto.aws/downloads/resources/8.422.05.1/amazon-corretto-8.422.05.1-macosx-aarch64.tar.gz',
}


Expand Down Expand Up @@ -95,7 +96,7 @@ def install(self, env):
fetch_and_extract(url, filename, install_dir)
os.remove(filename)

jdk_home = glob.glob(os.path.join(install_dir, 'jdk*'))[0]
jdk_home = glob.glob(os.path.join(install_dir, '*jdk*'))[0]
assert jdk_home

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

0 comments on commit 5fe4cae

Please sign in to comment.