wasi:cli/run
This commit is contained in:
@@ -25,7 +25,8 @@ main = shakeArgs shakeOptions $ do
|
||||
[wit] [wat] "-o" [out]
|
||||
phony "run" $ do
|
||||
need ["hello.component.wasm"]
|
||||
cmd_ "wasmtime run --invoke hello() hello.component.wasm"
|
||||
-- cmd_ "wasmtime run --invoke hello() hello.component.wasm"
|
||||
cmd_ "wasmtime run hello.component.wasm"
|
||||
phony "clean" $ do
|
||||
removeFilesAfter ".shake" ["//*"]
|
||||
liftIO $ removeFiles "." ["*.wasm"]
|
||||
|
||||
@@ -14,9 +14,10 @@
|
||||
|
||||
(data (i32.const 16) "hello worms\n")
|
||||
|
||||
(func $hello (export "hello")
|
||||
(func (export "wasi:cli/run@0.2.6#run") (result i32)
|
||||
(call $print
|
||||
(call $get-stdout)
|
||||
(i32.const 16) ;; offset to print
|
||||
(i32.const 12) ;; length to print
|
||||
(i32.const 32)))) ;; offset for result
|
||||
(i32.const 32)) ;; offset for result
|
||||
(i32.const 0)))
|
||||
|
||||
@@ -5,8 +5,7 @@ world root {
|
||||
import wasi:cli/stdout@0.2.6;
|
||||
import wasi:io/streams@0.2.6;
|
||||
|
||||
// export wasi:cli/run@0.2.0;
|
||||
export hello: func();
|
||||
export wasi:cli/run@0.2.6;
|
||||
}
|
||||
|
||||
package wasi:cli@0.2.6 {
|
||||
@@ -17,14 +16,11 @@ package wasi:cli@0.2.6 {
|
||||
}
|
||||
interface stdin {
|
||||
}
|
||||
interface run {
|
||||
run: func () -> result;
|
||||
}
|
||||
}
|
||||
|
||||
// package wasi:cli@0.2.0 {
|
||||
// interface run {
|
||||
// run: func() -> result;
|
||||
// }
|
||||
// }
|
||||
|
||||
package wasi:io@0.2.6 {
|
||||
interface poll {
|
||||
resource pollable {
|
||||
|
||||
Reference in New Issue
Block a user