changed: linux actions to be `ubuntu-20.04`and fixed windows linking bug
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Thu, 4 Jan 2024 16:13:44 +0000 (10:13 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Thu, 4 Jan 2024 16:13:44 +0000 (10:13 -0600)
.github/workflows/onyx-build.yml
runtime/src/ort_directories.h

index 91d8e0a4d504c5b2cd8a5f5e92ed15f3af096a50..3c7caf05bd71d1857a3759c047f585d9af9639f1 100644 (file)
@@ -16,7 +16,7 @@ on:
 jobs:
   setup:
     name: Set up
-    runs-on: ubuntu-latest
+    runs-on: ubuntu-20.04
     outputs:
       VERSION: ${{ steps.setup.outputs.VERSION }}
       DOING_RELEASE: ${{ steps.setup.outputs.DOING_RELEASE }}
@@ -41,15 +41,15 @@ jobs:
       matrix:
         include:
           - build: linux-amd64
-            os: ubuntu-latest
+            os: ubuntu-20.04
             runtime_library: ovmwasm
             artifact_name: 'onyx-linux-ovm-amd64'
           - build: linux-amd64
-            os: ubuntu-latest
+            os: ubuntu-20.04
             runtime_library: wasmer
             artifact_name: 'onyx-linux-wasmer-amd64'
           - build: linux-amd64
-            os: ubuntu-latest
+            os: ubuntu-20.04
             runtime_library: none
             artifact_name: 'onyx-linux-none-amd64' 
           - build: darwin-arm64
index 80c0f2617327521dd2ac06152625ae95534945a0..7974715bf0c5b3ba3581145ed74de4113577b49b 100644 (file)
@@ -181,17 +181,13 @@ ONYX_DEF(__dir_cwd, (WASM_I32, WASM_I32), (WASM_I32)) {
 #endif
 
 #if defined(_BH_WINDOWS)
-    // The GetCurrentDirectory symbol is causing a linker error.
-    // For a hotfix, I am leaving these unimplemented for now,
-    // but they should be fixed asap.
-    //
-    // int length = GetCurrentDirectory(params->data[1].of.i32, ONYX_PTR(params->data[0].of.i32));
-    // if (length == 0 || length > params->data[1].of.i32) {
-    //     results->data[0] = WASM_I32_VAL(-1);
-    //     return NULL;
-    // }
-
-    results->data[0] = WASM_I32_VAL(-1);
+    int length = GetCurrentDirectory(params->data[1].of.i32, ONYX_PTR(params->data[0].of.i32));
+    if (length == 0 || length > params->data[1].of.i32) {
+        results->data[0] = WASM_I32_VAL(-1);
+        return NULL;
+    }
+
+    results->data[0] = WASM_I32_VAL(length);
     return NULL;
 #endif
 }
@@ -204,12 +200,8 @@ ONYX_DEF(__dir_chdir, (WASM_I32), (WASM_I32)) {
 #endif
 
 #if defined(_BH_WINDOWS)
-    // The SetCurrentDirectory symbol is causing a linker error.
-    // For a hotfix, I am leaving these unimplemented for now,
-    // but they should be fixed asap.
-    //
-    // int result = SetCurrentDirectory(ONYX_PTR(params->data[0].of.i32));
-    results->data[0] = WASM_I32_VAL(0);
+    int result = SetCurrentDirectory(ONYX_PTR(params->data[0].of.i32));
+    results->data[0] = WASM_I32_VAL(result ? 1 : 0);
     return NULL;
 #endif
 }