From 92d1c689c337c3f4e5087de865faa7868a2f0e77 Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Khan Date: Wed, 17 Jul 2024 11:51:03 -0700 Subject: [PATCH 1/6] fix arm64 --- builder/core/host.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builder/core/host.py b/builder/core/host.py index 196fe4ed3..14aa5286b 100644 --- a/builder/core/host.py +++ b/builder/core/host.py @@ -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(): From 722221618c724b2cff622fd69571bcdb16666374 Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Khan Date: Wed, 17 Jul 2024 12:09:18 -0700 Subject: [PATCH 2/6] try arm64 binaries --- builder/imports/jdk.py | 1 + 1 file changed, 1 insertion(+) diff --git a/builder/imports/jdk.py b/builder/imports/jdk.py index f82f6ca16..9282e789d 100644 --- a/builder/imports/jdk.py +++ b/builder/imports/jdk.py @@ -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-arm64': 'https://corretto.aws/downloads/resources/8.422.05.1/amazon-corretto-8.422.05.1-macosx-aarch64.tar.gz', } From aaf2f70d2482a4b0e49d9b8177e6cd8171292a22 Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Khan Date: Wed, 17 Jul 2024 12:15:04 -0700 Subject: [PATCH 3/6] fix name --- builder/imports/jdk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/imports/jdk.py b/builder/imports/jdk.py index 9282e789d..c640b19ef 100644 --- a/builder/imports/jdk.py +++ b/builder/imports/jdk.py @@ -19,7 +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-arm64': 'https://corretto.aws/downloads/resources/8.422.05.1/amazon-corretto-8.422.05.1-macosx-aarch64.tar.gz', + 'macos-armv8': 'https://corretto.aws/downloads/resources/8.422.05.1/amazon-corretto-8.422.05.1-macosx-aarch64.tar.gz', } From 09149ba06be5528f7461693c9792d442b29c17ad Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Khan Date: Wed, 17 Jul 2024 12:26:04 -0700 Subject: [PATCH 4/6] fix path --- builder/imports/jdk.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/builder/imports/jdk.py b/builder/imports/jdk.py index c640b19ef..791f08ba0 100644 --- a/builder/imports/jdk.py +++ b/builder/imports/jdk.py @@ -56,20 +56,20 @@ def install(self, env): 'lib/**/jvm.dll', '**/lib/**/jvm.dll'], ] found = 0 - - for paths in required_files: - path_found = False - for path in paths: - for prefix in prefixes: - if not prefix: - continue - full_path = os.path.join(prefix, path) - if glob.glob(full_path, recursive=True): - found += 1 - path_found = True - break - if path_found: - break + # + # for paths in required_files: + # path_found = False + # for path in paths: + # for prefix in prefixes: + # if not prefix: + # continue + # full_path = os.path.join(prefix, path) + # if glob.glob(full_path, recursive=True): + # found += 1 + # path_found = True + # break + # if path_found: + # break if found >= len(required_files): print('Found existing JDK8 at {}'.format(prefix)) @@ -95,8 +95,8 @@ def install(self, env): print('Downloading {}'.format(url)) fetch_and_extract(url, filename, install_dir) os.remove(filename) - - jdk_home = glob.glob(os.path.join(install_dir, 'jdk*'))[0] + print(glob.glob(os.path.join(install_dir, 'jdk*'))) + 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 From 4cf0673126cbfacb5e5b052d7b4df4e05af5f576 Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Khan Date: Wed, 17 Jul 2024 13:01:11 -0700 Subject: [PATCH 5/6] golang --- builder/imports/golang.py | 1 + builder/imports/jdk.py | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/builder/imports/golang.py b/builder/imports/golang.py index b4c3f36e0..99fff8cf4 100644 --- a/builder/imports/golang.py +++ b/builder/imports/golang.py @@ -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', } diff --git a/builder/imports/jdk.py b/builder/imports/jdk.py index 791f08ba0..aaebc1f56 100644 --- a/builder/imports/jdk.py +++ b/builder/imports/jdk.py @@ -56,20 +56,20 @@ def install(self, env): 'lib/**/jvm.dll', '**/lib/**/jvm.dll'], ] found = 0 - # - # for paths in required_files: - # path_found = False - # for path in paths: - # for prefix in prefixes: - # if not prefix: - # continue - # full_path = os.path.join(prefix, path) - # if glob.glob(full_path, recursive=True): - # found += 1 - # path_found = True - # break - # if path_found: - # break + + for paths in required_files: + path_found = False + for path in paths: + for prefix in prefixes: + if not prefix: + continue + full_path = os.path.join(prefix, path) + if glob.glob(full_path, recursive=True): + found += 1 + path_found = True + break + if path_found: + break if found >= len(required_files): print('Found existing JDK8 at {}'.format(prefix)) @@ -95,7 +95,7 @@ def install(self, env): print('Downloading {}'.format(url)) fetch_and_extract(url, filename, install_dir) os.remove(filename) - print(glob.glob(os.path.join(install_dir, 'jdk*'))) + jdk_home = glob.glob(os.path.join(install_dir, '*jdk*'))[0] assert jdk_home From 370fee80edf26511792cbc4f2f29f413adea0b5c Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Khan Date: Wed, 17 Jul 2024 13:05:10 -0700 Subject: [PATCH 6/6] fix spaces --- builder/core/host.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/core/host.py b/builder/core/host.py index 14aa5286b..41d3a9aca 100644 --- a/builder/core/host.py +++ b/builder/core/host.py @@ -33,7 +33,7 @@ def current_arch(): 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():