From c8a3b3cdc7479b407486f673cf8420a7b1708c7b Mon Sep 17 00:00:00 2001 From: Yordan Atanasov Date: Sun, 9 Jun 2024 21:31:45 +0300 Subject: [PATCH] fix: use "uname -m" when retrieving os arch in Native.java. Change win32 to windows. --- .github/workflows/build_publish.yaml | 2 +- src/java/org/wasmer/Native.java | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_publish.yaml b/.github/workflows/build_publish.yaml index 9d28222..d67e1d5 100644 --- a/.github/workflows/build_publish.yaml +++ b/.github/workflows/build_publish.yaml @@ -33,7 +33,7 @@ jobs: - os: 'windows-latest' target: 'x86_64-pc-windows-msvc' - artifact: 'win32-amd64' + artifact: 'windows-amd64' lib_name: 'wasmer_jni.dll' uses: ./.github/workflows/dynamic_libs_reusable.yaml with: diff --git a/src/java/org/wasmer/Native.java b/src/java/org/wasmer/Native.java index 9969073..fbc4956 100644 --- a/src/java/org/wasmer/Native.java +++ b/src/java/org/wasmer/Native.java @@ -28,13 +28,11 @@ public static String getCurrentPlatformIdentifier() { osName = "windows"; } else if (osName.contains("mac os x")) { osName = "darwin"; - String[] args = new String[] {"/bin/bash", "-c", "uname", "-p"}; + String[] args = new String[] {"/bin/bash", "-c", "uname -m"}; try { Process proc = new ProcessBuilder(args).start(); BufferedReader reader = new BufferedReader(new InputStreamReader(proc.getInputStream())); - if (reader.readLine().equals("Darwin")) { - return osName + "-arm64"; - } + return osName + "-" + reader.readLine(); } catch (IOException e) { throw new RuntimeException(e); }