Skip to content

Commit

Permalink
fix: macos ci, Lake.inputFile -> Lake.inputTextFile (#2)
Browse files Browse the repository at this point in the history
* fix: macos ci, Lake.inputFile -> Lake.inputTextFile

* fix: typo

* fix: only run proc test when /proc is available
  • Loading branch information
zshipko authored Jun 19, 2024
1 parent 4f8c307 commit 9d3d5b1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 9 additions & 7 deletions Test.lean
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lakefile.lean
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 9d3d5b1

Please sign in to comment.