diff --git a/wasmtime-wasi-custom/Cargo.lock b/wasmtime-wasi-custom/Cargo.lock new file mode 100644 index 0000000..a6c88cd --- /dev/null +++ b/wasmtime-wasi-custom/Cargo.lock @@ -0,0 +1,1455 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "aho-corasick" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ansi_term" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "arrayref" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "arrayvec" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "atty" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "autocfg" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "backtrace" +version = "0.3.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "backtrace-sys 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "backtrace-sys" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "base64" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "bincode" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "bitflags" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "blake2b_simd" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "arrayvec 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "block-buffer" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "block-padding 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "block-padding" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "byte-tools" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "byteorder" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "cc" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rayon 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cfg-if" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "clap" +version = "2.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cloudabi" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "constant_time_eq" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "cranelift-bforest" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cranelift-entity 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cranelift-codegen" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cranelift-bforest 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-codegen-meta 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-entity 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", + "target-lexicon 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cranelift-codegen-meta" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cranelift-entity 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cranelift-entity" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cranelift-frontend" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cranelift-codegen 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "target-lexicon 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cranelift-native" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cranelift-codegen 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", + "raw-cpuid 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "target-lexicon 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cranelift-wasm" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cranelift-codegen 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-entity 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-frontend 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmparser 0.37.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-deque" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-epoch 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayvec 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-queue" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-utils" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "directories" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "dirs-sys" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_users 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "either" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "env_logger" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "errno" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "errno-dragonfly 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "faerie" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "goblin 0.0.23 (registry+https://github.com/rust-lang/crates.io-index)", + "indexmap 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "scroll 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", + "string-interner 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "structopt 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", + "structopt-derive 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", + "target-lexicon 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "failure" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "backtrace 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)", + "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "failure_derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", + "synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "gcc" +version = "0.3.55" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "generic-array" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "gimli" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayvec 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "fallible-iterator 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "indexmap 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "glob" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "goblin" +version = "0.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "plain 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "scroll 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "heck" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-segmentation 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "humantime" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "id-arena" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "indexmap" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "itoa" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "lazy_static" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "leb128" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libc" +version = "0.2.62" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "log" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mach" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "memchr" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "memoffset" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "nix" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "nodrop" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "num_cpus" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "proc-macro2" +version = "0.4.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "proc-macro2" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "quick-error" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "quote" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "quote" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_jitter 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_chacha" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rand_hc" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_isaac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_jitter" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_os" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_pcg" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_xorshift" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "raw-cpuid" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rayon" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-deque 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "either 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon-core 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rayon-core" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-deque 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "redox_syscall" +version = "0.1.56" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "redox_users" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "rust-argon2 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)", + "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex-syntax" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "region" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "mach 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rust-argon2" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "blake2b_simd 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ryu" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "scopeguard" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "scroll" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "scroll_derive 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "scroll_derive" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "serde" +version = "1.0.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde_derive 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_derive" +version = "1.0.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_json" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "ryu 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "sha2" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "spin" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "stable_deref_trait" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "string-interner" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "strsim" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "structopt" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", + "structopt-derive 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "structopt-derive" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "syn" +version = "0.15.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "syn" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "synstructure" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "target-lexicon" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "termcolor" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "wincolor 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "thread_local" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "toml" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "typenum" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unicode-segmentation" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unicode-width" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unicode-xid" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unicode-xid" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "vec_map" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "walrus" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "id-arena 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "leb128 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "walrus-macro 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmparser 0.35.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "walrus-macro" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasi-common" +version = "0.1.0" +source = "git+https://github.com/CraneStation/wasi-common?rev=8ea7a983d8b1364e5f62d2adf0e74b3b8db1c9b3#8ea7a983d8b1364e5f62d2adf0e74b3b8db1c9b3" +dependencies = [ + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "nix 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "wasi-common-cbindgen 0.1.0 (git+https://github.com/CraneStation/wasi-common?rev=8ea7a983d8b1364e5f62d2adf0e74b3b8db1c9b3)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "winx 0.1.0 (git+https://github.com/CraneStation/wasi-common?rev=8ea7a983d8b1364e5f62d2adf0e74b3b8db1c9b3)", +] + +[[package]] +name = "wasi-common-cbindgen" +version = "0.1.0" +source = "git+https://github.com/CraneStation/wasi-common?rev=8ea7a983d8b1364e5f62d2adf0e74b3b8db1c9b3#8ea7a983d8b1364e5f62d2adf0e74b3b8db1c9b3" +dependencies = [ + "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-webidl-bindings" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "id-arena 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "leb128 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "walrus 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasmparser" +version = "0.35.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "wasmparser" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "wasmparser" +version = "0.37.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "wasmtime-api" +version = "0.1.0" +source = "git+https://github.com/CraneStation/wasmtime?rev=9c747db4293192dffe659ed741070716caeb43b0#9c747db4293192dffe659ed741070716caeb43b0" +dependencies = [ + "cranelift-codegen 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-entity 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-frontend 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-native 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-wasm 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "region 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "target-lexicon 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmparser 0.36.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmtime-environ 0.2.0 (git+https://github.com/CraneStation/wasmtime?rev=9c747db4293192dffe659ed741070716caeb43b0)", + "wasmtime-jit 0.2.0 (git+https://github.com/CraneStation/wasmtime?rev=9c747db4293192dffe659ed741070716caeb43b0)", + "wasmtime-runtime 0.2.0 (git+https://github.com/CraneStation/wasmtime?rev=9c747db4293192dffe659ed741070716caeb43b0)", +] + +[[package]] +name = "wasmtime-debug" +version = "0.2.0" +source = "git+https://github.com/CraneStation/wasmtime?rev=9c747db4293192dffe659ed741070716caeb43b0#9c747db4293192dffe659ed741070716caeb43b0" +dependencies = [ + "cranelift-codegen 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-entity 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-wasm 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", + "faerie 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "gimli 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", + "target-lexicon 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmparser 0.36.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmtime-environ 0.2.0 (git+https://github.com/CraneStation/wasmtime?rev=9c747db4293192dffe659ed741070716caeb43b0)", +] + +[[package]] +name = "wasmtime-environ" +version = "0.2.0" +source = "git+https://github.com/CraneStation/wasmtime?rev=9c747db4293192dffe659ed741070716caeb43b0#9c747db4293192dffe659ed741070716caeb43b0" +dependencies = [ + "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bincode 1.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-codegen 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-entity 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-wasm 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", + "directories 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "indexmap 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", + "sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spin 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "zstd 0.4.28+zstd.1.4.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasmtime-interface-types" +version = "0.2.0" +source = "git+https://github.com/CraneStation/wasmtime?rev=9c747db4293192dffe659ed741070716caeb43b0#9c747db4293192dffe659ed741070716caeb43b0" +dependencies = [ + "cranelift-codegen 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "walrus 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-webidl-bindings 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmparser 0.36.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmtime-jit 0.2.0 (git+https://github.com/CraneStation/wasmtime?rev=9c747db4293192dffe659ed741070716caeb43b0)", + "wasmtime-runtime 0.2.0 (git+https://github.com/CraneStation/wasmtime?rev=9c747db4293192dffe659ed741070716caeb43b0)", +] + +[[package]] +name = "wasmtime-jit" +version = "0.2.0" +source = "git+https://github.com/CraneStation/wasmtime?rev=9c747db4293192dffe659ed741070716caeb43b0#9c747db4293192dffe659ed741070716caeb43b0" +dependencies = [ + "cranelift-codegen 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-entity 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-frontend 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-wasm 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "region 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "target-lexicon 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmparser 0.36.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmtime-debug 0.2.0 (git+https://github.com/CraneStation/wasmtime?rev=9c747db4293192dffe659ed741070716caeb43b0)", + "wasmtime-environ 0.2.0 (git+https://github.com/CraneStation/wasmtime?rev=9c747db4293192dffe659ed741070716caeb43b0)", + "wasmtime-runtime 0.2.0 (git+https://github.com/CraneStation/wasmtime?rev=9c747db4293192dffe659ed741070716caeb43b0)", +] + +[[package]] +name = "wasmtime-runtime" +version = "0.2.0" +source = "git+https://github.com/CraneStation/wasmtime?rev=9c747db4293192dffe659ed741070716caeb43b0#9c747db4293192dffe659ed741070716caeb43b0" +dependencies = [ + "cc 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-codegen 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-entity 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-wasm 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", + "errno 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "indexmap 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "region 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmtime-environ 0.2.0 (git+https://github.com/CraneStation/wasmtime?rev=9c747db4293192dffe659ed741070716caeb43b0)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasmtime-wasi" +version = "0.2.0" +dependencies = [ + "cranelift-codegen 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-entity 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-wasm 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "target-lexicon 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasi-common 0.1.0 (git+https://github.com/CraneStation/wasi-common?rev=8ea7a983d8b1364e5f62d2adf0e74b3b8db1c9b3)", + "wasmtime-environ 0.2.0 (git+https://github.com/CraneStation/wasmtime?rev=9c747db4293192dffe659ed741070716caeb43b0)", + "wasmtime-jit 0.2.0 (git+https://github.com/CraneStation/wasmtime?rev=9c747db4293192dffe659ed741070716caeb43b0)", + "wasmtime-runtime 0.2.0 (git+https://github.com/CraneStation/wasmtime?rev=9c747db4293192dffe659ed741070716caeb43b0)", +] + +[[package]] +name = "wasmtime-wasi-custom" +version = "0.1.0" +dependencies = [ + "env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmtime-api 0.1.0 (git+https://github.com/CraneStation/wasmtime?rev=9c747db4293192dffe659ed741070716caeb43b0)", + "wasmtime-interface-types 0.2.0 (git+https://github.com/CraneStation/wasmtime?rev=9c747db4293192dffe659ed741070716caeb43b0)", + "wasmtime-jit 0.2.0 (git+https://github.com/CraneStation/wasmtime?rev=9c747db4293192dffe659ed741070716caeb43b0)", + "wasmtime-wasi 0.2.0", +] + +[[package]] +name = "winapi" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "wincolor" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winx" +version = "0.1.0" +source = "git+https://github.com/CraneStation/wasi-common?rev=8ea7a983d8b1364e5f62d2adf0e74b3b8db1c9b3#8ea7a983d8b1364e5f62d2adf0e74b3b8db1c9b3" +dependencies = [ + "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "zstd" +version = "0.4.28+zstd.1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "zstd-safe 1.4.13+zstd.1.4.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "zstd-safe" +version = "1.4.13+zstd.1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "zstd-sys 1.4.13+zstd.1.4.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "zstd-sys" +version = "1.4.13+zstd.1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", + "glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[metadata] +"checksum aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d" +"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" +"checksum arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0d382e583f07208808f6b1249e60848879ba3543f57c32277bf52d69c2f0f0ee" +"checksum arrayvec 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)" = "b8d73f9beda665eaa98ab9e4f7442bd4e7de6652587de55b2525e52e29c1b0ba" +"checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90" +"checksum autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b671c8fb71b457dd4ae18c4ba1e59aa81793daacc361d82fcd410cef0d491875" +"checksum backtrace 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)" = "1371048253fa3bac6704bfd6bbfc922ee9bdcee8881330d40f308b81cc5adc55" +"checksum backtrace-sys 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)" = "82a830b4ef2d1124a711c71d263c5abdc710ef8e907bd508c88be475cebc422b" +"checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" +"checksum bincode 1.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9f04a5e50dc80b3d5d35320889053637d15011aed5e66b66b37ae798c65da6f7" +"checksum bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d155346769a6855b86399e9bc3814ab343cd3d62c7e985113d46a0ec3c281fd" +"checksum blake2b_simd 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)" = "bf775a81bb2d464e20ff170ac20316c7b08a43d11dbc72f0f82e8e8d3d6d0499" +"checksum block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +"checksum block-padding 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6d4dc3af3ee2e12f3e5d224e5e1e3d73668abbeb69e566d361f7d5563a4fdf09" +"checksum byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" +"checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" +"checksum cc 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)" = "b548a4ee81fccb95919d4e22cfea83c7693ebfd78f0495493178db20b3139da7" +"checksum cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b486ce3ccf7ffd79fdeb678eac06a9e6c09fc88d33836340becb8fffe87c5e33" +"checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" +"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +"checksum constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "995a44c877f9212528ccc74b21a232f66ad69001e40ede5bcee2ac9ef2657120" +"checksum cranelift-bforest 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e16561b2532d78df920c45325596a6c13b968a0a04df5f0163d0c77297ee948f" +"checksum cranelift-codegen 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)" = "33414e9e37d7193e69b097525270e05a3bc22d47ed17709ed680172e1b6e1062" +"checksum cranelift-codegen-meta 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aff9bf980d698d95c8d0857311d3ca39c8e5c66b76681a1a3a7b4b1573eb1337" +"checksum cranelift-entity 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)" = "82e33aa1185550dd8c23742860736f358d26118bb9cc80c1268060ac1eabe65b" +"checksum cranelift-frontend 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2dc0446d572b1c451e8f6d3b963c199e4301482633e3fd8364d8a5119e8dacd1" +"checksum cranelift-native 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ecd5dd23073540c892f9afeedef6e1a2965dd077c622c31a98f5a191c7df9217" +"checksum cranelift-wasm 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dd919571c26ef0157f34235de26e338b16150bb052a16ed52ab5d69bff1619bc" +"checksum crossbeam-deque 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "05e44b8cf3e1a625844d1750e1f7820da46044ff6d28f4d43e455ba3e5bb2c13" +"checksum crossbeam-epoch 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fedcd6772e37f3da2a9af9bf12ebe046c0dfe657992377b4df982a2b54cd37a9" +"checksum crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c979cd6cfe72335896575c6b5688da489e420d36a27a0b9eb0c73db574b4a4b" +"checksum crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" +"checksum digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +"checksum directories 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "551a778172a450d7fc12e629ca3b0428d00f6afa9a43da1b630d54604e97371c" +"checksum dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "afa0b23de8fd801745c471deffa6e12d248f962c9fd4b4c33787b055599bde7b" +"checksum either 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5527cfe0d098f36e3f8839852688e63c8fff1c90b2b405aef730615f9a7bcf7b" +"checksum env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3" +"checksum errno 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "c2a071601ed01b988f896ab14b95e67335d1eeb50190932a1320f7fe3cadc84e" +"checksum errno-dragonfly 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "14ca354e36190500e1e1fb267c647932382b54053c50b14970856c0b00a35067" +"checksum faerie 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6cb48b9db9869b6209c63d5cc2fd99f0b85d1a407cb09fe8ed730c21ab945e3d" +"checksum failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "795bd83d3abeb9220f257e597aa0080a508b27533824adf336529648f6abf7e2" +"checksum failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ea1063915fd7ef4309e222a5a07cf9c319fb9c7836b1f89b85458672dbb127e1" +"checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" +"checksum fallible-iterator 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" +"checksum gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)" = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" +"checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" +"checksum gimli 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "162d18ae5f2e3b90a993d202f1ba17a5633c2484426f8bcae201f86194bacd00" +"checksum glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" +"checksum goblin 0.0.23 (registry+https://github.com/rust-lang/crates.io-index)" = "ac56b4753b6b8c2e052ca30717e5a09acf1b02a2c1681bf3d883bd660e5d22bd" +"checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" +"checksum humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ca7e5f2e110db35f93b837c81797f3714500b81d517bf20c431b16d3ca4f114" +"checksum id-arena 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" +"checksum indexmap 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a4d6d89e0948bf10c08b9ecc8ac5b83f07f857ebe2c0cbe38de15b4e4f510356" +"checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" +"checksum lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc5729f27f159ddd61f4df6228e827e86643d4d3e7c32183cb30a1c08f604a14" +"checksum leb128 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3576a87f2ba00f6f106fdfcd16db1d698d648a26ad8e0573cad8537c3c362d2a" +"checksum libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)" = "34fcd2c08d2f832f376f4173a231990fa5aef4e99fb569867318a227ef4c06ba" +"checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" +"checksum mach 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "86dd2487cdfea56def77b88438a2c915fb45113c5319bfe7e14306ca4cd0b0e1" +"checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" +"checksum memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ce6075db033bbbb7ee5a0bbd3a3186bbae616f57fb001c485c7ff77955f8177f" +"checksum nix 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4dbdc256eaac2e3bd236d93ad999d3479ef775c863dbda3068c4006a92eec51b" +"checksum nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9667ddcc6cc8a43afc9b7917599d7216aa09c463919ea32c59ed6cac8bc945" +"checksum num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bcef43580c035376c0705c42792c294b66974abbfd2789b511784023f71f3273" +"checksum opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" +"checksum plain 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" +"checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" +"checksum proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4c5c2380ae88876faae57698be9e9775e3544decad214599c3a6266cca6ac802" +"checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" +"checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" +"checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" +"checksum rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" +"checksum rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" +"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +"checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" +"checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" +"checksum rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" +"checksum rand_jitter 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" +"checksum rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" +"checksum rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" +"checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" +"checksum raw-cpuid 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "30a9d219c32c9132f7be513c18be77c9881c7107d2ab5569d205a6a0f0e6dc7d" +"checksum rayon 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a4b0186e22767d5b9738a05eab7c6ac90b15db17e5b5f9bd87976dd7d89a10a4" +"checksum rayon-core 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ebbe0df8435ac0c397d467b6cad6d25543d06e8a019ef3f6af3c384597515bd2" +"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +"checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" +"checksum redox_users 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ecedbca3bf205f8d8f5c2b44d83cd0690e39ee84b951ed649e9f1841132b66d" +"checksum regex 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88c3d9193984285d544df4a30c23a4e62ead42edf70a4452ceb76dac1ce05c26" +"checksum regex-syntax 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)" = "b143cceb2ca5e56d5671988ef8b15615733e7ee16cd348e064333b251b89343f" +"checksum region 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "448e868c6e4cfddfa49b6a72c95906c04e8547465e9536575b95c70a4044f856" +"checksum rust-argon2 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ca4eaef519b494d1f2848fc602d18816fed808a981aedf4f1f00ceb7c9d32cf" +"checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" +"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +"checksum ryu 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c92464b447c0ee8c4fb3824ecc8383b81717b9f1e74ba2e72540aef7b9f82997" +"checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d" +"checksum scroll 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2f84d114ef17fd144153d608fba7c446b0145d038985e7a8cc5d08bb0ce20383" +"checksum scroll_derive 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)" = "8f1aa96c45e7f5a91cb7fabe7b279f02fea7126239fc40b732316e8b6a2d0fcb" +"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +"checksum serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)" = "fec2851eb56d010dc9a21b89ca53ee75e6528bab60c11e89d38390904982da9f" +"checksum serde_derive 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)" = "cb4dc18c61206b08dc98216c98faa0232f4337e1e1b8574551d5bad29ea1b425" +"checksum serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)" = "051c49229f282f7c6f3813f8286cc1e3323e8051823fce42c7ea80fe13521704" +"checksum sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b4d8bfd0e469f417657573d8451fb33d16cfe0989359b93baf3a1ffc639543d" +"checksum spin 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbdb51a221842709c2dd65b62ad4b78289fc3e706a02c17a26104528b6aa7837" +"checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" +"checksum string-interner 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "abb38a0d8fe673c40b10b6b75abcb076a958cc10fb894f14993d9737c4c87000" +"checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" +"checksum structopt 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "16c2cdbf9cc375f15d1b4141bc48aeef444806655cd0e904207edc8d68d86ed7" +"checksum structopt-derive 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "53010261a84b37689f9ed7d395165029f9cc7abb9f56bbfe86bee2597ed25107" +"checksum syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)" = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" +"checksum syn 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "158521e6f544e7e3dcfc370ac180794aa38cb34a1b1e07609376d4adcf429b93" +"checksum synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "02353edf96d6e4dc81aea2d8490a7e9db177bf8acb0e951c24940bf866cb313f" +"checksum target-lexicon 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1b0ab4982b8945c35cc1c46a83a9094c414f6828a099ce5dcaa8ee2b04642dcb" +"checksum termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "96d6098003bde162e4277c70665bd87c326f5a0c3f3fbfb285787fa482d54e6e" +"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" +"checksum toml 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c7aabe75941d914b72bf3e5d3932ed92ce0664d49d8432305a8b547c37227724" +"checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169" +"checksum unicode-segmentation 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1967f4cdfc355b37fd76d2a954fb2ed3871034eb4f26d60537d88795cfc332a9" +"checksum unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7007dbd421b92cc6e28410fe7362e2e0a2503394908f417b68ec8d1c364c4e20" +"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" +"checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" +"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" +"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" +"checksum walrus 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "99f3e05d9adaea81cd2083c4143476ceaf3648438093c105a232452955fa37b1" +"checksum walrus-macro 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "32bfb06777c179ac05ec89edd39514be9312d5c103f97b720bbdf71c9e007251" +"checksum wasi-common 0.1.0 (git+https://github.com/CraneStation/wasi-common?rev=8ea7a983d8b1364e5f62d2adf0e74b3b8db1c9b3)" = "" +"checksum wasi-common-cbindgen 0.1.0 (git+https://github.com/CraneStation/wasi-common?rev=8ea7a983d8b1364e5f62d2adf0e74b3b8db1c9b3)" = "" +"checksum wasm-webidl-bindings 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6e1e3e412b494e782a6e3e2f94084532a47a13eaafb6296b29cbba2ea9a4e43c" +"checksum wasmparser 0.35.3 (registry+https://github.com/rust-lang/crates.io-index)" = "099aaf77635ffad3d9ab57253c29b16a46e93755c3e54cfe33fb8cf4b54f760b" +"checksum wasmparser 0.36.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8a014c25b9ddb665ad952d4260413931948a0b279b3504307870a5b73051526c" +"checksum wasmparser 0.37.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f7387ba67c13dd9cd01d7d961e733375aee889f828564e190da85b5602eb5eeb" +"checksum wasmtime-api 0.1.0 (git+https://github.com/CraneStation/wasmtime?rev=9c747db4293192dffe659ed741070716caeb43b0)" = "" +"checksum wasmtime-debug 0.2.0 (git+https://github.com/CraneStation/wasmtime?rev=9c747db4293192dffe659ed741070716caeb43b0)" = "" +"checksum wasmtime-environ 0.2.0 (git+https://github.com/CraneStation/wasmtime?rev=9c747db4293192dffe659ed741070716caeb43b0)" = "" +"checksum wasmtime-interface-types 0.2.0 (git+https://github.com/CraneStation/wasmtime?rev=9c747db4293192dffe659ed741070716caeb43b0)" = "" +"checksum wasmtime-jit 0.2.0 (git+https://github.com/CraneStation/wasmtime?rev=9c747db4293192dffe659ed741070716caeb43b0)" = "" +"checksum wasmtime-runtime 0.2.0 (git+https://github.com/CraneStation/wasmtime?rev=9c747db4293192dffe659ed741070716caeb43b0)" = "" +"checksum winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "f10e386af2b13e47c89e7236a7a14a086791a2b88ebad6df9bf42040195cf770" +"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +"checksum winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7168bab6e1daee33b4557efd0e95d5ca70a03706d39fa5f3fe7a236f584b03c9" +"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +"checksum wincolor 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "96f5016b18804d24db43cebf3c77269e7569b8954a8464501c216cc5e070eaa9" +"checksum winx 0.1.0 (git+https://github.com/CraneStation/wasi-common?rev=8ea7a983d8b1364e5f62d2adf0e74b3b8db1c9b3)" = "" +"checksum zstd 0.4.28+zstd.1.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f4e716acaad66f2daf2526f37a1321674a8814c0b37a366ebe6c97a699f85ddc" +"checksum zstd-safe 1.4.13+zstd.1.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bfe4d3b26a0790201848865663e8ffabf091e126e548bc9710ccfa95621ece48" +"checksum zstd-sys 1.4.13+zstd.1.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fadc8ebe858f056ab82dffb9d93850b841603bdf663db7cf5e3dbd7f34cc55b2" diff --git a/wasmtime-wasi-custom/Cargo.toml b/wasmtime-wasi-custom/Cargo.toml new file mode 100644 index 0000000..8f0f00f --- /dev/null +++ b/wasmtime-wasi-custom/Cargo.toml @@ -0,0 +1,28 @@ +[package] +name = "wasmtime-wasi-custom" +version = "0.1.0" +authors = ["Stefan Junker "] +edition = "2018" +build = "build.rs" + +[dependencies] +wasmtime-api = { git = "https://github.com/CraneStation/wasmtime", package = "wasmtime-api", rev = "9c747db4293192dffe659ed741070716caeb43b0" } +wasmtime-jit = { git = "https://github.com/CraneStation/wasmtime", package = "wasmtime-jit", rev = "9c747db4293192dffe659ed741070716caeb43b0" } +wasmtime-interface-types = { git = "https://github.com/CraneStation/wasmtime", package = "wasmtime-interface-types", rev = "9c747db4293192dffe659ed741070716caeb43b0" } + +# wasmtime-api = { path = "/home/steveej/src/job-redhat/enarx/github_cranestation_wasmtime/wasmtime-api" } +# wasmtime-jit = { path = "/home/steveej/src/job-redhat/enarx/github_cranestation_wasmtime/wasmtime-jit" } +# wasmtime-interface-types = { path = "/home/steveej/src/job-redhat/enarx/github_cranestation_wasmtime/wasmtime-interface-types" } + +# A copy of wasmtime-wasi at v0.3.0 made for customisation purposes +wasmtime-wasi = { path = "wasmtime-wasi" } +# wasmtime-wasi = { path = "/home/steveej/src/job-redhat/enarx/github_cranestation_wasmtime/wasmtime-wasi" } + +log = "0.4" +env_logger = "0.6" + +[features] +default = ["rust"] + +c = [] +rust = [] diff --git a/wasmtime-wasi-custom/README.md b/wasmtime-wasi-custom/README.md new file mode 100644 index 0000000..2fc21e1 --- /dev/null +++ b/wasmtime-wasi-custom/README.md @@ -0,0 +1,27 @@ +# Wasmtime Custom WASI Demo +This is an example crate demonstrating how Enarx may use Wasmtime, a Rust-powered JIT, to natively run programs from several different source languages (Rust/C/C++) compiled to WASI-compliant WASM. + +## Running the demo + +By default, the Rust demo should run with `cargo run` out of the box. + +If you wish to compile the C demo, you'll need to install `lld` . On Fedora, this can be accomplished with `sudo dnf install lld`. + +### Switching Languages + +The WASM binary used for the demo can be compiled from either Rust or C. Compilation of this binary happens at build time, and the source language can be controlled via Cargo features. + +Rust is compiled by default. If C is desired, the appropriate feature can be invoked via the `cargo` command: + +``` +cargo run --no-default-features --features c +``` + +Or, alternatively, by changing the `default` feature in `Cargo.toml` from `["rust"]` to `["c"]`. + +## Changelog +This demo is expected to evolve over time. + +### v0.1.0 +Customizes `fd_write` so that all writes to fd=2 (stdin) are redirected to fd=1 (stdout). +Uses an in-tree copy of `wasmtime-wasi` with customizations to the glue code. diff --git a/wasmtime-wasi-custom/build.rs b/wasmtime-wasi-custom/build.rs new file mode 100644 index 0000000..1d20e8a --- /dev/null +++ b/wasmtime-wasi-custom/build.rs @@ -0,0 +1,35 @@ +use std::process::Command; + +fn main() { + let out = std::env::var("OUT_DIR").unwrap(); + + if cfg!(feature = "c") { + println!("Compiling C app to WASM..."); + let cc = std::env::var("CC").unwrap_or("clang".to_owned()); + assert!(Command::new(cc) + .args(&["-o", &format!("{}/app.wasm", out)]) + .arg("--target=wasm32-unknown-wasi") + .arg("-Wl,--export-all") + .arg("-Wl,--no-entry") + .arg("-nostdlib") + .arg("-O3") + .arg("src/app.c") + .status() + .expect("failed to compile WASM module") + .success()); + } + + if cfg!(feature = "rust") { + println!("Compiling Rust app to WASM..."); + assert!(Command::new("rustc") + // .args(&["-C", "lto"]) + // .args(&["-C", "opt-level=3"]) + // .args(&["--target", "wasm32-unknown-unknown"]) + .args(&["--target", "wasm32-wasi"]) + .args(&["-o", &format!("{}/app.wasm", out)]) + .arg("src/app.rs") + .status() + .expect("failed to compile WASM module") + .success()); + } +} diff --git a/wasmtime-wasi-custom/src/app.c b/wasmtime-wasi-custom/src/app.c new file mode 100644 index 0000000..857265d --- /dev/null +++ b/wasmtime-wasi-custom/src/app.c @@ -0,0 +1,3 @@ +int add(int l, int r) { + return l + r; +} \ No newline at end of file diff --git a/wasmtime-wasi-custom/src/app.rs b/wasmtime-wasi-custom/src/app.rs new file mode 100644 index 0000000..565009d --- /dev/null +++ b/wasmtime-wasi-custom/src/app.rs @@ -0,0 +1,7 @@ +fn main() {} + +#[no_mangle] +pub extern fn hello_world() { + println!("Hello, world!"); + eprintln!("Hello, stderr!"); +} \ No newline at end of file diff --git a/wasmtime-wasi-custom/src/main.rs b/wasmtime-wasi-custom/src/main.rs new file mode 100644 index 0000000..a6df738 --- /dev/null +++ b/wasmtime-wasi-custom/src/main.rs @@ -0,0 +1,93 @@ +use log::{info, trace}; +use std::collections::HashMap; +use std::error::Error; +use std::fs::read; +use wasmtime_api::{self, HostRef}; + +fn main() -> Result<(), Box> { + let _ = env_logger::try_init_from_env(env_logger::Env::default()); + + // Before we begin, it'll be heplful to know which source language we're + // running, so let's print it out. + if cfg!(feature = "c") { + info!("WASM application binary has been compiled from C."); + } + if cfg!(feature = "rust") { + info!("WASM appliation binary has been compiled from Rust."); + } + + // Load and instnatiate the WASM app + info!("Loading WASM application binary..."); + let app_wasm = read(concat!(env!("OUT_DIR"), "/app.wasm")).unwrap(); + info!("WASM application binary loaded."); + + // wasmtime-api variables + let engine = HostRef::new(wasmtime_api::Engine::default()); + let store = HostRef::new(wasmtime_api::Store::new(engine)); + let mut module_registry: HashMap)> = + HashMap::new(); + + // Instantiate WASI + let custom_wasi = wasmtime_wasi::instantiate_wasi( + // prefix: &str, + "", + // global_exports: Rc>>>, + store.borrow().global_exports().clone(), + // preopened_dirs: &[(String, File)], + Default::default(), + // argv: &[String], + Default::default(), + // environ: &[(String, String)], + Default::default(), + ) + .expect("could nt instantiate WASI"); + module_registry.insert( + "wasi_unstable".to_string(), + wasmtime_api::Instance::from_handle(store.clone(), custom_wasi)?, + ); + + let app_module = HostRef::new(wasmtime_api::Module::new(store.clone(), &app_wasm)?); + + // Resolve import using module_registry. + let imports = { + // let module_borrow: std::cell::Ref<'_, wasmtime_api::Module> = app_module.borrow(); + + app_module + .borrow() + .imports() + .iter() + .map(|i| { + let module_name = i.module().to_string(); + if let Some((instance, map)) = module_registry.get(&module_name) { + let field_name = i.name().to_string(); + if let Some(export_index) = map.get(&field_name) { + trace!("found export: {}/{}", field_name, module_name); + Ok(instance.exports()[*export_index].clone()) + } else { + Err(format!( + "Import {} was not found in module {}", + field_name, module_name + )) + } + } else { + Err(format!("Import module {} was not found", module_name)) + } + }) + .collect::, _>>()? + }; + + let instance = HostRef::new(wasmtime_api::Instance::new( + store.clone(), + app_module.clone(), + &imports, + )?); + + let mut handle = instance.borrow().handle().clone(); + let mut context = store.borrow().engine().borrow().create_wasmtime_context(); + let module_data = wasmtime_interface_types::ModuleData::new(&app_wasm)?; + + // Invoke the function + module_data.invoke(&mut context, &mut handle, "hello_world", Default::default())?; + + Ok(()) +} diff --git a/wasmtime-wasi-custom/wasmtime-wasi/Cargo.toml b/wasmtime-wasi-custom/wasmtime-wasi/Cargo.toml new file mode 100644 index 0000000..b52d2e8 --- /dev/null +++ b/wasmtime-wasi-custom/wasmtime-wasi/Cargo.toml @@ -0,0 +1,28 @@ +[package] +name = "wasmtime-wasi" +version = "0.2.0" +authors = ["The Cranelift Project Developers"] +description = "WASI API support for Wasmtime" +categories = ["wasm"] +repository = "https://github.com/CraneStation/wasmtime" +license = "Apache-2.0 WITH LLVM-exception" +readme = "README.md" +edition = "2018" + +[dependencies] +# wasmtime-runtime = { path = "../wasmtime-runtime" } +wasmtime-runtime = { git = "https://github.com/CraneStation/wasmtime", package = "wasmtime-runtime", rev = "9c747db4293192dffe659ed741070716caeb43b0" } +# wasmtime-environ = { path = "../wasmtime-environ" } +wasmtime-environ = { git = "https://github.com/CraneStation/wasmtime", package = "wasmtime-environ", rev = "9c747db4293192dffe659ed741070716caeb43b0" } +# wasmtime-jit = { path = "../wasmtime-jit" } +wasmtime-jit = { git = "https://github.com/CraneStation/wasmtime", package = "wasmtime-jit", rev = "9c747db4293192dffe659ed741070716caeb43b0" } +wasi-common = { git = "https://github.com/CraneStation/wasi-common", rev = "8ea7a983d8b1364e5f62d2adf0e74b3b8db1c9b3" } +cranelift-codegen = { version = "0.41.0", features = ["enable-serde"] } +cranelift-entity = { version = "0.41.0", features = ["enable-serde"] } +cranelift-wasm = { version = "0.41.0", features = ["enable-serde"] } +target-lexicon = "0.4.0" +log = { version = "0.4.8", default-features = false } + +[badges] +maintenance = { status = "experimental" } +travis-ci = { repository = "CraneStation/wasmtime" } diff --git a/wasmtime-wasi-custom/wasmtime-wasi/LICENSE b/wasmtime-wasi-custom/wasmtime-wasi/LICENSE new file mode 100644 index 0000000..f9d8195 --- /dev/null +++ b/wasmtime-wasi-custom/wasmtime-wasi/LICENSE @@ -0,0 +1,220 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +--- LLVM Exceptions to the Apache 2.0 License ---- + +As an exception, if, as a result of your compiling your source code, portions +of this Software are embedded into an Object form of such source code, you +may redistribute such embedded portions in such Object form without complying +with the conditions of Sections 4(a), 4(b) and 4(d) of the License. + +In addition, if you combine or link compiled forms of this Software with +software that is licensed under the GPLv2 ("Combined Software") and if a +court of competent jurisdiction determines that the patent provision (Section +3), the indemnity provision (Section 9) or other Section of the License +conflicts with the conditions of the GPLv2, you may retroactively and +prospectively choose to deem waived or otherwise exclude such Section(s) of +the License, but only in their entirety and only with respect to the Combined +Software. + diff --git a/wasmtime-wasi-custom/wasmtime-wasi/README.md b/wasmtime-wasi-custom/wasmtime-wasi/README.md new file mode 100644 index 0000000..7f2eaad --- /dev/null +++ b/wasmtime-wasi-custom/wasmtime-wasi/README.md @@ -0,0 +1,8 @@ +This is the `wasmtime-wasi` crate, which implements the +WebAssembly System Interface (WASI) API in Rust. + +WASI is greatly inspired by and directly derived from [CloudABI]. +It differs in that it has aspirations to expand to a greater +scope, and to better support the needs of WebAssembly engines. + +[CloudABI]: https://cloudabi.org/ diff --git a/wasmtime-wasi-custom/wasmtime-wasi/js-polyfill/README.md b/wasmtime-wasi-custom/wasmtime-wasi/js-polyfill/README.md new file mode 100644 index 0000000..f54b42a --- /dev/null +++ b/wasmtime-wasi-custom/wasmtime-wasi/js-polyfill/README.md @@ -0,0 +1,2 @@ +For the current polyfill sources, please checkout this same directory in +[the polyfill branch](https://github.com/CraneStation/wasmtime/tree/polyfill/). diff --git a/wasmtime-wasi-custom/wasmtime-wasi/js-polyfill/WASI-small.png b/wasmtime-wasi-custom/wasmtime-wasi/js-polyfill/WASI-small.png new file mode 100644 index 0000000..ef55a0b Binary files /dev/null and b/wasmtime-wasi-custom/wasmtime-wasi/js-polyfill/WASI-small.png differ diff --git a/wasmtime-wasi-custom/wasmtime-wasi/src/instantiate.rs b/wasmtime-wasi-custom/wasmtime-wasi/src/instantiate.rs new file mode 100644 index 0000000..0b83681 --- /dev/null +++ b/wasmtime-wasi-custom/wasmtime-wasi/src/instantiate.rs @@ -0,0 +1,138 @@ +use super::syscalls; +use cranelift_codegen::ir::types; +use cranelift_codegen::{ir, isa}; +use cranelift_entity::PrimaryMap; +use cranelift_wasm::DefinedFuncIndex; +use std::cell::RefCell; +use std::collections::HashMap; +use std::fs::File; +use std::rc::Rc; +use target_lexicon::HOST; +use wasi_common::WasiCtxBuilder; +use wasmtime_environ::{translate_signature, Export, Module}; +use wasmtime_runtime::{Imports, InstanceHandle, InstantiationError, VMFunctionBody}; + +/// Return an instance implementing the "wasi" interface. +pub fn instantiate_wasi( + prefix: &str, + global_exports: Rc>>>, + preopened_dirs: &[(String, File)], + argv: &[String], + environ: &[(String, String)], +) -> Result { + let pointer_type = types::Type::triple_pointer_type(&HOST); + let mut module = Module::new(); + let mut finished_functions: PrimaryMap = + PrimaryMap::new(); + let call_conv = isa::CallConv::triple_default(&HOST); + + macro_rules! signature { + ($name:ident) => {{ + let sig = module.signatures.push(translate_signature( + ir::Signature { + params: syscalls::$name::params() + .into_iter() + .map(ir::AbiParam::new) + .collect(), + returns: syscalls::$name::results() + .into_iter() + .map(ir::AbiParam::new) + .collect(), + call_conv, + }, + pointer_type, + )); + let func = module.functions.push(sig); + module.exports.insert( + prefix.to_owned() + stringify!($name), + Export::Function(func), + ); + finished_functions.push(syscalls::$name::SHIM as *const VMFunctionBody); + }}; + } + + signature!(args_get); + signature!(args_sizes_get); + signature!(clock_res_get); + signature!(clock_time_get); + signature!(environ_get); + signature!(environ_sizes_get); + signature!(fd_prestat_get); + signature!(fd_prestat_dir_name); + signature!(fd_close); + signature!(fd_datasync); + signature!(fd_pread); + signature!(fd_pwrite); + signature!(fd_read); + signature!(fd_renumber); + signature!(fd_seek); + signature!(fd_tell); + signature!(fd_fdstat_get); + signature!(fd_fdstat_set_flags); + signature!(fd_fdstat_set_rights); + signature!(fd_sync); + signature!(fd_write); + signature!(fd_advise); + signature!(fd_allocate); + signature!(path_create_directory); + signature!(path_link); + signature!(path_open); + signature!(fd_readdir); + signature!(path_readlink); + signature!(path_rename); + signature!(fd_filestat_get); + signature!(fd_filestat_set_times); + signature!(fd_filestat_set_size); + signature!(path_filestat_get); + signature!(path_filestat_set_times); + signature!(path_symlink); + signature!(path_unlink_file); + signature!(path_remove_directory); + signature!(poll_oneoff); + signature!(proc_exit); + signature!(proc_raise); + signature!(random_get); + signature!(sched_yield); + signature!(sock_recv); + signature!(sock_send); + signature!(sock_shutdown); + + let imports = Imports::none(); + let data_initializers = Vec::new(); + let signatures = PrimaryMap::new(); + + let mut wasi_ctx_builder = WasiCtxBuilder::new() + .and_then(|ctx| ctx.inherit_stdio()) + .and_then(|ctx| ctx.args(argv.iter())) + .and_then(|ctx| ctx.envs(environ.iter())) + .map_err(|err| { + InstantiationError::Resource(format!("couldn't assemble WASI context object: {}", err)) + })?; + + for (dir, f) in preopened_dirs { + wasi_ctx_builder = wasi_ctx_builder.preopened_dir( + f.try_clone().map_err(|err| { + InstantiationError::Resource(format!( + "couldn't clone an instance handle to pre-opened dir: {}", + err + )) + })?, + dir, + ); + } + + let wasi_ctx = wasi_ctx_builder.build().map_err(|err| { + InstantiationError::Resource(format!("couldn't assemble WASI context object: {}", err)) + })?; + + InstanceHandle::new( + Rc::new(module), + global_exports, + finished_functions.into_boxed_slice(), + imports, + &data_initializers, + signatures.into_boxed_slice(), + None, + Box::new(wasi_ctx), + ) +} diff --git a/wasmtime-wasi-custom/wasmtime-wasi/src/lib.rs b/wasmtime-wasi-custom/wasmtime-wasi/src/lib.rs new file mode 100644 index 0000000..8b34268 --- /dev/null +++ b/wasmtime-wasi-custom/wasmtime-wasi/src/lib.rs @@ -0,0 +1,4 @@ +mod instantiate; +mod syscalls; + +pub use instantiate::instantiate_wasi; diff --git a/wasmtime-wasi-custom/wasmtime-wasi/src/syscalls.rs b/wasmtime-wasi-custom/wasmtime-wasi/src/syscalls.rs new file mode 100644 index 0000000..cd3c309 --- /dev/null +++ b/wasmtime-wasi-custom/wasmtime-wasi/src/syscalls.rs @@ -0,0 +1,984 @@ +use cranelift_codegen::ir::types::{Type, I32, I64}; +use log::{debug, trace}; +use wasi_common::{hostcalls, wasm32, WasiCtx}; +use wasmtime_runtime::{Export, VMContext}; + +pub trait AbiRet { + type Abi; + fn convert(self) -> Self::Abi; + fn codegen_tys() -> Vec; +} + +pub trait AbiParam { + type Abi; + fn convert(arg: Self::Abi) -> Self; + fn codegen_ty() -> Type; +} + +macro_rules! cast32 { + ($($i:ident)*) => ($( + impl AbiRet for $i { + type Abi = i32; + + fn convert(self) -> Self::Abi { + self as i32 + } + + fn codegen_tys() -> Vec { vec![I32] } + } + + impl AbiParam for $i { + type Abi = i32; + + fn convert(param: i32) -> Self { + param as $i + } + + fn codegen_ty() -> Type { I32 } + } + )*) +} + +macro_rules! cast64 { + ($($i:ident)*) => ($( + impl AbiRet for $i { + type Abi = i64; + + fn convert(self) -> Self::Abi { + self as i64 + } + + fn codegen_tys() -> Vec { vec![I64] } + } + + impl AbiParam for $i { + type Abi = i64; + + fn convert(param: i64) -> Self { + param as $i + } + + fn codegen_ty() -> Type { I64 } + } + )*) +} + +cast32!(i8 i16 i32 u8 u16 u32); +cast64!(i64 u64); + +impl AbiRet for () { + type Abi = (); + fn convert(self) {} + fn codegen_tys() -> Vec { + Vec::new() + } +} + +fn get_wasi_ctx(vmctx: &mut VMContext) -> Result<&mut WasiCtx, wasm32::__wasi_errno_t> { + unsafe { + vmctx.host_state().downcast_mut::().ok_or_else(|| { + println!("!!! no host state named WasiCtx available"); + wasm32::__WASI_EINVAL + }) + } +} + +fn get_memory(vmctx: &mut VMContext) -> Result<&mut [u8], wasm32::__wasi_errno_t> { + unsafe { + match vmctx.lookup_global_export("memory") { + Some(Export::Memory { + definition, + vmctx: _, + memory: _, + }) => Ok(std::slice::from_raw_parts_mut( + (*definition).base, + (*definition).current_length, + )), + x => { + println!( + "!!! no export named \"memory\", or the export isn't a mem: {:?}", + x + ); + Err(wasm32::__WASI_EINVAL) + } + } + } +} + +macro_rules! ok_or_errno { + ($expr:expr) => { + match $expr { + Ok(v) => v, + Err(e) => { + trace!(" -> errno={}", wasm32::strerror(e)); + return e; + } + } + }; +} + +macro_rules! syscalls { + ($(pub unsafe extern "C" fn $name:ident($ctx:ident: *mut VMContext $(, $arg:ident: $ty:ty)*,) -> $ret:ty { + $($body:tt)* + })*) => ($( + pub mod $name { + use super::*; + + /// Returns the codegen types of all the parameters to the shim + /// generated + pub fn params() -> Vec { + vec![$(<$ty as AbiParam>::codegen_ty()),*] + } + + /// Returns the codegen types of all the results of the shim + /// generated + pub fn results() -> Vec { + <$ret as AbiRet>::codegen_tys() + } + + /// The actual function pointer to the shim for a syscall. + /// + /// NB: ideally we'd expose `shim` below, but it seems like there's + /// a compiler bug which prvents that from being cast to a `usize`. + pub static SHIM: unsafe extern "C" fn( + *mut VMContext, + $(<$ty as AbiParam>::Abi),* + ) -> <$ret as AbiRet>::Abi = shim; + + unsafe extern "C" fn shim( + $ctx: *mut VMContext, + $($arg: <$ty as AbiParam>::Abi,)* + ) -> <$ret as AbiRet>::Abi { + let r = super::$name($ctx, $(<$ty as AbiParam>::convert($arg),)*); + <$ret as AbiRet>::convert(r) + } + } + + pub unsafe extern "C" fn $name($ctx: *mut VMContext, $($arg: $ty,)*) -> $ret { + $($body)* + } + )*) +} + +syscalls! { + pub unsafe extern "C" fn args_get( + vmctx: *mut VMContext, + argv: wasm32::uintptr_t, + argv_buf: wasm32::uintptr_t, + ) -> wasm32::__wasi_errno_t { + trace!( + "args_get(argv={:#x?}, argv_buf={:#x?})", + argv, + argv_buf, + ); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + let memory = ok_or_errno!(get_memory(&mut *vmctx)); + hostcalls::args_get(wasi_ctx, memory, argv, argv_buf) + } + + pub unsafe extern "C" fn args_sizes_get( + vmctx: *mut VMContext, + argc: wasm32::uintptr_t, + argv_buf_size: wasm32::uintptr_t, + ) -> wasm32::__wasi_errno_t { + trace!( + "args_sizes_get(argc={:#x?}, argv_buf_size={:#x?})", + argc, + argv_buf_size, + ); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + let memory = ok_or_errno!(get_memory(&mut *vmctx)); + hostcalls::args_sizes_get(wasi_ctx, memory, argc, argv_buf_size) + } + + pub unsafe extern "C" fn clock_res_get( + vmctx: *mut VMContext, + clock_id: wasm32::__wasi_clockid_t, + resolution: wasm32::uintptr_t, + ) -> wasm32::__wasi_errno_t { + trace!( + "clock_res_get(clock_id={:?}, resolution={:#x?})", + clock_id, + resolution, + ); + let memory = ok_or_errno!(get_memory(&mut *vmctx)); + hostcalls::clock_res_get(memory, clock_id, resolution) + } + + pub unsafe extern "C" fn clock_time_get( + vmctx: *mut VMContext, + clock_id: wasm32::__wasi_clockid_t, + precision: wasm32::__wasi_timestamp_t, + time: wasm32::uintptr_t, + ) -> wasm32::__wasi_errno_t { + trace!( + "clock_time_get(clock_id={:?}, precision={:?}, time={:#x?})", + clock_id, + precision, + time, + ); + let memory = ok_or_errno!(get_memory(&mut *vmctx)); + hostcalls::clock_time_get(memory, clock_id, precision, time) + } + + pub unsafe extern "C" fn environ_get( + vmctx: *mut VMContext, + environ: wasm32::uintptr_t, + environ_buf: wasm32::uintptr_t, + ) -> wasm32::__wasi_errno_t { + trace!( + "environ_get(environ={:#x?}, environ_buf={:#x?})", + environ, + environ_buf, + ); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + let memory = ok_or_errno!(get_memory(&mut *vmctx)); + hostcalls::environ_get(wasi_ctx, memory, environ, environ_buf) + } + + pub unsafe extern "C" fn environ_sizes_get( + vmctx: *mut VMContext, + environ_count: wasm32::uintptr_t, + environ_buf_size: wasm32::uintptr_t, + ) -> wasm32::__wasi_errno_t { + trace!( + "environ_sizes_get(environ_count={:#x?}, environ_buf_size={:#x?})", + environ_count, + environ_buf_size, + ); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + let memory = ok_or_errno!(get_memory(&mut *vmctx)); + hostcalls::environ_sizes_get(wasi_ctx, memory, environ_count, environ_buf_size) + } + + pub unsafe extern "C" fn fd_prestat_get( + vmctx: *mut VMContext, + fd: wasm32::__wasi_fd_t, + buf: wasm32::uintptr_t, + ) -> wasm32::__wasi_errno_t { + trace!("fd_prestat_get(fd={:?}, buf={:#x?})", fd, buf); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + let memory = ok_or_errno!(get_memory(&mut *vmctx)); + hostcalls::fd_prestat_get(wasi_ctx, memory, fd, buf) + } + + pub unsafe extern "C" fn fd_prestat_dir_name( + vmctx: *mut VMContext, + fd: wasm32::__wasi_fd_t, + path: wasm32::uintptr_t, + path_len: wasm32::size_t, + ) -> wasm32::__wasi_errno_t { + trace!("fd_prestat_dir_name(fd={:?}, path={:#x?}, path_len={})", fd, path, path_len); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + let memory = ok_or_errno!(get_memory(&mut *vmctx)); + hostcalls::fd_prestat_dir_name(wasi_ctx, memory, fd, path, path_len) + } + + pub unsafe extern "C" fn fd_close( + vmctx: *mut VMContext, + fd: wasm32::__wasi_fd_t, + ) -> wasm32::__wasi_errno_t { + trace!("fd_close(fd={:?})", fd); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + hostcalls::fd_close(wasi_ctx, fd) + } + + pub unsafe extern "C" fn fd_datasync( + vmctx: *mut VMContext, + fd: wasm32::__wasi_fd_t, + ) -> wasm32::__wasi_errno_t { + trace!("fd_datasync(fd={:?})", fd); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + hostcalls::fd_datasync(wasi_ctx, fd) + } + + pub unsafe extern "C" fn fd_pread( + vmctx: *mut VMContext, + fd: wasm32::__wasi_fd_t, + iovs: wasm32::uintptr_t, + iovs_len: wasm32::size_t, + offset: wasm32::__wasi_filesize_t, + nread: wasm32::uintptr_t, + ) -> wasm32::__wasi_errno_t { + trace!( + "fd_pread(fd={:?}, iovs={:#x?}, iovs_len={:?}, offset={}, nread={:#x?})", + fd, + iovs, + iovs_len, + offset, + nread + ); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + let memory = ok_or_errno!(get_memory(&mut *vmctx)); + hostcalls::fd_pread( + wasi_ctx, + memory, + fd, + iovs, + iovs_len, + offset, + nread + ) + } + + pub unsafe extern "C" fn fd_pwrite( + vmctx: *mut VMContext, + fd: wasm32::__wasi_fd_t, + iovs: wasm32::uintptr_t, + iovs_len: wasm32::size_t, + offset: wasm32::__wasi_filesize_t, + nwritten: wasm32::uintptr_t, + ) -> wasm32::__wasi_errno_t { + trace!( + "fd_pwrite(fd={:?}, iovs={:#x?}, iovs_len={:?}, offset={}, nwritten={:#x?})", + fd, + iovs, + iovs_len, + offset, + nwritten + ); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + let memory = ok_or_errno!(get_memory(&mut *vmctx)); + hostcalls::fd_pwrite( + wasi_ctx, + memory, + fd, + iovs, + iovs_len, + offset, + nwritten + ) + } + + pub unsafe extern "C" fn fd_read( + vmctx: *mut VMContext, + fd: wasm32::__wasi_fd_t, + iovs: wasm32::uintptr_t, + iovs_len: wasm32::size_t, + nread: wasm32::uintptr_t, + ) -> wasm32::__wasi_errno_t { + trace!( + "fd_read(fd={:?}, iovs={:#x?}, iovs_len={:?}, nread={:#x?})", + fd, + iovs, + iovs_len, + nread + ); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + let memory = ok_or_errno!(get_memory(&mut *vmctx)); + hostcalls::fd_read(wasi_ctx, memory, fd, iovs, iovs_len, nread) + } + + pub unsafe extern "C" fn fd_renumber( + vmctx: *mut VMContext, + from: wasm32::__wasi_fd_t, + to: wasm32::__wasi_fd_t, + ) -> wasm32::__wasi_errno_t { + trace!("fd_renumber(from={:?}, to={:?})", from, to); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + hostcalls::fd_renumber(wasi_ctx, from, to) + } + + pub unsafe extern "C" fn fd_seek( + vmctx: *mut VMContext, + fd: wasm32::__wasi_fd_t, + offset: wasm32::__wasi_filedelta_t, + whence: wasm32::__wasi_whence_t, + newoffset: wasm32::uintptr_t, + ) -> wasm32::__wasi_errno_t { + trace!( + "fd_seek(fd={:?}, offset={:?}, whence={}, newoffset={:#x?})", + fd, + offset, + wasm32::whence_to_str(whence), + newoffset + ); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + let memory = ok_or_errno!(get_memory(&mut *vmctx)); + hostcalls::fd_seek(wasi_ctx, memory, fd, offset, whence, newoffset) + } + + pub unsafe extern "C" fn fd_tell( + vmctx: *mut VMContext, + fd: wasm32::__wasi_fd_t, + newoffset: wasm32::uintptr_t, + ) -> wasm32::__wasi_errno_t { + trace!("fd_tell(fd={:?}, newoffset={:#x?})", fd, newoffset); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + let memory = ok_or_errno!(get_memory(&mut *vmctx)); + hostcalls::fd_tell(wasi_ctx, memory, fd, newoffset) + } + + pub unsafe extern "C" fn fd_fdstat_get( + vmctx: *mut VMContext, + fd: wasm32::__wasi_fd_t, + buf: wasm32::uintptr_t, + ) -> wasm32::__wasi_errno_t { + trace!("fd_fdstat_get(fd={:?}, buf={:#x?})", fd, buf); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + let memory = ok_or_errno!(get_memory(&mut *vmctx)); + hostcalls::fd_fdstat_get(wasi_ctx, memory, fd, buf) + } + + pub unsafe extern "C" fn fd_fdstat_set_flags( + vmctx: *mut VMContext, + fd: wasm32::__wasi_fd_t, + flags: wasm32::__wasi_fdflags_t, + ) -> wasm32::__wasi_errno_t { + trace!( + "fd_fdstat_set_flags(fd={:?}, flags={:#x?})", + fd, + flags + ); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + hostcalls::fd_fdstat_set_flags(wasi_ctx, fd, flags) + } + + pub unsafe extern "C" fn fd_fdstat_set_rights( + vmctx: *mut VMContext, + fd: wasm32::__wasi_fd_t, + fs_rights_base: wasm32::__wasi_rights_t, + fs_rights_inheriting: wasm32::__wasi_rights_t, + ) -> wasm32::__wasi_errno_t { + trace!( + "fd_fdstat_set_rights(fd={:?}, fs_rights_base={:#x?}, fs_rights_inheriting={:#x?})", + fd, + fs_rights_base, + fs_rights_inheriting + ); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + hostcalls::fd_fdstat_set_rights( + wasi_ctx, + fd, + fs_rights_base, + fs_rights_inheriting + ) + } + + pub unsafe extern "C" fn fd_sync( + vmctx: *mut VMContext, + fd: wasm32::__wasi_fd_t, + ) -> wasm32::__wasi_errno_t { + trace!("fd_sync(fd={:?})", fd); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + hostcalls::fd_sync(wasi_ctx, fd) + } + + pub unsafe extern "C" fn fd_write( + vmctx: *mut VMContext, + fd: wasm32::__wasi_fd_t, + iovs: wasm32::uintptr_t, + iovs_len: wasm32::size_t, + nwritten: wasm32::uintptr_t, + ) -> wasm32::__wasi_errno_t { + trace!( + "fd_write(fd={:?}, iovs={:#x?}, iovs_len={:?}, nwritten={:#x?})", + fd, + iovs, + iovs_len, + nwritten + ); + + let fd = if fd == 2 { + debug!("redirecting stderr to stdout"); + 1 + } else { + fd + }; + + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + let memory = ok_or_errno!(get_memory(&mut *vmctx)); + hostcalls::fd_write(wasi_ctx, memory, fd, iovs, iovs_len, nwritten) + } + + pub unsafe extern "C" fn fd_advise( + vmctx: *mut VMContext, + fd: wasm32::__wasi_fd_t, + offset: wasm32::__wasi_filesize_t, + len: wasm32::__wasi_filesize_t, + advice: wasm32::__wasi_advice_t, + ) -> wasm32::__wasi_errno_t { + trace!( + "fd_advise(fd={:?}, offset={}, len={}, advice={:?})", + fd, + offset, + len, + advice + ); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + hostcalls::fd_advise(wasi_ctx, fd, offset, len, advice) + } + + pub unsafe extern "C" fn fd_allocate( + vmctx: *mut VMContext, + fd: wasm32::__wasi_fd_t, + offset: wasm32::__wasi_filesize_t, + len: wasm32::__wasi_filesize_t, + ) -> wasm32::__wasi_errno_t { + trace!("fd_allocate(fd={:?}, offset={}, len={})", fd, offset, len); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + hostcalls::fd_allocate(wasi_ctx, fd, offset, len) + } + + pub unsafe extern "C" fn path_create_directory( + vmctx: *mut VMContext, + fd: wasm32::__wasi_fd_t, + path: wasm32::uintptr_t, + path_len: wasm32::size_t, + ) -> wasm32::__wasi_errno_t { + trace!( + "path_create_directory(fd={:?}, path={:#x?}, path_len={})", + fd, + path, + path_len, + ); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + let memory = ok_or_errno!(get_memory(&mut *vmctx)); + hostcalls::path_create_directory(wasi_ctx, memory, fd, path, path_len) + } + + pub unsafe extern "C" fn path_link( + vmctx: *mut VMContext, + fd0: wasm32::__wasi_fd_t, + flags0: wasm32::__wasi_lookupflags_t, + path0: wasm32::uintptr_t, + path_len0: wasm32::size_t, + fd1: wasm32::__wasi_fd_t, + path1: wasm32::uintptr_t, + path_len1: wasm32::size_t, + ) -> wasm32::__wasi_errno_t { + trace!( + "path_link(fd0={:?}, flags0={:?}, path0={:#x?}, path_len0={}, fd1={:?}, path1={:#x?}, path_len1={})", + fd0, + flags0, + path0, + path_len0, + fd1, + path1, + path_len1 + ); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + let memory = ok_or_errno!(get_memory(&mut *vmctx)); + hostcalls::path_link( + wasi_ctx, + memory, + fd0, + flags0, + path0, + path_len0, + fd1, + path1, + path_len1 + ) + } + + // TODO: When multi-value happens, switch to that instead of passing + // the `fd` by reference? + pub unsafe extern "C" fn path_open( + vmctx: *mut VMContext, + dirfd: wasm32::__wasi_fd_t, + dirflags: wasm32::__wasi_lookupflags_t, + path: wasm32::uintptr_t, + path_len: wasm32::size_t, + oflags: wasm32::__wasi_oflags_t, + fs_rights_base: wasm32::__wasi_rights_t, + fs_rights_inheriting: wasm32::__wasi_rights_t, + fs_flags: wasm32::__wasi_fdflags_t, + fd: wasm32::uintptr_t, + ) -> wasm32::__wasi_errno_t { + trace!( + "path_open(dirfd={:?}, dirflags={:?}, path={:#x?}, path_len={:?}, oflags={:#x?}, fs_rights_base={:#x?}, fs_rights_inheriting={:#x?}, fs_flags={:#x?}, fd={:#x?})", + dirfd, + dirflags, + path, + path_len, + oflags, + fs_rights_base, + fs_rights_inheriting, + fs_flags, + fd + ); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + let memory = ok_or_errno!(get_memory(&mut *vmctx)); + hostcalls::path_open( + wasi_ctx, + memory, + dirfd, + dirflags, + path, + path_len, + oflags, + fs_rights_base, + fs_rights_inheriting, + fs_flags, + fd + ) + } + + pub unsafe extern "C" fn fd_readdir( + vmctx: *mut VMContext, + fd: wasm32::__wasi_fd_t, + buf: wasm32::uintptr_t, + buf_len: wasm32::size_t, + cookie: wasm32::__wasi_dircookie_t, + buf_used: wasm32::uintptr_t, + ) -> wasm32::__wasi_errno_t { + trace!( + "fd_readdir(fd={:?}, buf={:#x?}, buf_len={}, cookie={:#x?}, buf_used={:#x?})", + fd, + buf, + buf_len, + cookie, + buf_used, + ); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + let memory = ok_or_errno!(get_memory(&mut *vmctx)); + hostcalls::fd_readdir( + wasi_ctx, + memory, + fd, + buf, + buf_len, + cookie, + buf_used + ) + } + + pub unsafe extern "C" fn path_readlink( + vmctx: *mut VMContext, + fd: wasm32::__wasi_fd_t, + path: wasm32::uintptr_t, + path_len: wasm32::size_t, + buf: wasm32::uintptr_t, + buf_len: wasm32::size_t, + buf_used: wasm32::uintptr_t, + ) -> wasm32::__wasi_errno_t { + trace!( + "path_readlink(fd={:?}, path={:#x?}, path_len={:?}, buf={:#x?}, buf_len={}, buf_used={:#x?})", + fd, + path, + path_len, + buf, + buf_len, + buf_used, + ); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + let memory = ok_or_errno!(get_memory(&mut *vmctx)); + hostcalls::path_readlink( + wasi_ctx, + memory, + fd, + path, + path_len, + buf, + buf_len, + buf_used + ) + } + + pub unsafe extern "C" fn path_rename( + vmctx: *mut VMContext, + fd0: wasm32::__wasi_fd_t, + path0: wasm32::uintptr_t, + path_len0: wasm32::size_t, + fd1: wasm32::__wasi_fd_t, + path1: wasm32::uintptr_t, + path_len1: wasm32::size_t, + ) -> wasm32::__wasi_errno_t { + trace!( + "path_rename(fd0={:?}, path0={:#x?}, path_len0={:?}, fd1={:?}, path1={:#x?}, path_len1={:?})", + fd0, + path0, + path_len0, + fd1, + path1, + path_len1, + ); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + let memory = ok_or_errno!(get_memory(&mut *vmctx)); + hostcalls::path_rename( + wasi_ctx, + memory, + fd0, + path0, + path_len0, + fd1, + path1, + path_len1 + ) + } + + pub unsafe extern "C" fn fd_filestat_get( + vmctx: *mut VMContext, + fd: wasm32::__wasi_fd_t, + buf: wasm32::uintptr_t, + ) -> wasm32::__wasi_errno_t { + trace!("fd_filestat_get(fd={:?}, buf={:#x?})", fd, buf); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + let memory = ok_or_errno!(get_memory(&mut *vmctx)); + hostcalls::fd_filestat_get(wasi_ctx, memory, fd, buf) + } + + pub unsafe extern "C" fn fd_filestat_set_times( + vmctx: *mut VMContext, + fd: wasm32::__wasi_fd_t, + st_atim: wasm32::__wasi_timestamp_t, + st_mtim: wasm32::__wasi_timestamp_t, + fstflags: wasm32::__wasi_fstflags_t, + ) -> wasm32::__wasi_errno_t { + trace!( + "fd_filestat_set_times(fd={:?}, st_atim={}, st_mtim={}, fstflags={:#x?})", + fd, + st_atim, st_mtim, + fstflags + ); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + hostcalls::fd_filestat_set_times(wasi_ctx, fd, st_atim, st_mtim, fstflags) + } + + pub unsafe extern "C" fn fd_filestat_set_size( + vmctx: *mut VMContext, + fd: wasm32::__wasi_fd_t, + size: wasm32::__wasi_filesize_t, + ) -> wasm32::__wasi_errno_t { + trace!( + "fd_filestat_set_size(fd={:?}, size={})", + fd, + size + ); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + hostcalls::fd_filestat_set_size(wasi_ctx, fd, size) + } + + pub unsafe extern "C" fn path_filestat_get( + vmctx: *mut VMContext, + fd: wasm32::__wasi_fd_t, + flags: wasm32::__wasi_lookupflags_t, + path: wasm32::uintptr_t, + path_len: wasm32::size_t, + buf: wasm32::uintptr_t, + ) -> wasm32::__wasi_errno_t { + trace!( + "path_filestat_get(fd={:?}, flags={:?}, path={:#x?}, path_len={}, buf={:#x?})", + fd, + flags, + path, + path_len, + buf + ); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + let memory = ok_or_errno!(get_memory(&mut *vmctx)); + hostcalls::path_filestat_get(wasi_ctx, memory, fd, flags, path, path_len, buf) + } + + pub unsafe extern "C" fn path_filestat_set_times( + vmctx: *mut VMContext, + fd: wasm32::__wasi_fd_t, + flags: wasm32::__wasi_lookupflags_t, + path: wasm32::uintptr_t, + path_len: wasm32::size_t, + st_atim: wasm32::__wasi_timestamp_t, + st_mtim: wasm32::__wasi_timestamp_t, + fstflags: wasm32::__wasi_fstflags_t, + ) -> wasm32::__wasi_errno_t { + trace!( + "path_filestat_set_times(fd={:?}, flags={:?}, path={:#x?}, path_len={}, st_atim={}, st_mtim={}, fstflags={:#x?})", + fd, + flags, + path, + path_len, + st_atim, st_mtim, + fstflags + ); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + let memory = ok_or_errno!(get_memory(&mut *vmctx)); + hostcalls::path_filestat_set_times( + wasi_ctx, + memory, + fd, + flags, + path, + path_len, + st_atim, + st_mtim, + fstflags + ) + } + + pub unsafe extern "C" fn path_symlink( + vmctx: *mut VMContext, + path0: wasm32::uintptr_t, + path_len0: wasm32::size_t, + fd: wasm32::__wasi_fd_t, + path1: wasm32::uintptr_t, + path_len1: wasm32::size_t, + ) -> wasm32::__wasi_errno_t { + trace!( + "path_symlink(path0={:#x?}, path_len0={}, fd={:?}, path1={:#x?}, path_len1={})", + path0, + path_len0, + fd, + path1, + path_len1 + ); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + let memory = ok_or_errno!(get_memory(&mut *vmctx)); + hostcalls::path_symlink( + wasi_ctx, + memory, + path0, + path_len0, + fd, + path1, + path_len1 + ) + } + + pub unsafe extern "C" fn path_unlink_file( + vmctx: *mut VMContext, + fd: wasm32::__wasi_fd_t, + path: wasm32::uintptr_t, + path_len: wasm32::size_t, + ) -> wasm32::__wasi_errno_t { + trace!( + "path_unlink_file(fd={:?}, path={:#x?}, path_len={})", + fd, + path, + path_len + ); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + let memory = ok_or_errno!(get_memory(&mut *vmctx)); + hostcalls::path_unlink_file(wasi_ctx, memory, fd, path, path_len) + } + + pub unsafe extern "C" fn path_remove_directory( + vmctx: *mut VMContext, + fd: wasm32::__wasi_fd_t, + path: wasm32::uintptr_t, + path_len: wasm32::size_t, + ) -> wasm32::__wasi_errno_t { + trace!( + "path_remove_directory(fd={:?}, path={:#x?}, path_len={})", + fd, + path, + path_len + ); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + let memory = ok_or_errno!(get_memory(&mut *vmctx)); + hostcalls::path_remove_directory(wasi_ctx, memory, fd, path, path_len) + } + + pub unsafe extern "C" fn poll_oneoff( + vmctx: *mut VMContext, + in_: wasm32::uintptr_t, + out: wasm32::uintptr_t, + nsubscriptions: wasm32::size_t, + nevents: wasm32::uintptr_t, + ) -> wasm32::__wasi_errno_t { + trace!( + "poll_oneoff(in={:#x?}, out={:#x?}, nsubscriptions={}, nevents={:#x?})", + in_, + out, + nsubscriptions, + nevents, + ); + let memory = ok_or_errno!(get_memory(&mut *vmctx)); + hostcalls::poll_oneoff(memory, in_, out, nsubscriptions, nevents) + } + + pub unsafe extern "C" fn proc_exit(_vmctx: *mut VMContext, rval: u32,) -> () { + trace!("proc_exit(rval={:?})", rval); + hostcalls::proc_exit(rval) + } + + pub unsafe extern "C" fn proc_raise( + vmctx: *mut VMContext, + sig: wasm32::__wasi_signal_t, + ) -> wasm32::__wasi_errno_t { + trace!("proc_raise(sig={:?})", sig); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + let memory = ok_or_errno!(get_memory(&mut *vmctx)); + hostcalls::proc_raise(wasi_ctx, memory, sig) + } + + pub unsafe extern "C" fn random_get( + vmctx: *mut VMContext, + buf: wasm32::uintptr_t, + buf_len: wasm32::size_t, + ) -> wasm32::__wasi_errno_t { + trace!("random_get(buf={:#x?}, buf_len={:?})", buf, buf_len); + let memory = ok_or_errno!(get_memory(&mut *vmctx)); + hostcalls::random_get(memory, buf, buf_len) + } + + pub unsafe extern "C" fn sched_yield(_vmctx: *mut VMContext,) -> wasm32::__wasi_errno_t { + trace!("sched_yield(void)"); + hostcalls::sched_yield() + } + + pub unsafe extern "C" fn sock_recv( + vmctx: *mut VMContext, + sock: wasm32::__wasi_fd_t, + ri_data: wasm32::uintptr_t, + ri_data_len: wasm32::size_t, + ri_flags: wasm32::__wasi_riflags_t, + ro_datalen: wasm32::uintptr_t, + ro_flags: wasm32::uintptr_t, + ) -> wasm32::__wasi_errno_t { + trace!( + "sock_recv(sock={:?}, ri_data={:#x?}, ri_data_len={}, ri_flags={:#x?}, ro_datalen={:#x?}, ro_flags={:#x?})", + sock, + ri_data, ri_data_len, ri_flags, + ro_datalen, ro_flags + ); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + let memory = ok_or_errno!(get_memory(&mut *vmctx)); + hostcalls::sock_recv( + wasi_ctx, + memory, + sock, + ri_data, + ri_data_len, + ri_flags, + ro_datalen, + ro_flags + ) + } + + pub unsafe extern "C" fn sock_send( + vmctx: *mut VMContext, + sock: wasm32::__wasi_fd_t, + si_data: wasm32::uintptr_t, + si_data_len: wasm32::size_t, + si_flags: wasm32::__wasi_siflags_t, + so_datalen: wasm32::uintptr_t, + ) -> wasm32::__wasi_errno_t { + trace!( + "sock_send(sock={:?}, si_data={:#x?}, si_data_len={}, si_flags={:#x?}, so_datalen={:#x?})", + sock, + si_data, si_data_len, si_flags, so_datalen, + ); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + let memory = ok_or_errno!(get_memory(&mut *vmctx)); + hostcalls::sock_send( + wasi_ctx, + memory, + sock, + si_data, + si_data_len, + si_flags, + so_datalen + ) + } + + pub unsafe extern "C" fn sock_shutdown( + vmctx: *mut VMContext, + sock: wasm32::__wasi_fd_t, + how: wasm32::__wasi_sdflags_t, + ) -> wasm32::__wasi_errno_t { + trace!("sock_shutdown(sock={:?}, how={:?})", sock, how); + let wasi_ctx = ok_or_errno!(get_wasi_ctx(&mut *vmctx)); + let memory = ok_or_errno!(get_memory(&mut *vmctx)); + hostcalls::sock_shutdown(wasi_ctx, memory, sock, how) + } +}