Repository: Uni-Gal/Ayaka (language: rust)

Issue:
Remove WASI support
After #57 merged, the only reason to use WASI is random numbers.

It is a change to remove WASI support. It will reduce the size of runtime, and resolve the conflict between Wasmtime and Wasmi.


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 9871cbb0..ba0fd8de 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -39,7 +39,6 @@ jobs:
         run: |
           rustup target add ${{ matrix.platform.target }}
           rustup target add wasm32-unknown-unknown
-          rustup target add wasm32-wasi
       - name: Build
         run: make plugins release-cross TARGET=${{ matrix.platform.target }}
       - name: Publish plugins
diff --git a/bins/Cargo.lock b/bins/Cargo.lock
index 2a530de1..aa1cc433 100644
--- a/bins/Cargo.lock
+++ b/bins/Cargo.lock
@@ -246,12 +246,6 @@ dependencies = [
  "alloc-no-stdlib",
 ]
 
-[[package]]
-name = "ambient-authority"
-version = "0.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec8ad6edb4840b78c5c3d88de606b22252d552b55f3a4699fbb10fc070ec3049"
-
 [[package]]
 name = "android_system_properties"
 version = "0.1.5"
@@ -399,7 +393,6 @@ version = "0.1.0"
 dependencies = [
  "ayaka-plugin",
  "wasmtime",
- "wasmtime-wasi",
 ]
 
 [[package]]
@@ -428,6 +421,7 @@ dependencies = [
  "icu_locid",
  "language-matcher",
  "log",
+ "rand 0.8.5",
  "serde",
  "serde_json",
  "serde_yaml",
@@ -465,15 +459,6 @@ version = "0.1.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a"
 
-[[package]]
-name = "block-buffer"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4"
-dependencies = [
- "generic-array",
-]
-
 [[package]]
 name = "block-buffer"
 version = "0.10.3"
@@ -570,71 +555,6 @@ dependencies = [
  "system-deps 6.0.3",
 ]
 
-[[package]]
-name = "cap-fs-ext"
-version = "0.26.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b0e103ce36d217d568903ad27b14ec2238ecb5d65bad2e756a8f3c0d651506e"
-dependencies = [
- "cap-primitives",
- "cap-std",
- "io-lifetimes 0.7.5",
- "windows-sys 0.36.1",
-]
-
-[[package]]
-name = "cap-primitives"
-version = "0.26.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af3f336aa91cce16033ed3c94ac91d98956c49b420e6d6cd0dd7d0e386a57085"
-dependencies = [
- "ambient-authority",
- "fs-set-times",
- "io-extras",
- "io-lifetimes 0.7.5",
- "ipnet",
- "maybe-owned",
- "rustix 0.35.13",
- "winapi-util",
- "windows-sys 0.36.1",
- "winx",
-]
-
-[[package]]
-name = "cap-rand"
-version = "0.26.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d14b9606aa9550d34651bc481443203bc014237bdb992d201d2afa62d2ec6dea"
-dependencies = [
- "ambient-authority",
- "rand 0.8.5",
-]
-
-[[package]]
-name = "cap-std"
-version = "0.26.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c9d6e70b626eceac9d6fc790fe2d72cc3f2f7bc3c35f467690c54a526b0f56db"
-dependencies = [
- "cap-primitives",
- "io-extras",
- "io-lifetimes 0.7.5",
- "ipnet",
- "rustix 0.35.13",
-]
-
-[[package]]
-name = "cap-time-ext"
-version = "0.26.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c3a0524f7c4cff2ea547ae2b652bf7a348fd3e48f76556dc928d8b45ab2f1d50"
-dependencies = [
- "cap-primitives",
- "once_cell",
- "rustix 0.35.13",
- "winx",
-]
-
 [[package]]
 name = "cargo_toml"
 version = "0.13.0"
@@ -731,7 +651,7 @@ dependencies = [
  "bitflags",
  "clap_derive",
  "clap_lex 0.3.0",
- "is-terminal 0.4.1",
+ "is-terminal",
  "once_cell",
  "strsim",
  "termcolor",
@@ -909,24 +829,25 @@ dependencies = [
 
 [[package]]
 name = "cranelift-bforest"
-version = "0.89.2"
+version = "0.90.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "593b398dd0c5b1e2e3a9c3dae8584e287894ea84e361949ad506376e99196265"
+checksum = "b62c772976416112fa4484cbd688cb6fb35fd430005c1c586224fc014018abad"
 dependencies = [
  "cranelift-entity",
 ]
 
 [[package]]
 name = "cranelift-codegen"
-version = "0.89.2"
+version = "0.90.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "afc0d8faabd099ea15ab33d49d150e5572c04cfeb95d675fd41286739b754629"
+checksum = "9b40ed2dd13c2ac7e24f88a3090c68ad3414eb1d066a95f8f1f7b3b819cb4e46"
 dependencies = [
  "arrayvec",
  "bumpalo",
  "cranelift-bforest",
  "cranelift-codegen-meta",
  "cranelift-codegen-shared",
+ "cranelift-egraph",
  "cranelift-entity",
  "cranelift-isle",
  "gimli",
@@ -938,33 +859,47 @@ dependencies = [
 
 [[package]]
 name = "cranelift-codegen-meta"
-version = "0.89.2"
+version = "0.90.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ac1669e42579476f001571d6ba4b825fac686282c97b88b18f8e34242066a81"
+checksum = "bb927a8f1c27c34ee3759b6b0ffa528d2330405d5cc4511f0cab33fe2279f4b5"
 dependencies = [
  "cranelift-codegen-shared",
 ]
 
 [[package]]
 name = "cranelift-codegen-shared"
-version = "0.89.2"
+version = "0.90.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e2a1b1eef9640ab72c1e7b583ac678083855a509da34b4b4378bd99954127c20"
+checksum = "43dfa417b884a9ab488d95fd6b93b25e959321fe7bfd7a0a960ba5d7fb7ab927"
+
+[[package]]
+name = "cranelift-egraph"
+version = "0.90.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e0a66b39785efd8513d2cca967ede56d6cc57c8d7986a595c7c47d0c78de8dce"
+dependencies = [
+ "cranelift-entity",
+ "fxhash",
+ "hashbrown",
+ "indexmap",
+ "log",
+ "smallvec",
+]
 
 [[package]]
 name = "cranelift-entity"
-version = "0.89.2"
+version = "0.90.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eea4e17c3791fd8134640b26242a9ddbd7c67db78f0bad98cb778bf563ef81a0"
+checksum = "0637ffde963cb5d759bc4d454cfa364b6509e6c74cdaa21298add0ed9276f346"
 dependencies = [
  "serde",
 ]
 
 [[package]]
 name = "cranelift-frontend"
-version = "0.89.2"
+version = "0.90.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fca1474b5302348799656d43a40eacd716a3b46169405a3af812832c9edf77b4"
+checksum = "fb72b8342685e850cb037350418f62cc4fc55d6c2eb9c7ca01b82f9f1a6f3d56"
 dependencies = [
  "cranelift-codegen",
  "log",
@@ -974,15 +909,15 @@ dependencies = [
 
 [[package]]
 name = "cranelift-isle"
-version = "0.89.2"
+version = "0.90.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "77aa537f020ea43483100153278e7215d41695bdcef9eea6642d122675f64249"
+checksum = "850579cb9e4b448f7c301f1e6e6cbad99abe3f1f1d878a4994cb66e33c6db8cd"
 
 [[package]]
 name = "cranelift-native"
-version = "0.89.2"
+version = "0.90.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8bdc6b65241a95b7d8eafbf4e114c082e49b80162a2dcd9c6bcc5989c3310c9e"
+checksum = "2d0a279e5bcba3e0466c734d8d8eb6bfc1ad29e95c37f3e4955b492b5616335e"
 dependencies = [
  "cranelift-codegen",
  "libc",
@@ -991,9 +926,9 @@ dependencies = [
 
 [[package]]
 name = "cranelift-wasm"
-version = "0.89.2"
+version = "0.90.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4eb6359f606a1c80ccaa04fae9dbbb504615ec7a49b6c212b341080fff7a65dd"
+checksum = "e6b8c5e7ffb754093fb89ec4bd4f9dbb9f1c955427299e334917d284745835c2"
 dependencies = [
  "cranelift-codegen",
  "cranelift-entity",
@@ -1237,22 +1172,13 @@ dependencies = [
  "syn",
 ]
 
-[[package]]
-name = "digest"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066"
-dependencies = [
- "generic-array",
-]
-
 [[package]]
 name = "digest"
 version = "0.10.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f"
 dependencies = [
- "block-buffer 0.10.3",
+ "block-buffer",
  "crypto-common",
 ]
 
@@ -1266,15 +1192,6 @@ dependencies = [
  "dirs-sys-next",
 ]
 
-[[package]]
-name = "dirs"
-version = "4.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059"
-dependencies = [
- "dirs-sys",
-]
-
 [[package]]
 name = "dirs-next"
 version = "2.0.0"
@@ -1285,17 +1202,6 @@ dependencies = [
  "dirs-sys-next",
 ]
 
-[[package]]
-name = "dirs-sys"
-version = "0.3.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6"
-dependencies = [
- "libc",
- "redox_users",
- "winapi",
-]
-
 [[package]]
 name = "dirs-sys-next"
 version = "0.1.2"
@@ -1533,17 +1439,6 @@ dependencies = [
  "vfs",
 ]
 
-[[package]]
-name = "fs-set-times"
-version = "0.17.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a267b6a9304912e018610d53fe07115d8b530b160e85db4d2d3a59f3ddde1aec"
-dependencies = [
- "io-lifetimes 0.7.5",
- "rustix 0.35.13",
- "windows-sys 0.36.1",
-]
-
 [[package]]
 name = "futf"
 version = "0.1.5"
@@ -2217,25 +2112,11 @@ dependencies = [
  "cfg-if",
 ]
 
-[[package]]
-name = "io-extras"
-version = "0.15.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4a5d8c2ab5becd8720e30fd25f8fa5500d8dc3fceadd8378f05859bd7b46fc49"
-dependencies = [
- "io-lifetimes 0.7.5",
- "windows-sys 0.36.1",
-]
-
 [[package]]
 name = "io-lifetimes"
 version = "0.7.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "59ce5ef949d49ee85593fc4d3f3f95ad61657076395cbbce23e2121fc5542074"
-dependencies = [
- "libc",
- "windows-sys 0.42.0",
-]
 
 [[package]]
 name = "io-lifetimes"
@@ -2247,24 +2128,6 @@ dependencies = [
  "windows-sys 0.42.0",
 ]
 
-[[package]]
-name = "ipnet"
-version = "2.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "11b0d96e660696543b251e58030cf9787df56da39dab19ad60eae7353040917e"
-
-[[package]]
-name = "is-terminal"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0d508111813f9af3afd2f92758f77e4ed2cc9371b642112c6a48d22eb73105c5"
-dependencies = [
- "hermit-abi 0.2.6",
- "io-lifetimes 0.7.5",
- "rustix 0.35.13",
- "windows-sys 0.36.1",
-]
-
 [[package]]
 name = "is-terminal"
 version = "0.4.1"
@@ -2582,12 +2445,6 @@ version = "0.1.9"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"
 
-[[package]]
-name = "maybe-owned"
-version = "0.3.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4facc753ae494aeb6e3c22f839b158aebd4f9270f55cd3c79906c45476c47ab4"
-
 [[package]]
 name = "memchr"
 version = "2.5.0"
@@ -2815,12 +2672,6 @@ version = "1.16.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860"
 
-[[package]]
-name = "opaque-debug"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
-
 [[package]]
 name = "os_str_bytes"
 version = "6.4.1"
@@ -3389,10 +3240,8 @@ dependencies = [
  "bitflags",
  "errno",
  "io-lifetimes 0.7.5",
- "itoa 1.0.4",
  "libc",
  "linux-raw-sys 0.0.46",
- "once_cell",
  "windows-sys 0.42.0",
 ]
 
@@ -3671,20 +3520,7 @@ checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3"
 dependencies = [
  "cfg-if",
  "cpufeatures",
- "digest 0.10.6",
-]
-
-[[package]]
-name = "sha2"
-version = "0.9.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800"
-dependencies = [
- "block-buffer 0.9.0",
- "cfg-if",
- "cpufeatures",
- "digest 0.9.0",
- "opaque-debug",
+ "digest",
 ]
 
 [[package]]
@@ -3695,7 +3531,7 @@ checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0"
 dependencies = [
  "cfg-if",
  "cpufeatures",
- "digest 0.10.6",
+ "digest",
 ]
 
 [[package]]
@@ -3707,15 +3543,6 @@ dependencies = [
  "lazy_static",
 ]
 
-[[package]]
-name = "shellexpand"
-version = "2.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ccc8076840c4da029af4f87e4e8daeb0fca6b87bbb02e10cb60b791450e11e4"
-dependencies = [
- "dirs",
-]
-
 [[package]]
 name = "signal-hook-registry"
 version = "1.4.0"
@@ -3921,22 +3748,6 @@ dependencies = [
  "version-compare 0.1.1",
 ]
 
-[[package]]
-name = "system-interface"
-version = "0.23.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "92adbaf536f5aff6986e1e62ba36cee72b1718c5153eee08b9e728ddde3f6029"
-dependencies = [
- "atty",
- "bitflags",
- "cap-fs-ext",
- "cap-std",
- "io-lifetimes 0.7.5",
- "rustix 0.35.13",
- "windows-sys 0.36.1",
- "winx",
-]
-
 [[package]]
 name = "tao"
 version = "0.15.7"
@@ -4079,7 +3890,7 @@ dependencies = [
  "semver 1.0.14",
  "serde",
  "serde_json",
- "sha2 0.10.6",
+ "sha2",
  "tauri-utils",
  "thiserror",
  "time",
@@ -4601,48 +4412,6 @@ version = "0.11.0+wasi-snapshot-preview1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
 
-[[package]]
-name = "wasi-cap-std-sync"
-version = "2.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c4b4953999c746173c263b81e9e5e3e335ff47face7187ba2a5ecc91c716e6f3"
-dependencies = [
- "anyhow",
- "async-trait",
- "cap-fs-ext",
- "cap-rand",
- "cap-std",
- "cap-time-ext",
- "fs-set-times",
- "io-extras",
- "io-lifetimes 0.7.5",
- "is-terminal 0.3.0",
- "once_cell",
- "rustix 0.35.13",
- "system-interface",
- "tracing",
- "wasi-common",
- "windows-sys 0.36.1",
-]
-
-[[package]]
-name = "wasi-common"
-version = "2.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d47faf4f76ebfdeb1f3346a949c6fbf2f2471afc68280b00c76d6c02221d80ad"
-dependencies = [
- "anyhow",
- "bitflags",
- "cap-rand",
- "cap-std",
- "io-extras",
- "rustix 0.35.13",
- "thiserror",
- "tracing",
- "wiggle",
- "windows-sys 0.36.1",
-]
-
 [[package]]
 name = "wasm-bindgen"
 version = "0.2.83"
@@ -4708,18 +4477,18 @@ dependencies = [
 
 [[package]]
 name = "wasmparser"
-version = "0.92.0"
+version = "0.93.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7da34cec2a8c23db906cdf8b26e988d7a7f0d549eb5d51299129647af61a1b37"
+checksum = "c5a4460aa3e271fa180b6a5d003e728f3963fb30e3ba0fa7c9634caa06049328"
 dependencies = [
  "indexmap",
 ]
 
 [[package]]
 name = "wasmtime"
-version = "2.0.2"
+version = "3.0.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "743d37c265fa134a76de653c7e66be22590eaccd03da13cee99f3ac7a59cb826"
+checksum = "d18265705b1c49218776577d9f301d79ab06888c7f4a32e2ed24e68a55738ce7"
 dependencies = [
  "anyhow",
  "async-trait",
@@ -4748,18 +4517,18 @@ dependencies = [
 
 [[package]]
 name = "wasmtime-asm-macros"
-version = "2.0.2"
+version = "3.0.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "de327cf46d5218315957138131ed904621e6f99018aa2da508c0dcf0c65f1bf2"
+checksum = "a201583f6c79b96e74dcce748fa44fb2958f474ef13c93f880ea4d3bed31ae4f"
 dependencies = [
  "cfg-if",
 ]
 
 [[package]]
 name = "wasmtime-cache"
-version = "2.0.2"
+version = "3.0.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "42bd53d27df1076100519b680b45d8209aed62b4bbaf0913732810cb216f7b2b"
+checksum = "3f37efc6945b08fcb634cffafc438dd299bac55a27c836954656c634d3e63c31"
 dependencies = [
  "anyhow",
  "base64",
@@ -4769,7 +4538,7 @@ dependencies = [
  "log",
  "rustix 0.35.13",
  "serde",
- "sha2 0.9.9",
+ "sha2",
  "toml",
  "windows-sys 0.36.1",
  "zstd",
@@ -4777,9 +4546,9 @@ dependencies = [
 
 [[package]]
 name = "wasmtime-cranelift"
-version = "2.0.2"
+version = "3.0.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "017c3605ccce867b3ba7f71d95e5652acc22b9dc2971ad6a6f9df4a8d7af2648"
+checksum = "fe208297e045ea0ee6702be88772ea40f918d55fbd4163981a4699aff034b634"
 dependencies = [
  "anyhow",
  "cranelift-codegen",
@@ -4798,9 +4567,9 @@ dependencies = [
 
 [[package]]
 name = "wasmtime-environ"
-version = "2.0.2"
+version = "3.0.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6aec5c1f81aab9bb35997113c171b6bb9093afc90e3757c55e0c08dc9ac612e4"
+checksum = "754b97f7441ac780a7fa738db5b9c23c1b70ef4abccd8ad205ada5669d196ba2"
 dependencies = [
  "anyhow",
  "cranelift-entity",
@@ -4817,9 +4586,9 @@ dependencies = [
 
 [[package]]
 name = "wasmtime-fiber"
-version = "2.0.2"
+version = "3.0.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1075aa43857086ef89afbe87602fe2dae98ad212582e722b6d3d2676bb5ee141"
+checksum = "e5f54abc960b4a055ba16b942cbbd1da641e0ad44cc97a7608f3d43c069b120e"
 dependencies = [
  "cc",
  "cfg-if",
@@ -4830,9 +4599,9 @@ dependencies = [
 
 [[package]]
 name = "wasmtime-jit"
-version = "2.0.2"
+version = "3.0.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "08c683893dbba3986aa71582a5332b87157fb95d34098de2e5f077c7f078726d"
+checksum = "32800cb6e29faabab7056593f70a4c00c65c75c365aaf05406933f2169d0c22f"
 dependencies = [
  "addr2line",
  "anyhow",
@@ -4844,32 +4613,43 @@ dependencies = [
  "log",
  "object",
  "rustc-demangle",
- "rustix 0.35.13",
  "serde",
  "target-lexicon",
  "thiserror",
  "wasmtime-environ",
  "wasmtime-jit-debug",
+ "wasmtime-jit-icache-coherence",
  "wasmtime-runtime",
  "windows-sys 0.36.1",
 ]
 
 [[package]]
 name = "wasmtime-jit-debug"
-version = "2.0.2"
+version = "3.0.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b2f8f15a81292eec468c79a4f887a37a3d02eb0c610f34ddbec607d3e9022f18"
+checksum = "fe057012a0ba6cee3685af1e923d6e0a6cb9baf15fb3ffa4be3d7f712c7dec42"
 dependencies = [
  "object",
  "once_cell",
  "rustix 0.35.13",
 ]
 
+[[package]]
+name = "wasmtime-jit-icache-coherence"
+version = "2.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e6bbabb309c06cc238ee91b1455b748c45f0bdcab0dda2c2db85b0a1e69fcb66"
+dependencies = [
+ "cfg-if",
+ "libc",
+ "windows-sys 0.36.1",
+]
+
 [[package]]
 name = "wasmtime-runtime"
-version = "2.0.2"
+version = "3.0.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09af6238c962e8220424c815a7b1a9a6d0ba0694f0ab0ae12a6cda1923935a0d"
+checksum = "09a23b6e138e89594c0189162e524a29e217aec8f9a4e1959a34f74c64e8d17d"
 dependencies = [
  "anyhow",
  "cc",
@@ -4893,9 +4673,9 @@ dependencies = [
 
 [[package]]
 name = "wasmtime-types"
-version = "2.0.2"
+version = "3.0.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5dc3dd9521815984b35d6362f79e6b9c72475027cd1c71c44eb8df8fbf33a9fb"
+checksum = "68ec7615fde8c79737f1345d81f0b18da83b3db929a87b4604f27c932246d1e2"
 dependencies = [
  "cranelift-entity",
  "serde",
@@ -4903,28 +4683,6 @@ dependencies = [
  "wasmparser",
 ]
 
-[[package]]
-name = "wasmtime-wasi"
-version = "2.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a3bba5cc0a940cef3fbbfa7291c7e5fe0f7ec6fb2efa7bd1504032ed6202a1c0"
-dependencies = [
- "anyhow",
- "wasi-cap-std-sync",
- "wasi-common",
- "wasmtime",
- "wiggle",
-]
-
-[[package]]
-name = "wast"
-version = "35.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2ef140f1b49946586078353a453a1d28ba90adfc54dde75710bc1931de204d68"
-dependencies = [
- "leb128",
-]
-
 [[package]]
 name = "wast"
 version = "50.0.0"
@@ -4943,7 +4701,7 @@ version = "1.0.52"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "584aaf7a1ecf4d383bbe1a25eeab0cbb8ff96acc6796707ff65cde48f4632f15"
 dependencies = [
- "wast 50.0.0",
+ "wast",
 ]
 
 [[package]]
@@ -5041,48 +4799,6 @@ dependencies = [
  "windows-metadata",
 ]
 
-[[package]]
-name = "wiggle"
-version = "2.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "211ef4d238fd83bbe6f1bc57f3e2e20dc8b1f999188be252e7a535b696c6f84f"
-dependencies = [
- "anyhow",
- "async-trait",
- "bitflags",
- "thiserror",
- "tracing",
- "wasmtime",
- "wiggle-macro",
-]
-
-[[package]]
-name = "wiggle-generate"
-version = "2.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "63feec26b2fc3708c7a63316949ca75dd96988f03a17e4cb8d533dc62587ada4"
-dependencies = [
- "anyhow",
- "heck 0.4.0",
- "proc-macro2",
- "quote",
- "shellexpand",
- "syn",
- "witx",
-]
-
-[[package]]
-name = "wiggle-macro"
-version = "2.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "494dc2646618c2b7fb0ec5e1d27dbac5ca31194c00a64698a4b5b35a83d80c21"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
- "wiggle-generate",
-]
-
 [[package]]
 name = "winapi"
 version = "0.3.9"
@@ -5299,29 +5015,6 @@ dependencies = [
  "toml",
 ]
 
-[[package]]
-name = "winx"
-version = "0.33.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b7b01e010390eb263a4518c8cebf86cb67469d1511c00b749a47b64c39e8054d"
-dependencies = [
- "bitflags",
- "io-lifetimes 0.7.5",
- "windows-sys 0.36.1",
-]
-
-[[package]]
-name = "witx"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e366f27a5cabcddb2706a78296a40b8fcc451e1a6aba2fc1d94b4a01bdaaef4b"
-dependencies = [
- "anyhow",
- "log",
- "thiserror",
- "wast 35.0.2",
-]
-
 [[package]]
 name = "writeable"
 version = "0.5.0"
@@ -5354,7 +5047,7 @@ dependencies = [
  "once_cell",
  "serde",
  "serde_json",
- "sha2 0.10.6",
+ "sha2",
  "soup2",
  "tao",
  "thiserror",
diff --git a/book/src/plugin/summary.md b/book/src/plugin/summary.md
index bf23784a..b8d0f802 100644
--- a/book/src/plugin/summary.md
+++ b/book/src/plugin/summary.md
@@ -1,6 +1,6 @@
 # Plugin
 All plugins should target WebAssembly.
-We now support `wasm32-unknown-unknown` and `wasm32-wasi` targets.
+We now support `wasm32-unknown-unknown` target.
 
 The plugin runtime is supported by [Wasmer](https://wasmer.io/).
 Our [platform support](../platforms.md) is largely limited by this engine.
diff --git a/book/src/quick_start.md b/book/src/quick_start.md
index ec2f275e..1102aa76 100644
--- a/book/src/quick_start.md
+++ b/book/src/quick_start.md
@@ -28,7 +28,6 @@ $ cd Ayaka
 
 ## Add targets for WebAssembly
 ``` bash
-$ rustup target add wasm32-wasi
 $ rustup target add wasm32-unknown-unknown
 ```
 
diff --git a/plugins/.cargo/config.toml b/plugins/.cargo/config.toml
new file mode 100644
index 00000000..f4e8c002
--- /dev/null
+++ b/plugins/.cargo/config.toml
@@ -0,0 +1,2 @@
+[build]
+target = "wasm32-unknown-unknown"
diff --git a/plugins/Cargo.lock b/plugins/Cargo.lock
index ee34600c..e03002cf 100644
--- a/plugins/Cargo.lock
+++ b/plugins/Cargo.lock
@@ -667,12 +667,6 @@ version = "0.4.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "db8bcd96cb740d03149cbad5518db9fd87126a10ab519c011893b1754134c468"
 
-[[package]]
-name = "ppv-lite86"
-version = "0.2.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
-
 [[package]]
 name = "precomputed-hash"
 version = "0.1.1"
@@ -720,43 +714,11 @@ dependencies = [
  "proc-macro2",
 ]
 
-[[package]]
-name = "rand"
-version = "0.8.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
-dependencies = [
- "libc",
- "rand_chacha",
- "rand_core",
-]
-
-[[package]]
-name = "rand_chacha"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
-dependencies = [
- "ppv-lite86",
- "rand_core",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.6.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
-dependencies = [
- "getrandom",
-]
-
 [[package]]
 name = "random"
 version = "0.1.0"
 dependencies = [
  "ayaka-bindings",
- "rand",
- "trylog",
 ]
 
 [[package]]
diff --git a/plugins/Cargo.toml b/plugins/Cargo.toml
index f184c40f..8e41f25d 100644
--- a/plugins/Cargo.toml
+++ b/plugins/Cargo.toml
@@ -9,6 +9,8 @@ members = [
     "random",
 ]
 
+resolver = "2"
+
 [profile.release]
 lto = true
 codegen-units = 1
diff --git a/plugins/Makefile b/plugins/Makefile
index 9b553d3d..97fc3014 100644
--- a/plugins/Makefile
+++ b/plugins/Makefile
@@ -1,3 +1,5 @@
+PLUGIN_TARGET:=wasm32-unknown-unknown
+
 .PHONY: test clean update
 clean:
 	cargo clean
@@ -6,7 +8,6 @@ update:
 
 .PHONY: plugins
 plugins:
-	cargo build --release
+	cargo build --target $(PLUGIN_TARGET) --release
 	mkdir -p ../examples/plugins
-	cp target/wasm32-wasi/release/*.wasm ../examples/plugins/
-	cp target/wasm32-unknown-unknown/release/*.wasm ../examples/plugins/
+	cp target/$(PLUGIN_TARGET)/release/*.wasm ../examples/plugins/
diff --git a/plugins/ayacript/Cargo.toml b/plugins/ayacript/Cargo.toml
index 7d60146d..d8aaaab0 100644
--- a/plugins/ayacript/Cargo.toml
+++ b/plugins/ayacript/Cargo.toml
@@ -1,10 +1,7 @@
-cargo-features = ["per-package-target"]
-
 [package]
 name = "ayacript"
 version = "0.1.0"
 edition = "2021"
-forced-target = "wasm32-unknown-unknown"
 
 [lib]
 crate-type = ["cdylib"]
diff --git a/plugins/ayalog/Cargo.toml b/plugins/ayalog/Cargo.toml
index bd7106d5..169abed9 100644
--- a/plugins/ayalog/Cargo.toml
+++ b/plugins/ayalog/Cargo.toml
@@ -1,10 +1,7 @@
-cargo-features = ["per-package-target"]
-
 [package]
 name = "ayalog"
 version = "0.1.0"
 edition = "2021"
-forced-target = "wasm32-unknown-unknown"
 
 [lib]
 crate-type = ["cdylib"]
diff --git a/plugins/basictex/Cargo.toml b/plugins/basictex/Cargo.toml
index 31433a0a..802129d8 100644
--- a/plugins/basictex/Cargo.toml
+++ b/plugins/basictex/Cargo.toml
@@ -1,10 +1,7 @@
-cargo-features = ["per-package-target"]
-
 [package]
 name = "basictex"
 version = "0.1.0"
 edition = "2021"
-forced-target = "wasm32-unknown-unknown"
 
 [lib]
 crate-type = ["cdylib"]
diff --git a/plugins/live2d/Cargo.toml b/plugins/live2d/Cargo.toml
index a1f9d04c..6c8f5064 100644
--- a/plugins/live2d/Cargo.toml
+++ b/plugins/live2d/Cargo.toml
@@ -1,10 +1,7 @@
-cargo-features = ["per-package-target"]
-
 [package]
 name = "live2d"
 version = "0.1.0"
 edition = "2021"
-forced-target = "wasm32-unknown-unknown"
 
 [lib]
 crate-type = ["cdylib"]
diff --git a/plugins/markdown/Cargo.toml b/plugins/markdown/Cargo.toml
index 7a39e6da..7860e711 100644
--- a/plugins/markdown/Cargo.toml
+++ b/plugins/markdown/Cargo.toml
@@ -1,10 +1,7 @@
-cargo-features = ["per-package-target"]
-
 [package]
 name = "markdown"
 version = "0.1.0"
 edition = "2021"
-forced-target = "wasm32-unknown-unknown"
 
 [lib]
 crate-type = ["cdylib"]
diff --git a/plugins/media/Cargo.toml b/plugins/media/Cargo.toml
index bce3112f..35a2b767 100644
--- a/plugins/media/Cargo.toml
+++ b/plugins/media/Cargo.toml
@@ -1,10 +1,7 @@
-cargo-features = ["per-package-target"]
-
 [package]
 name = "media"
 version = "0.1.0"
 edition = "2021"
-forced-target = "wasm32-unknown-unknown"
 
 [lib]
 crate-type = ["cdylib"]
diff --git a/plugins/random/Cargo.toml b/plugins/random/Cargo.toml
index cb2f6cee..8e6aeab0 100644
--- a/plugins/random/Cargo.toml
+++ b/plugins/random/Cargo.toml
@@ -1,15 +1,10 @@
-cargo-features = ["per-package-target"]
-
 [package]
 name = "random"
 version = "0.1.0"
 edition = "2021"
-forced-target = "wasm32-wasi"
 
 [lib]
 crate-type = ["cdylib"]
 
 [dependencies]
 ayaka-bindings = { workspace = true }
-trylog = { workspace = true }
-rand = "0.8"
diff --git a/plugins/random/src/lib.rs b/plugins/random/src/lib.rs
index e36bc0ab..f349fba6 100644
--- a/plugins/random/src/lib.rs
+++ b/plugins/random/src/lib.rs
@@ -1,29 +1,23 @@
 #![deny(unsafe_code)]
-#![feature(once_cell)]
 
 use ayaka_bindings::*;
-use rand::{rngs::StdRng, Rng, SeedableRng};
-use std::sync::{LazyLock, Mutex};
-use trylog::macros::*;
 
 #[export]
 fn plugin_type() -> PluginType {
     PluginType::default()
 }
 
-static RNG: LazyLock<Mutex<StdRng>> = LazyLock::new(|| Mutex::new(StdRng::from_entropy()));
+#[import("rand")]
+extern "C" {
+    fn __rnd(start: i64, end: i64) -> i64;
+}
 
 #[export]
 fn rnd(args: Vec<RawValue>) -> RawValue {
-    unwrap_or_default_log!(
-        RNG.lock().map(|mut rng| {
-            let res = match args.len() {
-                0 => rng.gen(),
-                1 => rng.gen_range(0..args[0].get_num()),
-                _ => rng.gen_range(args[0].get_num()..args[1].get_num()),
-            };
-            RawValue::Num(res)
-        }),
-        "Cannot get random engine"
-    )
+    let res = match args.len() {
+        0 => __rnd(0, i64::MAX),
+        1 => __rnd(0, args[0].get_num()),
+        _ => __rnd(args[0].get_num(), args[1].get_num()),
+    };
+    RawValue::Num(res)
 }
diff --git a/utils/ayaka-plugin-wasmer/Cargo.toml b/utils/ayaka-plugin-wasmer/Cargo.toml
index 61a644f9..97dd8f9e 100644
--- a/utils/ayaka-plugin-wasmer/Cargo.toml
+++ b/utils/ayaka-plugin-wasmer/Cargo.toml
@@ -6,4 +6,3 @@ edition = "2021"
 [dependencies]
 ayaka-plugin = { workspace = true }
 wasmer = "3.0"
-wasmer-wasi = "3.0"
diff --git a/utils/ayaka-plugin-wasmer/src/lib.rs b/utils/ayaka-plugin-wasmer/src/lib.rs
index b0d91169..010b7086 100644
--- a/utils/ayaka-plugin-wasmer/src/lib.rs
+++ b/utils/ayaka-plugin-wasmer/src/lib.rs
@@ -8,7 +8,6 @@ use std::{
     sync::{Arc, Mutex},
 };
 use wasmer::*;
-use wasmer_wasi::*;
 
 unsafe fn mem_slice<R>(
     store: &impl AsStoreRef,
@@ -173,7 +172,6 @@ impl RuntimeInstanceData {
 /// A Wasmer [`Store`] with some imports.
 pub struct WasmerLinker {
     store: HostStore,
-    wasi_env: WasiEnv,
     imports: HashMap<String, HashMap<String, WasmerFunction>>,
 }
 
@@ -192,11 +190,8 @@ impl WasmerLinker {
 impl Linker<WasmerModule> for WasmerLinker {
     fn new() -> Result<Self> {
         let store = Store::default();
-        let wasi_state = WasiState::new("ayaka-plugin-wasmer").build()?;
-        let wasi_env = WasiEnv::new(wasi_state);
         Ok(Self {
             store: Arc::new(Mutex::new(store)),
-            wasi_env,
             imports: HashMap::default(),
         })
     }
@@ -205,16 +200,10 @@ impl Linker<WasmerModule> for WasmerLinker {
         let instance = {
             let mut store = self.store.lock().unwrap();
             let module = Module::from_binary(&store.as_store_ref(), binary)?;
-            let wasi_env = self.wasi_env.clone();
-            let mut wasi_env = WasiFunctionEnv::new(&mut store.as_store_mut(), wasi_env);
-            let mut wasi_import = generate_import_object_from_env(
-                &mut store.as_store_mut(),
-                &wasi_env.env,
-                WasiVersion::Latest,
-            );
+            let mut imports = Imports::default();
             let mut envs = vec![];
             for (ns, funcs) in &self.imports {
-                wasi_import.register_namespace(
+                imports.register_namespace(
                     ns,
                     funcs.iter().map(|(name, func)| {
                         (
@@ -231,8 +220,7 @@ impl Linker<WasmerModule> for WasmerLinker {
                     }),
                 );
             }
-            let instance = Instance::new(&mut store.as_store_mut(), &module, &wasi_import)?;
-            wasi_env.initialize(&mut store.as_store_mut(), &instance)?;
+            let instance = Instance::new(&mut store.as_store_mut(), &module, &imports)?;
             let memory = instance.exports.get_memory(MEMORY_NAME)?;
             let abi_alloc = instance
                 .exports
diff --git a/utils/ayaka-plugin-wasmi/Cargo.toml b/utils/ayaka-plugin-wasmi/Cargo.toml
index 6e4d273f..fd35ca07 100644
--- a/utils/ayaka-plugin-wasmi/Cargo.toml
+++ b/utils/ayaka-plugin-wasmi/Cargo.toml
@@ -6,4 +6,3 @@ edition = "2021"
 [dependencies]
 ayaka-plugin = { workspace = true }
 wasmi = { git = "https://github.com/paritytech/wasmi.git" }
-wasmi_wasi = { git = "https://github.com/paritytech/wasmi.git" }
diff --git a/utils/ayaka-plugin-wasmi/src/lib.rs b/utils/ayaka-plugin-wasmi/src/lib.rs
index cb7e414d..555ea8dc 100644
--- a/utils/ayaka-plugin-wasmi/src/lib.rs
+++ b/utils/ayaka-plugin-wasmi/src/lib.rs
@@ -8,7 +8,6 @@ use std::{
     sync::{Arc, Mutex},
 };
 use wasmi::{core::Trap, *};
-use wasmi_wasi::*;
 
 unsafe fn mem_slice<'a, T: 'a>(
     store: impl Into<StoreContext<'a, T>>,
@@ -34,7 +33,7 @@ unsafe fn mem_slice_mut<'a, T: 'a>(
         .get_unchecked_mut(..len as usize)
 }
 
-type HostStore = Arc<Mutex<Store<WasiCtx>>>;
+type HostStore = Arc<Mutex<Store<()>>>;
 
 /// A Wasmi [`Instance`].
 pub struct WasmiModule {
@@ -46,7 +45,7 @@ pub struct WasmiModule {
 }
 
 impl WasmiModule {
-    fn new(store: HostStore, module: &Module, linker: &wasmi::Linker<WasiCtx>) -> Result<Self> {
+    fn new(store: HostStore, module: &Module, linker: &wasmi::Linker<()>) -> Result<Self> {
         let mut inner_store = store.lock().unwrap();
         let instance = linker
             .instantiate(inner_store.as_context_mut(), module)?
@@ -80,7 +79,7 @@ impl WasmiModule {
 
     fn call_impl<T>(
         &self,
-        mut store: StoreContextMut<WasiCtx>,
+        mut store: StoreContextMut<()>,
         name: &str,
         data: &[u8],
         f: impl FnOnce(&[u8]) -> Result<T>,
@@ -132,16 +131,14 @@ impl RawModule for WasmiModule {
 pub struct WasmiLinker {
     engine: Engine,
     store: HostStore,
-    linker: wasmi::Linker<WasiCtx>,
+    linker: wasmi::Linker<()>,
 }
 
 impl ayaka_plugin::Linker<WasmiModule> for WasmiLinker {
     fn new() -> Result<Self> {
         let engine = Engine::default();
-        let wasi = WasiCtxBuilder::new().inherit_stdio().build();
-        let mut store = Store::new(&engine, wasi);
-        let mut linker = wasmi::Linker::new();
-        define_wasi(&mut linker, &mut store, |ctx| ctx)?;
+        let store = Store::new(&engine, ());
+        let linker = wasmi::Linker::new();
         Ok(Self {
             engine,
             store: Arc::new(Mutex::new(store)),
@@ -169,7 +166,7 @@ impl ayaka_plugin::Linker<WasmiModule> for WasmiLinker {
     ) -> Func {
         Func::wrap(
             self.store.lock().unwrap().as_context_mut(),
-            move |mut store: Caller<WasiCtx>, len: i32, data: i32| unsafe {
+            move |mut store: Caller<()>, len: i32, data: i32| unsafe {
                 let memory = store
                     .get_export(MEMORY_NAME)
                     .unwrap()
@@ -198,7 +195,7 @@ impl ayaka_plugin::Linker<WasmiModule> for WasmiLinker {
 
 /// A Wasmi [`StoreContextMut`].
 pub struct WasmiLinkerHandle<'a> {
-    store: StoreContextMut<'a, WasiCtx>,
+    store: StoreContextMut<'a, ()>,
     memory: Memory,
 }
 
diff --git a/utils/ayaka-plugin-wasmtime/Cargo.toml b/utils/ayaka-plugin-wasmtime/Cargo.toml
index fc2909fc..a1c7c45f 100644
--- a/utils/ayaka-plugin-wasmtime/Cargo.toml
+++ b/utils/ayaka-plugin-wasmtime/Cargo.toml
@@ -5,5 +5,4 @@ edition = "2021"
 
 [dependencies]
 ayaka-plugin = { workspace = true }
-wasmtime = "2.0"
-wasmtime-wasi = "2.0"
+wasmtime = "3.0"
diff --git a/utils/ayaka-plugin-wasmtime/src/lib.rs b/utils/ayaka-plugin-wasmtime/src/lib.rs
index 07e6064c..5bcb867b 100644
--- a/utils/ayaka-plugin-wasmtime/src/lib.rs
+++ b/utils/ayaka-plugin-wasmtime/src/lib.rs
@@ -8,7 +8,6 @@ use std::{
     sync::{Arc, Mutex},
 };
 use wasmtime::*;
-use wasmtime_wasi::*;
 
 unsafe fn mem_slice<'a, T: 'a>(
     store: impl Into<StoreContext<'a, T>>,
@@ -34,7 +33,7 @@ unsafe fn mem_slice_mut<'a, T: 'a>(
         .get_unchecked_mut(..len as usize)
 }
 
-type HostStore = Arc<Mutex<Store<WasiCtx>>>;
+type HostStore = Arc<Mutex<Store<()>>>;
 
 /// A Wasmtime [`Instance`].
 pub struct WasmtimeModule {
@@ -46,7 +45,7 @@ pub struct WasmtimeModule {
 }
 
 impl WasmtimeModule {
-    fn new(store: HostStore, module: &Module, linker: &wasmtime::Linker<WasiCtx>) -> Result<Self> {
+    fn new(store: HostStore, module: &Module, linker: &wasmtime::Linker<()>) -> Result<Self> {
         let mut inner_store = store.lock().unwrap();
         let instance = linker.instantiate(inner_store.as_context_mut(), module)?;
         let memory = instance
@@ -66,7 +65,7 @@ impl WasmtimeModule {
 
     fn call_impl<T>(
         &self,
-        mut store: StoreContextMut<WasiCtx>,
+        mut store: StoreContextMut<()>,
         name: &str,
         data: &[u8],
         f: impl FnOnce(&[u8]) -> Result<T>,
@@ -114,16 +113,14 @@ impl RawModule for WasmtimeModule {
 pub struct WasmtimeLinker {
     engine: Engine,
     store: HostStore,
-    linker: wasmtime::Linker<WasiCtx>,
+    linker: wasmtime::Linker<()>,
 }
 
 impl ayaka_plugin::Linker<WasmtimeModule> for WasmtimeLinker {
     fn new() -> Result<Self> {
         let engine = Engine::default();
-        let wasi = WasiCtxBuilder::new().inherit_stdio().build();
-        let store = Store::new(&engine, wasi);
-        let mut linker = wasmtime::Linker::new(&engine);
-        add_to_linker(&mut linker, |ctx| ctx)?;
+        let store = Store::new(&engine, ());
+        let linker = wasmtime::Linker::new(&engine);
         Ok(Self {
             engine,
             store: Arc::new(Mutex::new(store)),
@@ -151,7 +148,7 @@ impl ayaka_plugin::Linker<WasmtimeModule> for WasmtimeLinker {
     ) -> Func {
         Func::wrap(
             self.store.lock().unwrap().as_context_mut(),
-            move |mut store: Caller<WasiCtx>, len: i32, data: i32| unsafe {
+            move |mut store: Caller<()>, len: i32, data: i32| unsafe {
                 let memory = store
                     .get_export(MEMORY_NAME)
                     .unwrap()
@@ -160,7 +157,7 @@ impl ayaka_plugin::Linker<WasmtimeModule> for WasmtimeLinker {
                 let data = {
                     let store = store.as_context_mut();
                     let handle = WasmtimeLinkerHandle { store, memory };
-                    f(handle, data, len).map_err(|e| Trap::new(e.to_string()))?
+                    f(handle, data, len)?
                 };
                 let abi_alloc = store
                     .get_export(ABI_ALLOC_NAME)
@@ -179,7 +176,7 @@ impl ayaka_plugin::Linker<WasmtimeModule> for WasmtimeLinker {
 
 /// A Wasmtime [`StoreContextMut`].
 pub struct WasmtimeLinkerHandle<'a> {
-    store: StoreContextMut<'a, WasiCtx>,
+    store: StoreContextMut<'a, ()>,
     memory: Memory,
 }
 
diff --git a/utils/ayaka-runtime/Cargo.toml b/utils/ayaka-runtime/Cargo.toml
index c382b96f..bd88753a 100644
--- a/utils/ayaka-runtime/Cargo.toml
+++ b/utils/ayaka-runtime/Cargo.toml
@@ -23,6 +23,7 @@ trylog = { workspace = true }
 cfg-if = "1.0"
 vfs = { workspace = true }
 frfs = { git = "https://github.com/Tim-Paik/frfs.git", features = ["vfs"] }
+rand = "0.8"
 
 ayaka-plugin-nop = { path = "../ayaka-plugin-nop" }
 ayaka-plugin-wasmi = { path = "../ayaka-plugin-wasmi", optional = true }
diff --git a/utils/ayaka-runtime/src/plugin.rs b/utils/ayaka-runtime/src/plugin.rs
index e127dfee..4a1510eb 100644
--- a/utils/ayaka-runtime/src/plugin.rs
+++ b/utils/ayaka-runtime/src/plugin.rs
@@ -3,6 +3,7 @@
 mod fs_interop;
 mod log_interop;
 mod plugin_interop;
+mod rand_interop;
 
 use crate::*;
 use anyhow::Result;
@@ -131,6 +132,7 @@ impl<M: RawModule + Send + Sync + 'static> Runtime<M> {
         log_interop::register(&mut store)?;
         plugin_interop::register(&mut store, handle.clone())?;
         fs_interop::register(&mut store, root_path)?;
+        rand_interop::register(&mut store)?;
         let mut runtime = Self::new();
 
         let total_len = paths.len();
diff --git a/utils/ayaka-runtime/src/plugin/rand_interop.rs b/utils/ayaka-runtime/src/plugin/rand_interop.rs
new file mode 100644
index 00000000..b6029047
--- /dev/null
+++ b/utils/ayaka-runtime/src/plugin/rand_interop.rs
@@ -0,0 +1,19 @@
+use anyhow::{anyhow, Result};
+use ayaka_plugin::{Linker, RawModule};
+use rand::{rngs::StdRng, Rng, SeedableRng};
+use std::{
+    collections::HashMap,
+    sync::{LazyLock, Mutex},
+};
+
+static RNG: LazyLock<Mutex<StdRng>> = LazyLock::new(|| Mutex::new(StdRng::from_entropy()));
+
+pub fn register<M: RawModule>(store: &mut impl Linker<M>) -> Result<()> {
+    let rnd_func = store.wrap(|(start, end): (i64, i64)| {
+        RNG.lock()
+            .map(|mut rng| rng.gen_range(start..end))
+            .map_err(|_| anyhow!("Cannot lock random engine"))
+    });
+    store.import("rand", HashMap::from([("__rnd".to_string(), rnd_func)]))?;
+    Ok(())
+}


Test patch:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 37c613e9..7ba5cbfd 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -22,6 +22,5 @@ jobs:
       - name: Install targets
         run: |
           rustup target add wasm32-unknown-unknown
-          rustup target add wasm32-wasi
       - name: Test
         run: make test