Skip to content

Commit

Permalink
fix: use "uname -m" when retrieving os arch in Native.java. Change wi…
Browse files Browse the repository at this point in the history
…n32 to windows.
  • Loading branch information
Zurcusa committed Jun 9, 2024
1 parent 01fb7d7 commit c8a3b3c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 2 additions & 4 deletions src/java/org/wasmer/Native.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit c8a3b3c

Please sign in to comment.