├── .circleci └── config.yml ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── README.md ├── examples └── string.rs ├── src └── main.rs └── wasm-sample-app ├── .cargo └── config ├── .gitignore ├── Cargo.toml ├── README.md └── src └── lib.rs /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | test-stable: 3 | docker: 4 | - image: circleci/rust:latest 5 | steps: 6 | - checkout 7 | - restore_cache: 8 | keys: 9 | - v8-test-cargo-cache-linux-stable-{{ arch }}-{{ checksum "Cargo.lock" }} 10 | - run: 11 | name: Install wasm toolchain 12 | command: rustup target add wasm32-unknown-unknown 13 | - run: 14 | name: Build wasm sample 15 | command: cargo build --manifest-path wasm-sample-app/Cargo.toml --release --target wasm32-unknown-unknown 16 | - run: 17 | name: Run sample 18 | command: cargo run 19 | - save_cache: 20 | paths: 21 | - /usr/local/cargo/registry 22 | - target/release/.fingerprint 23 | - target/release/build 24 | - target/release/deps 25 | key: v8-test-cargo-cache-linux-stable-{{ arch }}-{{ checksum "Cargo.lock" }} 26 | test-and-build-macos: 27 | macos: 28 | xcode: "9.0" 29 | steps: 30 | - checkout 31 | - run: 32 | name: "Pull dependencies" 33 | command: | 34 | git submodule init 35 | git submodule update 36 | - restore_cache: 37 | keys: 38 | - v8-cargo-cache-darwin-stable-{{ arch }}-{{ checksum "Cargo.lock" }} 39 | - run: 40 | name: Install Rust 41 | command: | 42 | curl -sSf https://sh.rustup.rs | sh -s -- -y 43 | export PATH="$HOME/.cargo/bin:$PATH" 44 | rustup target add wasm32-unknown-unknown 45 | cargo --version 46 | - run: 47 | name: Build wasm sample 48 | command: | 49 | export PATH="$HOME/.cargo/bin:$PATH" 50 | cargo build --manifest-path wasm-sample-app/Cargo.toml --release --target wasm32-unknown-unknown 51 | - run: 52 | name: Run sample 53 | command: | 54 | export PATH="$HOME/.cargo/bin:$PATH" 55 | cargo run 56 | - save_cache: 57 | paths: 58 | - ~/.cargo/registry/ 59 | - target/release/.fingerprint 60 | - target/release/build 61 | - target/release/deps 62 | - wapm-cli/target/release/.fingerprint 63 | - wapm-cli/target/release/build 64 | - wapm-cli/target/release/deps 65 | key: v8-cargo-cache-darwin-stable-{{ arch }}-{{ checksum "Cargo.lock" }} 66 | workflows: 67 | version: 2 68 | main: 69 | jobs: 70 | - test-and-build: 71 | - test-and-build-macos: 72 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | **/*.rs.bk 3 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "arrayref" 5 | version = "0.3.6" 6 | source = "registry+https://github.com/rust-lang/crates.io-index" 7 | 8 | [[package]] 9 | name = "arrayvec" 10 | version = "0.5.1" 11 | source = "registry+https://github.com/rust-lang/crates.io-index" 12 | 13 | [[package]] 14 | name = "autocfg" 15 | version = "1.0.0" 16 | source = "registry+https://github.com/rust-lang/crates.io-index" 17 | 18 | [[package]] 19 | name = "bincode" 20 | version = "1.2.1" 21 | source = "registry+https://github.com/rust-lang/crates.io-index" 22 | dependencies = [ 23 | "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 24 | "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", 25 | ] 26 | 27 | [[package]] 28 | name = "bitflags" 29 | version = "1.2.1" 30 | source = "registry+https://github.com/rust-lang/crates.io-index" 31 | 32 | [[package]] 33 | name = "blake3" 34 | version = "0.1.5" 35 | source = "registry+https://github.com/rust-lang/crates.io-index" 36 | dependencies = [ 37 | "arrayref 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", 38 | "arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", 39 | "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", 40 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 41 | "constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", 42 | "crypto-mac 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", 43 | "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", 44 | ] 45 | 46 | [[package]] 47 | name = "byteorder" 48 | version = "1.3.4" 49 | source = "registry+https://github.com/rust-lang/crates.io-index" 50 | 51 | [[package]] 52 | name = "cc" 53 | version = "1.0.50" 54 | source = "registry+https://github.com/rust-lang/crates.io-index" 55 | 56 | [[package]] 57 | name = "cfg-if" 58 | version = "0.1.10" 59 | source = "registry+https://github.com/rust-lang/crates.io-index" 60 | 61 | [[package]] 62 | name = "cloudabi" 63 | version = "0.0.3" 64 | source = "registry+https://github.com/rust-lang/crates.io-index" 65 | dependencies = [ 66 | "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 67 | ] 68 | 69 | [[package]] 70 | name = "cmake" 71 | version = "0.1.42" 72 | source = "registry+https://github.com/rust-lang/crates.io-index" 73 | dependencies = [ 74 | "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", 75 | ] 76 | 77 | [[package]] 78 | name = "constant_time_eq" 79 | version = "0.1.5" 80 | source = "registry+https://github.com/rust-lang/crates.io-index" 81 | 82 | [[package]] 83 | name = "cranelift-bforest" 84 | version = "0.59.0" 85 | source = "registry+https://github.com/rust-lang/crates.io-index" 86 | dependencies = [ 87 | "cranelift-entity 0.59.0 (registry+https://github.com/rust-lang/crates.io-index)", 88 | ] 89 | 90 | [[package]] 91 | name = "cranelift-codegen" 92 | version = "0.59.0" 93 | source = "registry+https://github.com/rust-lang/crates.io-index" 94 | dependencies = [ 95 | "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 96 | "cranelift-bforest 0.59.0 (registry+https://github.com/rust-lang/crates.io-index)", 97 | "cranelift-codegen-meta 0.59.0 (registry+https://github.com/rust-lang/crates.io-index)", 98 | "cranelift-codegen-shared 0.59.0 (registry+https://github.com/rust-lang/crates.io-index)", 99 | "cranelift-entity 0.59.0 (registry+https://github.com/rust-lang/crates.io-index)", 100 | "gimli 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", 101 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", 102 | "smallvec 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 103 | "target-lexicon 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", 104 | "thiserror 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", 105 | ] 106 | 107 | [[package]] 108 | name = "cranelift-codegen-meta" 109 | version = "0.59.0" 110 | source = "registry+https://github.com/rust-lang/crates.io-index" 111 | dependencies = [ 112 | "cranelift-codegen-shared 0.59.0 (registry+https://github.com/rust-lang/crates.io-index)", 113 | "cranelift-entity 0.59.0 (registry+https://github.com/rust-lang/crates.io-index)", 114 | ] 115 | 116 | [[package]] 117 | name = "cranelift-codegen-shared" 118 | version = "0.59.0" 119 | source = "registry+https://github.com/rust-lang/crates.io-index" 120 | 121 | [[package]] 122 | name = "cranelift-entity" 123 | version = "0.59.0" 124 | source = "registry+https://github.com/rust-lang/crates.io-index" 125 | 126 | [[package]] 127 | name = "cranelift-native" 128 | version = "0.59.0" 129 | source = "registry+https://github.com/rust-lang/crates.io-index" 130 | dependencies = [ 131 | "cranelift-codegen 0.59.0 (registry+https://github.com/rust-lang/crates.io-index)", 132 | "raw-cpuid 7.0.3 (registry+https://github.com/rust-lang/crates.io-index)", 133 | "target-lexicon 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", 134 | ] 135 | 136 | [[package]] 137 | name = "crossbeam-deque" 138 | version = "0.7.3" 139 | source = "registry+https://github.com/rust-lang/crates.io-index" 140 | dependencies = [ 141 | "crossbeam-epoch 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", 142 | "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", 143 | "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 144 | ] 145 | 146 | [[package]] 147 | name = "crossbeam-epoch" 148 | version = "0.8.2" 149 | source = "registry+https://github.com/rust-lang/crates.io-index" 150 | dependencies = [ 151 | "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 152 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 153 | "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", 154 | "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 155 | "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 156 | "memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", 157 | "scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 158 | ] 159 | 160 | [[package]] 161 | name = "crossbeam-queue" 162 | version = "0.2.1" 163 | source = "registry+https://github.com/rust-lang/crates.io-index" 164 | dependencies = [ 165 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 166 | "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", 167 | ] 168 | 169 | [[package]] 170 | name = "crossbeam-utils" 171 | version = "0.7.2" 172 | source = "registry+https://github.com/rust-lang/crates.io-index" 173 | dependencies = [ 174 | "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 175 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 176 | "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 177 | ] 178 | 179 | [[package]] 180 | name = "crypto-mac" 181 | version = "0.7.0" 182 | source = "registry+https://github.com/rust-lang/crates.io-index" 183 | dependencies = [ 184 | "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", 185 | "subtle 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 186 | ] 187 | 188 | [[package]] 189 | name = "digest" 190 | version = "0.8.1" 191 | source = "registry+https://github.com/rust-lang/crates.io-index" 192 | dependencies = [ 193 | "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", 194 | ] 195 | 196 | [[package]] 197 | name = "either" 198 | version = "1.5.3" 199 | source = "registry+https://github.com/rust-lang/crates.io-index" 200 | 201 | [[package]] 202 | name = "errno" 203 | version = "0.2.4" 204 | source = "registry+https://github.com/rust-lang/crates.io-index" 205 | dependencies = [ 206 | "errno-dragonfly 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 207 | "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", 208 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", 209 | ] 210 | 211 | [[package]] 212 | name = "errno-dragonfly" 213 | version = "0.1.1" 214 | source = "registry+https://github.com/rust-lang/crates.io-index" 215 | dependencies = [ 216 | "gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)", 217 | "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", 218 | ] 219 | 220 | [[package]] 221 | name = "gcc" 222 | version = "0.3.55" 223 | source = "registry+https://github.com/rust-lang/crates.io-index" 224 | 225 | [[package]] 226 | name = "generic-array" 227 | version = "0.12.3" 228 | source = "registry+https://github.com/rust-lang/crates.io-index" 229 | dependencies = [ 230 | "typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)", 231 | ] 232 | 233 | [[package]] 234 | name = "gimli" 235 | version = "0.20.0" 236 | source = "registry+https://github.com/rust-lang/crates.io-index" 237 | dependencies = [ 238 | "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 239 | "indexmap 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", 240 | ] 241 | 242 | [[package]] 243 | name = "hermit-abi" 244 | version = "0.1.8" 245 | source = "registry+https://github.com/rust-lang/crates.io-index" 246 | dependencies = [ 247 | "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", 248 | ] 249 | 250 | [[package]] 251 | name = "hex" 252 | version = "0.4.2" 253 | source = "registry+https://github.com/rust-lang/crates.io-index" 254 | 255 | [[package]] 256 | name = "indexmap" 257 | version = "1.3.2" 258 | source = "registry+https://github.com/rust-lang/crates.io-index" 259 | dependencies = [ 260 | "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 261 | "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", 262 | ] 263 | 264 | [[package]] 265 | name = "lazy_static" 266 | version = "1.4.0" 267 | source = "registry+https://github.com/rust-lang/crates.io-index" 268 | 269 | [[package]] 270 | name = "libc" 271 | version = "0.2.67" 272 | source = "registry+https://github.com/rust-lang/crates.io-index" 273 | 274 | [[package]] 275 | name = "lock_api" 276 | version = "0.3.3" 277 | source = "registry+https://github.com/rust-lang/crates.io-index" 278 | dependencies = [ 279 | "scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 280 | ] 281 | 282 | [[package]] 283 | name = "log" 284 | version = "0.4.8" 285 | source = "registry+https://github.com/rust-lang/crates.io-index" 286 | dependencies = [ 287 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 288 | ] 289 | 290 | [[package]] 291 | name = "maybe-uninit" 292 | version = "2.0.0" 293 | source = "registry+https://github.com/rust-lang/crates.io-index" 294 | 295 | [[package]] 296 | name = "memmap" 297 | version = "0.7.0" 298 | source = "registry+https://github.com/rust-lang/crates.io-index" 299 | dependencies = [ 300 | "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", 301 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", 302 | ] 303 | 304 | [[package]] 305 | name = "memoffset" 306 | version = "0.5.3" 307 | source = "registry+https://github.com/rust-lang/crates.io-index" 308 | dependencies = [ 309 | "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", 310 | ] 311 | 312 | [[package]] 313 | name = "nix" 314 | version = "0.15.0" 315 | source = "registry+https://github.com/rust-lang/crates.io-index" 316 | dependencies = [ 317 | "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 318 | "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", 319 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 320 | "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", 321 | "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 322 | ] 323 | 324 | [[package]] 325 | name = "num_cpus" 326 | version = "1.12.0" 327 | source = "registry+https://github.com/rust-lang/crates.io-index" 328 | dependencies = [ 329 | "hermit-abi 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", 330 | "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", 331 | ] 332 | 333 | [[package]] 334 | name = "page_size" 335 | version = "0.4.2" 336 | source = "registry+https://github.com/rust-lang/crates.io-index" 337 | dependencies = [ 338 | "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", 339 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", 340 | ] 341 | 342 | [[package]] 343 | name = "parking_lot" 344 | version = "0.10.0" 345 | source = "registry+https://github.com/rust-lang/crates.io-index" 346 | dependencies = [ 347 | "lock_api 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 348 | "parking_lot_core 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", 349 | ] 350 | 351 | [[package]] 352 | name = "parking_lot_core" 353 | version = "0.7.0" 354 | source = "registry+https://github.com/rust-lang/crates.io-index" 355 | dependencies = [ 356 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 357 | "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", 358 | "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", 359 | "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", 360 | "smallvec 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 361 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", 362 | ] 363 | 364 | [[package]] 365 | name = "proc-macro2" 366 | version = "1.0.9" 367 | source = "registry+https://github.com/rust-lang/crates.io-index" 368 | dependencies = [ 369 | "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 370 | ] 371 | 372 | [[package]] 373 | name = "quote" 374 | version = "1.0.3" 375 | source = "registry+https://github.com/rust-lang/crates.io-index" 376 | dependencies = [ 377 | "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", 378 | ] 379 | 380 | [[package]] 381 | name = "raw-cpuid" 382 | version = "7.0.3" 383 | source = "registry+https://github.com/rust-lang/crates.io-index" 384 | dependencies = [ 385 | "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 386 | "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", 387 | "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", 388 | ] 389 | 390 | [[package]] 391 | name = "rayon" 392 | version = "1.3.0" 393 | source = "registry+https://github.com/rust-lang/crates.io-index" 394 | dependencies = [ 395 | "crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", 396 | "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", 397 | "rayon-core 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", 398 | ] 399 | 400 | [[package]] 401 | name = "rayon-core" 402 | version = "1.7.0" 403 | source = "registry+https://github.com/rust-lang/crates.io-index" 404 | dependencies = [ 405 | "crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", 406 | "crossbeam-queue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 407 | "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", 408 | "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 409 | "num_cpus 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)", 410 | ] 411 | 412 | [[package]] 413 | name = "redox_syscall" 414 | version = "0.1.56" 415 | source = "registry+https://github.com/rust-lang/crates.io-index" 416 | 417 | [[package]] 418 | name = "rust_embedder_app" 419 | version = "0.4.0" 420 | dependencies = [ 421 | "wasmer-runtime 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", 422 | ] 423 | 424 | [[package]] 425 | name = "rustc_version" 426 | version = "0.2.3" 427 | source = "registry+https://github.com/rust-lang/crates.io-index" 428 | dependencies = [ 429 | "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", 430 | ] 431 | 432 | [[package]] 433 | name = "scopeguard" 434 | version = "1.1.0" 435 | source = "registry+https://github.com/rust-lang/crates.io-index" 436 | 437 | [[package]] 438 | name = "semver" 439 | version = "0.9.0" 440 | source = "registry+https://github.com/rust-lang/crates.io-index" 441 | dependencies = [ 442 | "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", 443 | ] 444 | 445 | [[package]] 446 | name = "semver-parser" 447 | version = "0.7.0" 448 | source = "registry+https://github.com/rust-lang/crates.io-index" 449 | 450 | [[package]] 451 | name = "serde" 452 | version = "1.0.104" 453 | source = "registry+https://github.com/rust-lang/crates.io-index" 454 | 455 | [[package]] 456 | name = "serde-bench" 457 | version = "0.0.7" 458 | source = "registry+https://github.com/rust-lang/crates.io-index" 459 | dependencies = [ 460 | "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 461 | "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", 462 | ] 463 | 464 | [[package]] 465 | name = "serde_bytes" 466 | version = "0.11.3" 467 | source = "registry+https://github.com/rust-lang/crates.io-index" 468 | dependencies = [ 469 | "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", 470 | ] 471 | 472 | [[package]] 473 | name = "serde_derive" 474 | version = "1.0.104" 475 | source = "registry+https://github.com/rust-lang/crates.io-index" 476 | dependencies = [ 477 | "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", 478 | "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", 479 | "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", 480 | ] 481 | 482 | [[package]] 483 | name = "smallvec" 484 | version = "0.6.13" 485 | source = "registry+https://github.com/rust-lang/crates.io-index" 486 | dependencies = [ 487 | "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 488 | ] 489 | 490 | [[package]] 491 | name = "smallvec" 492 | version = "1.2.0" 493 | source = "registry+https://github.com/rust-lang/crates.io-index" 494 | 495 | [[package]] 496 | name = "subtle" 497 | version = "1.0.0" 498 | source = "registry+https://github.com/rust-lang/crates.io-index" 499 | 500 | [[package]] 501 | name = "syn" 502 | version = "1.0.16" 503 | source = "registry+https://github.com/rust-lang/crates.io-index" 504 | dependencies = [ 505 | "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", 506 | "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", 507 | "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 508 | ] 509 | 510 | [[package]] 511 | name = "target-lexicon" 512 | version = "0.9.0" 513 | source = "registry+https://github.com/rust-lang/crates.io-index" 514 | 515 | [[package]] 516 | name = "target-lexicon" 517 | version = "0.10.0" 518 | source = "registry+https://github.com/rust-lang/crates.io-index" 519 | 520 | [[package]] 521 | name = "thiserror" 522 | version = "1.0.11" 523 | source = "registry+https://github.com/rust-lang/crates.io-index" 524 | dependencies = [ 525 | "thiserror-impl 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", 526 | ] 527 | 528 | [[package]] 529 | name = "thiserror-impl" 530 | version = "1.0.11" 531 | source = "registry+https://github.com/rust-lang/crates.io-index" 532 | dependencies = [ 533 | "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", 534 | "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", 535 | "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", 536 | ] 537 | 538 | [[package]] 539 | name = "typenum" 540 | version = "1.11.2" 541 | source = "registry+https://github.com/rust-lang/crates.io-index" 542 | 543 | [[package]] 544 | name = "unicode-xid" 545 | version = "0.2.0" 546 | source = "registry+https://github.com/rust-lang/crates.io-index" 547 | 548 | [[package]] 549 | name = "void" 550 | version = "1.0.2" 551 | source = "registry+https://github.com/rust-lang/crates.io-index" 552 | 553 | [[package]] 554 | name = "wasmer-clif-backend" 555 | version = "0.16.0" 556 | source = "registry+https://github.com/rust-lang/crates.io-index" 557 | dependencies = [ 558 | "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 559 | "cranelift-codegen 0.59.0 (registry+https://github.com/rust-lang/crates.io-index)", 560 | "cranelift-entity 0.59.0 (registry+https://github.com/rust-lang/crates.io-index)", 561 | "cranelift-native 0.59.0 (registry+https://github.com/rust-lang/crates.io-index)", 562 | "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", 563 | "nix 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", 564 | "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", 565 | "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", 566 | "serde-bench 0.0.7 (registry+https://github.com/rust-lang/crates.io-index)", 567 | "serde_bytes 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", 568 | "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", 569 | "target-lexicon 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", 570 | "wasmer-clif-fork-frontend 0.59.0 (registry+https://github.com/rust-lang/crates.io-index)", 571 | "wasmer-clif-fork-wasm 0.59.0 (registry+https://github.com/rust-lang/crates.io-index)", 572 | "wasmer-runtime-core 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", 573 | "wasmer-win-exception-handler 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", 574 | "wasmparser 0.51.4 (registry+https://github.com/rust-lang/crates.io-index)", 575 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", 576 | ] 577 | 578 | [[package]] 579 | name = "wasmer-clif-fork-frontend" 580 | version = "0.59.0" 581 | source = "registry+https://github.com/rust-lang/crates.io-index" 582 | dependencies = [ 583 | "cranelift-codegen 0.59.0 (registry+https://github.com/rust-lang/crates.io-index)", 584 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", 585 | "smallvec 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 586 | "target-lexicon 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", 587 | ] 588 | 589 | [[package]] 590 | name = "wasmer-clif-fork-wasm" 591 | version = "0.59.0" 592 | source = "registry+https://github.com/rust-lang/crates.io-index" 593 | dependencies = [ 594 | "cranelift-codegen 0.59.0 (registry+https://github.com/rust-lang/crates.io-index)", 595 | "cranelift-entity 0.59.0 (registry+https://github.com/rust-lang/crates.io-index)", 596 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", 597 | "thiserror 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", 598 | "wasmer-clif-fork-frontend 0.59.0 (registry+https://github.com/rust-lang/crates.io-index)", 599 | "wasmparser 0.51.4 (registry+https://github.com/rust-lang/crates.io-index)", 600 | ] 601 | 602 | [[package]] 603 | name = "wasmer-runtime" 604 | version = "0.16.0" 605 | source = "registry+https://github.com/rust-lang/crates.io-index" 606 | dependencies = [ 607 | "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 608 | "memmap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", 609 | "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", 610 | "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", 611 | "wasmer-clif-backend 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", 612 | "wasmer-runtime-core 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", 613 | ] 614 | 615 | [[package]] 616 | name = "wasmer-runtime-core" 617 | version = "0.16.0" 618 | source = "registry+https://github.com/rust-lang/crates.io-index" 619 | dependencies = [ 620 | "bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 621 | "blake3 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", 622 | "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", 623 | "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", 624 | "errno 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", 625 | "hex 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", 626 | "indexmap 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", 627 | "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 628 | "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", 629 | "nix 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", 630 | "page_size 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", 631 | "parking_lot 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", 632 | "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", 633 | "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", 634 | "serde-bench 0.0.7 (registry+https://github.com/rust-lang/crates.io-index)", 635 | "serde_bytes 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", 636 | "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", 637 | "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", 638 | "target-lexicon 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", 639 | "wasmparser 0.51.4 (registry+https://github.com/rust-lang/crates.io-index)", 640 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", 641 | ] 642 | 643 | [[package]] 644 | name = "wasmer-win-exception-handler" 645 | version = "0.16.0" 646 | source = "registry+https://github.com/rust-lang/crates.io-index" 647 | dependencies = [ 648 | "cmake 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", 649 | "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", 650 | "wasmer-runtime-core 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", 651 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", 652 | ] 653 | 654 | [[package]] 655 | name = "wasmparser" 656 | version = "0.51.4" 657 | source = "registry+https://github.com/rust-lang/crates.io-index" 658 | 659 | [[package]] 660 | name = "winapi" 661 | version = "0.3.8" 662 | source = "registry+https://github.com/rust-lang/crates.io-index" 663 | dependencies = [ 664 | "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 665 | "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 666 | ] 667 | 668 | [[package]] 669 | name = "winapi-i686-pc-windows-gnu" 670 | version = "0.4.0" 671 | source = "registry+https://github.com/rust-lang/crates.io-index" 672 | 673 | [[package]] 674 | name = "winapi-x86_64-pc-windows-gnu" 675 | version = "0.4.0" 676 | source = "registry+https://github.com/rust-lang/crates.io-index" 677 | 678 | [metadata] 679 | "checksum arrayref 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" 680 | "checksum arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" 681 | "checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" 682 | "checksum bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5753e2a71534719bf3f4e57006c3a4f0d2c672a4b676eec84161f763eca87dbf" 683 | "checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" 684 | "checksum blake3 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "46080006c1505f12f64dd2a09264b343381ed3190fa02c8005d5d662ac571c63" 685 | "checksum byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" 686 | "checksum cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)" = "95e28fa049fda1c330bcf9d723be7663a899c4679724b34c81e9f5a326aab8cd" 687 | "checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 688 | "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" 689 | "checksum cmake 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "81fb25b677f8bf1eb325017cb6bb8452f87969db0fedb4f757b297bee78a7c62" 690 | "checksum constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" 691 | "checksum cranelift-bforest 0.59.0 (registry+https://github.com/rust-lang/crates.io-index)" = "45a9c21f8042b9857bda93f6c1910b9f9f24100187a3d3d52f214a34e3dc5818" 692 | "checksum cranelift-codegen 0.59.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7853f77a6e4a33c67a69c40f5e1bb982bd2dc5c4a22e17e67b65bbccf9b33b2e" 693 | "checksum cranelift-codegen-meta 0.59.0 (registry+https://github.com/rust-lang/crates.io-index)" = "084cd6d5fb0d1da28acd72c199471bfb09acc703ec8f3bf07b1699584272a3b9" 694 | "checksum cranelift-codegen-shared 0.59.0 (registry+https://github.com/rust-lang/crates.io-index)" = "701b599783305a58c25027a4d73f2d6b599b2d8ef3f26677275f480b4d51e05d" 695 | "checksum cranelift-entity 0.59.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b88e792b28e1ebbc0187b72ba5ba880dad083abe9231a99d19604d10c9e73f38" 696 | "checksum cranelift-native 0.59.0 (registry+https://github.com/rust-lang/crates.io-index)" = "32daf082da21c0c05d93394ff4842c2ab7c4991b1f3186a1d952f8ac660edd0b" 697 | "checksum crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" 698 | "checksum crossbeam-epoch 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" 699 | "checksum crossbeam-queue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c695eeca1e7173472a32221542ae469b3e9aac3a4fc81f7696bcad82029493db" 700 | "checksum crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" 701 | "checksum crypto-mac 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5" 702 | "checksum digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" 703 | "checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" 704 | "checksum errno 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "c2a071601ed01b988f896ab14b95e67335d1eeb50190932a1320f7fe3cadc84e" 705 | "checksum errno-dragonfly 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "14ca354e36190500e1e1fb267c647932382b54053c50b14970856c0b00a35067" 706 | "checksum gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)" = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" 707 | "checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" 708 | "checksum gimli 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)" = "81dd6190aad0f05ddbbf3245c54ed14ca4aa6dd32f22312b70d8f168c3e3e633" 709 | "checksum hermit-abi 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1010591b26bbfe835e9faeabeb11866061cc7dcebffd56ad7d0942d0e61aefd8" 710 | "checksum hex 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "644f9158b2f133fd50f5fb3242878846d9eb792e445c893805ff0e3824006e35" 711 | "checksum indexmap 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "076f042c5b7b98f31d205f1249267e12a6518c1481e9dae9764af19b707d2292" 712 | "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 713 | "checksum libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)" = "eb147597cdf94ed43ab7a9038716637d2d1bf2bc571da995d0028dec06bd3018" 714 | "checksum lock_api 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "79b2de95ecb4691949fea4716ca53cdbcfccb2c612e19644a8bad05edcf9f47b" 715 | "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" 716 | "checksum maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" 717 | "checksum memmap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" 718 | "checksum memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "75189eb85871ea5c2e2c15abbdd541185f63b408415e5051f5cac122d8c774b9" 719 | "checksum nix 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3b2e0b4f3320ed72aaedb9a5ac838690a8047c7b275da22711fddff4f8a14229" 720 | "checksum num_cpus 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "46203554f085ff89c235cd12f7075f3233af9b11ed7c9e16dfe2560d03313ce6" 721 | "checksum page_size 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eebde548fbbf1ea81a99b128872779c437752fb99f217c45245e1a61dcd9edcd" 722 | "checksum parking_lot 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "92e98c49ab0b7ce5b222f2cc9193fc4efe11c6d0bd4f648e374684a6857b1cfc" 723 | "checksum parking_lot_core 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7582838484df45743c8434fbff785e8edf260c28748353d44bc0da32e0ceabf1" 724 | "checksum proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6c09721c6781493a2a492a96b5a5bf19b65917fe6728884e7c44dd0c60ca3435" 725 | "checksum quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f" 726 | "checksum raw-cpuid 7.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b4a349ca83373cfa5d6dbb66fd76e58b2cca08da71a5f6400de0a0a6a9bceeaf" 727 | "checksum rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "db6ce3297f9c85e16621bb8cca38a06779ffc31bb8184e1be4bed2be4678a098" 728 | "checksum rayon-core 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "08a89b46efaf957e52b18062fb2f4660f8b8a4dde1807ca002690868ef2c85a9" 729 | "checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" 730 | "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" 731 | "checksum scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 732 | "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" 733 | "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" 734 | "checksum serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449" 735 | "checksum serde-bench 0.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "d733da87e79faaac25616e33d26299a41143fd4cd42746cbb0e91d8feea243fd" 736 | "checksum serde_bytes 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "325a073952621257820e7a3469f55ba4726d8b28657e7e36653d1c36dc2c84ae" 737 | "checksum serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "128f9e303a5a29922045a830221b8f78ec74a5f544944f3d5984f8ec3895ef64" 738 | "checksum smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" 739 | "checksum smallvec 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5c2fb2ec9bcd216a5b0d0ccf31ab17b5ed1d627960edff65bbe95d3ce221cefc" 740 | "checksum subtle 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" 741 | "checksum syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)" = "123bd9499cfb380418d509322d7a6d52e5315f064fe4b3ad18a53d6b92c07859" 742 | "checksum target-lexicon 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ab0e7238dcc7b40a7be719a25365910f6807bd864f4cce6b2e6b873658e2b19d" 743 | "checksum target-lexicon 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6f4c118a7a38378f305a9e111fcb2f7f838c0be324bfb31a77ea04f7f6e684b4" 744 | "checksum thiserror 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ee14bf8e6767ab4c687c9e8bc003879e042a96fd67a3ba5934eadb6536bef4db" 745 | "checksum thiserror-impl 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "a7b51e1fbc44b5a0840be594fbc0f960be09050f2617e61e6aa43bef97cd3ef4" 746 | "checksum typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6d2783fe2d6b8c1101136184eb41be8b1ad379e4657050b8aaff0c79ee7575f9" 747 | "checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" 748 | "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" 749 | "checksum wasmer-clif-backend 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "be2401c6713dc5fa8b5d13ee715b5ae7526661f4c5a48ec1763725578466fa29" 750 | "checksum wasmer-clif-fork-frontend 0.59.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c23f2824f354a00a77e4b040eef6e1d4c595a8a3e9013bad65199cc8dade9a5a" 751 | "checksum wasmer-clif-fork-wasm 0.59.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a35e21d3aebc51cc6ebc0e830cf8458a9891c3482fb3c65ad18d408102929ae5" 752 | "checksum wasmer-runtime 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "05672e5597b66ea3bebaac1665b6578f77971e7d93241b1bbb523fe9795ec809" 753 | "checksum wasmer-runtime-core 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6bf014d5d0169e46a1577085d9bcc12d30d5faa7fc3608c93a2bbe0a09a5e35e" 754 | "checksum wasmer-win-exception-handler 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c67ac785a3dfbf524c5788e2be4d64781858f91bddd3a319ba7b8e129c6e3a30" 755 | "checksum wasmparser 0.51.4 (registry+https://github.com/rust-lang/crates.io-index)" = "aeb1956b19469d1c5e63e459d29e7b5aa0f558d9f16fcef09736f8a265e6c10a" 756 | "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" 757 | "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 758 | "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 759 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rust_embedder_app" 3 | version = "0.4.0" 4 | authors = ["The Wasmer Engineering Team "] 5 | edition = "2018" 6 | 7 | [workspace] 8 | 9 | [dependencies] 10 | wasmer-runtime = "0.16.0" 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Rust Embedder App Example 2 | 3 | **NOTE:** Please see the [Wasmer Rust Integration documentation](https://docs.wasmer.io/integrations/rust) for an up-to-date example of user the Wasmer Rust Integration / Embedding. 4 | 5 | This repo showcases how to use the [wasmer-runtime](https://crates.io/crates/wasmer-runtime/) from Rust, based on the blogpost: https://medium.com/wasmer/executing-webassembly-in-your-rust-application-d5cd32e8ce46 6 | 7 | See [`src/main.rs`](./src/main.rs) for the example implementation. 8 | 9 | The `wasm-sample-app` directory contains an example rust wasm app to run in the embedder app. 10 | 11 | ## Requirements 12 | - Rust target `wasm32-unknown-unknown` - install using `rustup target add wasm32-unknown-unknown` 13 | 14 | ## Running 15 | 16 | ```bash 17 | # Building the wasm-sample-app 18 | cd wasm-sample-app && cargo build --release && cd .. 19 | 20 | # Running the wasm sample from Rust 21 | cargo run 22 | ``` 23 | -------------------------------------------------------------------------------- /examples/string.rs: -------------------------------------------------------------------------------- 1 | extern crate wasmer_runtime; 2 | 3 | use std::str; 4 | 5 | use wasmer_runtime::{error, func, imports, instantiate, Ctx, Value}; 6 | 7 | // Make sure that the compiled wasm-sample-app is accessible at this path. 8 | static WASM: &'static [u8] = 9 | include_bytes!("../wasm-sample-app/target/wasm32-unknown-unknown/release/wasm_sample_app.wasm"); 10 | 11 | fn main() -> error::Result<()> { 12 | // Let's define the import object used to import our function 13 | // into our webassembly sample application. 14 | // 15 | // We've defined a macro that makes it super easy. 16 | // 17 | // The signature tells the runtime what the signature (the parameter 18 | // and return types) of the function we're defining here is. 19 | // The allowed types are `i32`, `u32`, `i64`, `u64`, 20 | // `f32`, and `f64`. 21 | // 22 | // Make sure to check this carefully! 23 | let import_object = imports! { 24 | // Define the "env" namespace that was implicitly used 25 | // by our sample application. 26 | "env" => { 27 | // name // the func! macro autodetects the signature 28 | "print_str" => func!(print_str), 29 | }, 30 | }; 31 | 32 | // Compile our webassembly into an `Instance`. 33 | let mut instance = instantiate(WASM, &import_object)?; 34 | let memory = instance.context_mut().memory(0); 35 | 36 | let host_string = "from Rust!"; 37 | 38 | // Write the string into the lineary memory 39 | for (byte, cell) in host_string 40 | .bytes() 41 | .zip(memory.view()[0 as usize..(host_string.len()) as usize].iter()) 42 | { 43 | cell.set(byte); 44 | } 45 | 46 | // Call our exported function! 47 | instance.call( 48 | "hello_string_from_rust", 49 | &[Value::I32(0), Value::I32(host_string.len() as _)], 50 | )?; 51 | 52 | Ok(()) 53 | } 54 | 55 | // Let's define our "print_str" function. 56 | // 57 | // The declaration must start with "extern" or "extern "C"". 58 | fn print_str(ctx: &mut Ctx, ptr: u32, len: u32) { 59 | // Get a slice that maps to the memory currently used by the webassembly 60 | // instance. 61 | // 62 | // Webassembly only supports a single memory for now, 63 | // but in the near future, it'll support multiple. 64 | // 65 | // Therefore, we don't assume you always just want to access first 66 | // memory and force you to specify the first memory. 67 | let memory = ctx.memory(0); 68 | 69 | // Get a subslice that corresponds to the memory used by the string. 70 | let str_vec: Vec<_> = memory.view()[ptr as usize..(ptr + len) as usize] 71 | .iter() 72 | .map(|cell| cell.get()) 73 | .collect(); 74 | 75 | // Convert the subslice to a `&str`. 76 | let string = str::from_utf8(&str_vec).unwrap(); 77 | 78 | // Print it! 79 | println!("{}", string); 80 | } 81 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | extern crate wasmer_runtime; 2 | 3 | use std::sync::{Arc, Mutex}; 4 | use wasmer_runtime::{error, func, imports, instantiate, Array, Ctx, WasmPtr}; 5 | 6 | // Make sure that the compiled wasm-sample-app is accessible at this path. 7 | static WASM: &'static [u8] = 8 | include_bytes!("../wasm-sample-app/target/wasm32-unknown-unknown/release/wasm_sample_app.wasm"); 9 | 10 | fn main() -> error::Result<()> { 11 | // create shared data that we'll use in 2 host functions 12 | let shared_data = Arc::new(Mutex::new(0usize)); 13 | 14 | // copy the [`Arc`] and move it into the closure 15 | let data = Arc::clone(&shared_data); 16 | let print_str2 = move |ctx: &mut Ctx, ptr: WasmPtr, len: u32| { 17 | let memory = ctx.memory(0); 18 | 19 | // Use helper method on `WasmPtr` to read a utf8 string 20 | let string = ptr.get_utf8_string(memory, len).unwrap(); 21 | 22 | // Get the value from the shared data 23 | let guard = data.lock().unwrap(); 24 | // Print it! 25 | println!("{}: {}", guard, string); 26 | }; 27 | 28 | // Copy the [`Arc`] and move it into the closure 29 | let data = Arc::clone(&shared_data); 30 | let increment_shared = move || { 31 | // get the shared data and increment it 32 | let mut guard = data.lock().unwrap(); 33 | *guard += 1; 34 | }; 35 | // Let's define the import object used to import our function 36 | // into our webassembly sample application. 37 | // 38 | // We've defined a macro that makes it super easy. 39 | // 40 | // The signature tells the runtime what the signature (the parameter 41 | // and return types) of the function we're defining here is. 42 | // The allowed types are `i32`, `u32`, `i64`, `u64`, 43 | // `f32`, and `f64`. 44 | // 45 | // Make sure to check this carefully! 46 | let import_object = imports! { 47 | // Define the "env" namespace that was implicitly used 48 | // by our sample application. 49 | "env" => { 50 | // name // the func! macro autodetects the signature 51 | "print_str" => func!(print_str), 52 | // we can use closures here too 53 | "print_str2" => func!(print_str2), 54 | "increment_shared" => func!(increment_shared), 55 | }, 56 | }; 57 | 58 | // Compile our webassembly into an `Instance`. 59 | let instance = instantiate(WASM, &import_object)?; 60 | 61 | // Call our exported function! 62 | instance.call("hello_wasm", &[])?; 63 | 64 | Ok(()) 65 | } 66 | 67 | // Let's define our "print_str" function. 68 | // 69 | // The declaration must start with "extern" or "extern "C"". 70 | fn print_str(ctx: &mut Ctx, ptr: WasmPtr, len: u32) { 71 | // Get a slice that maps to the memory currently used by the webassembly 72 | // instance. 73 | // 74 | // Webassembly only supports a single memory for now, 75 | // but in the near future, it'll support multiple. 76 | // 77 | // Therefore, we don't assume you always just want to access first 78 | // memory and force you to specify the first memory. 79 | let memory = ctx.memory(0); 80 | 81 | // Use helper method on `WasmPtr` to read a utf8 string 82 | let string = ptr.get_utf8_string(memory, len).unwrap(); 83 | 84 | // Print it! 85 | println!("{}", string); 86 | } 87 | -------------------------------------------------------------------------------- /wasm-sample-app/.cargo/config: -------------------------------------------------------------------------------- 1 | [build] 2 | target = "wasm32-unknown-unknown" -------------------------------------------------------------------------------- /wasm-sample-app/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | **/*.rs.bk 3 | Cargo.lock 4 | -------------------------------------------------------------------------------- /wasm-sample-app/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "wasm-sample-app" 3 | version = "0.1.0" 4 | authors = ["Brandon Fish "] 5 | edition = "2018" 6 | 7 | [workspace] 8 | 9 | [lib] 10 | crate-type = ["cdylib"] 11 | 12 | [dependencies] 13 | 14 | 15 | -------------------------------------------------------------------------------- /wasm-sample-app/README.md: -------------------------------------------------------------------------------- 1 | # Hello World 2 | 3 | ## Requirements 4 | - Rust target `wasm32-unknown-unknown` - install using `rustup target add wasm32-unknown-unknown` 5 | 6 | ## Building 7 | `cargo build --release` 8 | 9 | 10 | ## Pass String from Host to Wasm Example 11 | To see an example of passing a string to web assembly from rust see the `examples/string.rs` file. This can be run using `cargo run --example string`. -------------------------------------------------------------------------------- /wasm-sample-app/src/lib.rs: -------------------------------------------------------------------------------- 1 | use std::slice; 2 | use std::str; 3 | 4 | // Define a function that is imported into the module. 5 | // By default, the "env" namespace is used. 6 | extern "C" { 7 | fn print_str(ptr: *const u8, len: usize); 8 | fn print_str2(ptr: *const u8, len: usize); 9 | fn increment_shared(); 10 | } 11 | 12 | // Define a string that is accessible within the wasm 13 | // linear memory. 14 | static HELLO: &'static str = "Hello, World!"; 15 | 16 | // Export a function named "hello_wasm". This can be called 17 | // from the embedder! 18 | #[no_mangle] 19 | pub extern "C" fn hello_wasm() { 20 | // Call the function we just imported and pass in 21 | // the offset of our string and its length as parameters. 22 | unsafe { 23 | print_str(HELLO.as_ptr(), HELLO.len()); 24 | print_str2(HELLO.as_ptr(), HELLO.len()); 25 | increment_shared(); 26 | increment_shared(); 27 | print_str2(HELLO.as_ptr(), HELLO.len()); 28 | } 29 | } 30 | 31 | #[no_mangle] 32 | pub extern "C" fn hello_string_from_rust(ptr: i32, len: i32) { 33 | let slice = unsafe { slice::from_raw_parts(ptr as _, len as _) }; 34 | let string_from_host = str::from_utf8(&slice).unwrap(); 35 | let out_str = format!("Hello {}", string_from_host); 36 | unsafe { 37 | print_str(out_str.as_ptr(), out_str.len()); 38 | } 39 | } 40 | --------------------------------------------------------------------------------