Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix arm64 for MacOS #289

Merged
merged 6 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading