From 2b39834343101d7591827b9f4c622096e524b472 Mon Sep 17 00:00:00 2001 From: Janito Vaqueiro Ferreira Filho Date: Tue, 8 Oct 2024 11:15:08 -0300 Subject: [PATCH] Disable `wat` feature from `wasmer` and `wasmtime` (#2586) * Enable `wasmer` dependency to run tests Instead of only running the tests if the feature is enabled. Also enable the `wat` feature in preparation to remove the `sys-default` feature. * Disable `sys-default` feature It doesn't seem to be needed. * Disable more `wasmer` features Disable the default features on `wasmer-compiler-singlepass`. * Disable `wasmtime`'s default features Only enable the ones that are needed. --- Cargo.lock | 184 +------------------- Cargo.toml | 4 +- examples/Cargo.lock | 224 +------------------------ linera-execution/Cargo.toml | 3 +- linera-execution/src/wasm/sanitizer.rs | 2 +- linera-witty/Cargo.toml | 2 +- 6 files changed, 8 insertions(+), 411 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 784c5c5a72c..041f8e7b04c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -24,15 +24,6 @@ dependencies = [ "syn 2.0.77", ] -[[package]] -name = "addr2line" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" -dependencies = [ - "gimli 0.29.0", -] - [[package]] name = "addr2line" version = "0.24.1" @@ -949,7 +940,7 @@ version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ - "addr2line 0.24.1", + "addr2line", "cfg-if", "libc", "miniz_oxide", @@ -1531,15 +1522,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "cpp_demangle" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96e58d342ad113c2b878f16d5d034c03be492ae460cdbc02b7f0f2284d310c7d" -dependencies = [ - "cfg-if", -] - [[package]] name = "cpufeatures" version = "0.2.14" @@ -2046,15 +2028,6 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" -[[package]] -name = "debugid" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" -dependencies = [ - "uuid", -] - [[package]] name = "delegate-display" version = "2.1.1" @@ -2183,16 +2156,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "directories-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" -dependencies = [ - "cfg-if", - "dirs-sys-next", -] - [[package]] name = "dirs" version = "5.0.1" @@ -2214,17 +2177,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - [[package]] name = "document-features" version = "0.2.10" @@ -2804,19 +2756,6 @@ dependencies = [ "byteorder", ] -[[package]] -name = "fxprof-processed-profile" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27d12c0aed7f1e24276a241aadc4cb8ea9f83000f34bc062b7cc2d51e3b0fabd" -dependencies = [ - "bitflags 2.6.0", - "debugid", - "fxhash", - "serde", - "serde_json", -] - [[package]] name = "genawaiter" version = "0.99.1" @@ -3538,26 +3477,6 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" -[[package]] -name = "ittapi" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b996fe614c41395cdaedf3cf408a9534851090959d90d54a535f675550b64b1" -dependencies = [ - "anyhow", - "ittapi-sys", - "log", -] - -[[package]] -name = "ittapi-sys" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52f5385394064fa2c886205dba02598013ce83d3e92d33dbdc0c52fe0e7bf4fc" -dependencies = [ - "cc", -] - [[package]] name = "jobserver" version = "0.1.32" @@ -8655,19 +8574,13 @@ version = "25.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03601559991d459a228236a49135364eac85ac00dc07b65fb95ae61a957793af" dependencies = [ - "addr2line 0.22.0", "anyhow", - "async-trait", "bitflags 2.6.0", "bumpalo", "cc", "cfg-if", - "encoding_rs", - "fxprof-processed-profile", - "gimli 0.29.0", "hashbrown 0.14.5", "indexmap 2.5.0", - "ittapi", "libc", "libm", "log", @@ -8678,30 +8591,20 @@ dependencies = [ "paste", "postcard", "psm", - "rayon", "rustix", - "semver 1.0.23", "serde", "serde_derive", - "serde_json", "smallvec", "sptr", "target-lexicon", - "wasm-encoder 0.217.0", "wasmparser 0.217.0", "wasmtime-asm-macros", - "wasmtime-cache", "wasmtime-component-macro", - "wasmtime-component-util", "wasmtime-cranelift", "wasmtime-environ", - "wasmtime-fiber", - "wasmtime-jit-debug", "wasmtime-jit-icache-coherence", "wasmtime-slab", "wasmtime-versioned-export-macros", - "wasmtime-winch", - "wat", "windows-sys 0.52.0", ] @@ -8714,26 +8617,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "wasmtime-cache" -version = "25.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a35e1d7cce7b536cc71955e5898b099104a577d2583694b7b31a6f38c14c04a3" -dependencies = [ - "anyhow", - "base64 0.21.7", - "directories-next", - "log", - "postcard", - "rustix", - "serde", - "serde_derive", - "sha2", - "toml", - "windows-sys 0.52.0", - "zstd", -] - [[package]] name = "wasmtime-component-macro" version = "25.0.1" @@ -8787,7 +8670,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "817bfa9ea878ec37aa24f85fd6912844e8d87d321662824cf920d561b698cdfd" dependencies = [ "anyhow", - "cpp_demangle", "cranelift-bitset", "cranelift-entity 0.112.1", "gimli 0.29.0", @@ -8795,45 +8677,15 @@ dependencies = [ "log", "object", "postcard", - "rustc-demangle", - "semver 1.0.23", "serde", "serde_derive", "target-lexicon", "wasm-encoder 0.217.0", "wasmparser 0.217.0", "wasmprinter", - "wasmtime-component-util", "wasmtime-types", ] -[[package]] -name = "wasmtime-fiber" -version = "25.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5070971b479b4e4879dbae8a8e1efee738a36d047c5738acfedb38d6740b79d1" -dependencies = [ - "anyhow", - "cc", - "cfg-if", - "rustix", - "wasmtime-asm-macros", - "wasmtime-versioned-export-macros", - "windows-sys 0.52.0", -] - -[[package]] -name = "wasmtime-jit-debug" -version = "25.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fd0000903068c13465b9c023f56f0664f433035cbbd8eae69aa7c755f97637" -dependencies = [ - "object", - "once_cell", - "rustix", - "wasmtime-versioned-export-macros", -] - [[package]] name = "wasmtime-jit-icache-coherence" version = "25.0.1" @@ -8877,23 +8729,6 @@ dependencies = [ "syn 2.0.77", ] -[[package]] -name = "wasmtime-winch" -version = "25.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b238eeaf55652df0e63a6829d1ca9ef726d63517f56194faa0f6b9941f8d9151" -dependencies = [ - "anyhow", - "cranelift-codegen 0.112.1", - "gimli 0.29.0", - "object", - "target-lexicon", - "wasmparser 0.217.0", - "wasmtime-cranelift", - "wasmtime-environ", - "winch-codegen", -] - [[package]] name = "wasmtime-wit-bindgen" version = "25.0.1" @@ -9028,23 +8863,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "winch-codegen" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac790aaeff15764481c731239a45346df3f0af966839ac1575f49989fdbb542" -dependencies = [ - "anyhow", - "cranelift-codegen 0.112.1", - "gimli 0.29.0", - "regalloc2 0.10.2", - "smallvec", - "target-lexicon", - "wasmparser 0.217.0", - "wasmtime-cranelift", - "wasmtime-environ", -] - [[package]] name = "windows-core" version = "0.52.0" diff --git a/Cargo.toml b/Cargo.toml index c459e0a38c8..bf4be9320a3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -162,9 +162,9 @@ wasm-encoder = "0.24.1" wasm-instrument = "0.4.0" wasm_thread = "0.3.0" wasmer = { package = "linera-wasmer", version = "4.3.6-linera.4", default-features = false } -wasmer-compiler-singlepass = { package = "linera-wasmer-compiler-singlepass", version = "4.3.6-linera.4" } +wasmer-compiler-singlepass = { package = "linera-wasmer-compiler-singlepass", version = "4.3.6-linera.4", default-features = false } wasmparser = "0.101.1" -wasmtime = "25.0.0" +wasmtime = { version = "25.0.0", default-features = false, features = ["cranelift", "runtime", "std"] } wasmtimer = "0.2.0" webassembly-test = "0.1.0" web-sys = "0.3.69" diff --git a/examples/Cargo.lock b/examples/Cargo.lock index a7f0548c2f6..390847fdf4b 100644 --- a/examples/Cargo.lock +++ b/examples/Cargo.lock @@ -12,15 +12,6 @@ dependencies = [ "regex", ] -[[package]] -name = "addr2line" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" -dependencies = [ - "gimli 0.29.0", -] - [[package]] name = "addr2line" version = "0.24.1" @@ -464,7 +455,7 @@ version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ - "addr2line 0.24.1", + "addr2line", "cfg-if", "libc", "miniz_oxide", @@ -958,15 +949,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "cpp_demangle" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96e58d342ad113c2b878f16d5d034c03be492ae460cdbc02b7f0f2284d310c7d" -dependencies = [ - "cfg-if", -] - [[package]] name = "cpufeatures" version = "0.2.14" @@ -1402,15 +1384,6 @@ dependencies = [ "parking_lot_core", ] -[[package]] -name = "debugid" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" -dependencies = [ - "uuid", -] - [[package]] name = "der" version = "0.7.9" @@ -1549,27 +1522,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "directories-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" -dependencies = [ - "cfg-if", - "dirs-sys-next", -] - -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - [[package]] name = "document-features" version = "0.2.10" @@ -2123,19 +2075,6 @@ dependencies = [ "byteorder", ] -[[package]] -name = "fxprof-processed-profile" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27d12c0aed7f1e24276a241aadc4cb8ea9f83000f34bc062b7cc2d51e3b0fabd" -dependencies = [ - "bitflags 2.6.0", - "debugid", - "fxhash", - "serde", - "serde_json", -] - [[package]] name = "gemm" version = "0.17.1" @@ -2770,26 +2709,6 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" -[[package]] -name = "ittapi" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b996fe614c41395cdaedf3cf408a9534851090959d90d54a535f675550b64b1" -dependencies = [ - "anyhow", - "ittapi-sys", - "log", -] - -[[package]] -name = "ittapi-sys" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52f5385394064fa2c886205dba02598013ce83d3e92d33dbdc0c52fe0e7bf4fc" -dependencies = [ - "cc", -] - [[package]] name = "jobserver" version = "0.1.32" @@ -3605,7 +3524,6 @@ dependencies = [ "wasmer-derive", "wasmer-types", "wasmparser 0.121.2", - "wat", "windows-sys 0.59.0", ] @@ -4636,17 +4554,6 @@ dependencies = [ "bitflags 2.6.0", ] -[[package]] -name = "redox_users" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" -dependencies = [ - "getrandom", - "libredox", - "thiserror", -] - [[package]] name = "regalloc2" version = "0.5.1" @@ -6103,12 +6010,6 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" -[[package]] -name = "unicode-width" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" - [[package]] name = "unicode-xid" version = "0.2.6" @@ -6440,19 +6341,13 @@ version = "25.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03601559991d459a228236a49135364eac85ac00dc07b65fb95ae61a957793af" dependencies = [ - "addr2line 0.22.0", "anyhow", - "async-trait", "bitflags 2.6.0", "bumpalo", "cc", "cfg-if", - "encoding_rs", - "fxprof-processed-profile", - "gimli 0.29.0", "hashbrown 0.14.5", "indexmap 2.5.0", - "ittapi", "libc", "libm", "log", @@ -6463,30 +6358,20 @@ dependencies = [ "paste", "postcard", "psm", - "rayon", "rustix", - "semver 1.0.23", "serde", "serde_derive", - "serde_json", "smallvec", "sptr", "target-lexicon", - "wasm-encoder 0.217.0", "wasmparser 0.217.0", "wasmtime-asm-macros", - "wasmtime-cache", "wasmtime-component-macro", - "wasmtime-component-util", "wasmtime-cranelift", "wasmtime-environ", - "wasmtime-fiber", - "wasmtime-jit-debug", "wasmtime-jit-icache-coherence", "wasmtime-slab", "wasmtime-versioned-export-macros", - "wasmtime-winch", - "wat", "windows-sys 0.52.0", ] @@ -6499,26 +6384,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "wasmtime-cache" -version = "25.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a35e1d7cce7b536cc71955e5898b099104a577d2583694b7b31a6f38c14c04a3" -dependencies = [ - "anyhow", - "base64 0.21.7", - "directories-next", - "log", - "postcard", - "rustix", - "serde", - "serde_derive", - "sha2", - "toml", - "windows-sys 0.52.0", - "zstd", -] - [[package]] name = "wasmtime-component-macro" version = "25.0.1" @@ -6572,7 +6437,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "817bfa9ea878ec37aa24f85fd6912844e8d87d321662824cf920d561b698cdfd" dependencies = [ "anyhow", - "cpp_demangle", "cranelift-bitset", "cranelift-entity 0.112.1", "gimli 0.29.0", @@ -6580,45 +6444,15 @@ dependencies = [ "log", "object", "postcard", - "rustc-demangle", - "semver 1.0.23", "serde", "serde_derive", "target-lexicon", "wasm-encoder 0.217.0", "wasmparser 0.217.0", "wasmprinter", - "wasmtime-component-util", "wasmtime-types", ] -[[package]] -name = "wasmtime-fiber" -version = "25.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5070971b479b4e4879dbae8a8e1efee738a36d047c5738acfedb38d6740b79d1" -dependencies = [ - "anyhow", - "cc", - "cfg-if", - "rustix", - "wasmtime-asm-macros", - "wasmtime-versioned-export-macros", - "windows-sys 0.52.0", -] - -[[package]] -name = "wasmtime-jit-debug" -version = "25.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fd0000903068c13465b9c023f56f0664f433035cbbd8eae69aa7c755f97637" -dependencies = [ - "object", - "once_cell", - "rustix", - "wasmtime-versioned-export-macros", -] - [[package]] name = "wasmtime-jit-icache-coherence" version = "25.0.1" @@ -6662,23 +6496,6 @@ dependencies = [ "syn 2.0.77", ] -[[package]] -name = "wasmtime-winch" -version = "25.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b238eeaf55652df0e63a6829d1ca9ef726d63517f56194faa0f6b9941f8d9151" -dependencies = [ - "anyhow", - "cranelift-codegen 0.112.1", - "gimli 0.29.0", - "object", - "target-lexicon", - "wasmparser 0.217.0", - "wasmtime-cranelift", - "wasmtime-environ", - "winch-codegen", -] - [[package]] name = "wasmtime-wit-bindgen" version = "25.0.1" @@ -6691,28 +6508,6 @@ dependencies = [ "wit-parser 0.217.0", ] -[[package]] -name = "wast" -version = "217.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79004ecebded92d3c710d4841383368c7f04b63d0992ddd6b0c7d5029b7629b7" -dependencies = [ - "bumpalo", - "leb128", - "memchr", - "unicode-width", - "wasm-encoder 0.217.0", -] - -[[package]] -name = "wat" -version = "1.217.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c126271c3d92ca0f7c63e4e462e40c69cca52fd4245fcda730d1cf558fb55088" -dependencies = [ - "wast", -] - [[package]] name = "web-sys" version = "0.3.70" @@ -6789,23 +6584,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "winch-codegen" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac790aaeff15764481c731239a45346df3f0af966839ac1575f49989fdbb542" -dependencies = [ - "anyhow", - "cranelift-codegen 0.112.1", - "gimli 0.29.0", - "regalloc2 0.10.2", - "smallvec", - "target-lexicon", - "wasmparser 0.217.0", - "wasmtime-cranelift", - "wasmtime-environ", -] - [[package]] name = "windows-registry" version = "0.2.0" diff --git a/linera-execution/Cargo.toml b/linera-execution/Cargo.toml index 0a1eb0a828a..573be44478e 100644 --- a/linera-execution/Cargo.toml +++ b/linera-execution/Cargo.toml @@ -65,7 +65,7 @@ wasmtime = { workspace = true, optional = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] tokio = { workspace = true, features = ["rt-multi-thread"] } -wasmer = { workspace = true, optional = true, features = ["sys-default", "singlepass"] } +wasmer = { workspace = true, optional = true, features = ["cranelift", "singlepass"] } [target.'cfg(target_arch = "wasm32")'.dependencies] tokio = { workspace = true, features = ["rt"] } @@ -83,6 +83,7 @@ test-case.workspace = true test-log = { workspace = true, features = ["trace"] } tokio = { workspace = true, features = ["rt", "test-util"] } tracing-subscriber = { workspace = true, features = ["fmt"] } +wasmer = { workspace = true, features = ["wat"] } [build-dependencies] cfg_aliases.workspace = true diff --git a/linera-execution/src/wasm/sanitizer.rs b/linera-execution/src/wasm/sanitizer.rs index d649fabf1f0..18de20c62fd 100644 --- a/linera-execution/src/wasm/sanitizer.rs +++ b/linera-execution/src/wasm/sanitizer.rs @@ -404,7 +404,7 @@ impl<'bytecode> Sanitizer<'bytecode> { } } -#[cfg(all(test, with_wasmer))] +#[cfg(test)] mod tests { use linera_base::data_types::Bytecode; diff --git a/linera-witty/Cargo.toml b/linera-witty/Cargo.toml index dd8ed668a85..9515864f256 100644 --- a/linera-witty/Cargo.toml +++ b/linera-witty/Cargo.toml @@ -38,7 +38,7 @@ features = ["js-default"] [target.'cfg(not(target_arch = "wasm32"))'.dependencies.wasmer] workspace = true optional = true -features = ["sys-default", "singlepass"] +features = ["singlepass"] [dev-dependencies] assert_matches.workspace = true