diff --git a/substrate/Cargo.lock b/substrate/Cargo.lock index 64e84fe471..bf06efd65a 100644 --- a/substrate/Cargo.lock +++ b/substrate/Cargo.lock @@ -8249,6 +8249,7 @@ dependencies = [ "parity-scale-codec", "parity-wasm 0.42.2", "paste 1.0.6", + "rustix 0.33.7", "rustix 0.35.6", "sc-allocator", "sc-executor-common", diff --git a/substrate/client/executor/wasmtime/Cargo.toml b/substrate/client/executor/wasmtime/Cargo.toml index 2dcfde378b..e75f2d9d04 100644 --- a/substrate/client/executor/wasmtime/Cargo.toml +++ b/substrate/client/executor/wasmtime/Cargo.toml @@ -18,6 +18,9 @@ codec = { package = "parity-scale-codec", version = "3.0.0" } libc = "0.2.121" log = "0.4.17" parity-wasm = "0.42.0" + +# When bumping wasmtime do not forget to also bump rustix +# to exactly the same version as used by wasmtime! wasmtime = { version = "0.38.0", default-features = false, features = [ "cache", "cranelift", @@ -33,9 +36,16 @@ sp-sandbox = { version = "0.10.0-dev", path = "../../../primitives/sandbox" } sp-wasm-interface = { version = "6.0.0", features = ["wasmtime"], path = "../../../primitives/wasm-interface" } [target.'cfg(target_os = "linux")'.dependencies] -rustix = { version = "0.35.6", default-features = false, features = ["std", "mm", "fs", "param"] } +rustix = { version = "0.35.6", default-features = false, features = ["std", "mm", "fs", "param", "use-libc"] } once_cell = "1.12.0" +# Here we include the rustix crate used by wasmtime just to enable its 'use-libc' flag. +# +# By default rustix directly calls the appropriate syscalls completely bypassing libc; +# this doesn't have any actual benefits for us besides making it harder to debug memory +# problems (since then `mmap` etc. cannot be easily hooked into). +rustix_wasmtime = { package = "rustix", version = "0.33.7", default-features = false, features = ["std", "use-libc"] } + [dev-dependencies] wat = "1.0" sc-runtime-test = { version = "2.0.0", path = "../runtime-test" }