diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00f8b3b..5c5d461 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,8 +49,8 @@ jobs: - name: Build everything run: | - LD_LIBRARY_PATH=/usr/local/lib lake build + DYLD_LIBRARY_PATH=/usr/local/lib LD_LIBRARY_PATH=/usr/local/lib lake build - name: Run the test run: | - LD_LIBRARY_PATH=/usr/local/lib lake exe test + DYLD_LIBRARY_PATH=/usr/local/lib LD_LIBRARY_PATH=/usr/local/lib lake exe test diff --git a/Test.lean b/Test.lean index 2c83b35..dbc23ff 100644 --- a/Test.lean +++ b/Test.lean @@ -42,13 +42,15 @@ namespace proc --/ Get name of process using /proc/self/status def test : IO Unit := do - let m := - Manifest.new #[Wasm.file "wasm/extproc.wasm"] - |> Manifest.allowPath "/proc" "/proc" - let plugin <- Plugin.new m #[] True - let res: Json Status <- Plugin.call plugin "status" "" - assert! res.val.name == "test" - IO.println s!"Name: {res.val.name}" + let ex <- System.FilePath.pathExists "/proc" + if ex then + let m := + Manifest.new #[Wasm.file "wasm/extproc.wasm"] + |> Manifest.allowPath "/proc" "/proc" + let plugin <- Plugin.new m #[] True + let res: Json Status <- Plugin.call plugin "status" "" + assert! res.val.name == "test" + IO.println s!"Name: {res.val.name}" end proc structure VowelCount where diff --git a/lakefile.lean b/lakefile.lean index 6fa097b..10cdbbc 100644 --- a/lakefile.lean +++ b/lakefile.lean @@ -32,7 +32,7 @@ lean_exe test { target bindings.o pkg : FilePath := do let oFile := pkg.buildDir / "c" / "bindings.o" - let srcJob ← inputFile <| pkg.dir / "c" / "bindings.c" + let srcJob ← inputTextFile <| pkg.dir / "c" / "bindings.c" let weakArgs := #["-I", (← getLeanIncludeDir).toString, "-I", extismIncludePath ()] buildO oFile srcJob weakArgs #["-fPIC", "--std=c11"] "cc" getLeanTrace