From e78605e89d1d77c1e13b0efa4fa3a4590970b14e Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 26 Mar 2024 12:10:53 -0500 Subject: [PATCH] Update wasm-tools family of crates (#8242) Closes #8241 --- Cargo.lock | 175 ++++++++++++++++++-------- Cargo.toml | 18 +-- crates/environ/src/component/types.rs | 4 +- crates/wast/src/component.rs | 16 +-- crates/wast/src/core.rs | 6 +- crates/wast/src/wast.rs | 2 +- crates/wit-bindgen/src/rust.rs | 4 +- supply-chain/imports.lock | 60 +++++++++ 8 files changed, 209 insertions(+), 76 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d9717896ac..9d30010c77 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -849,7 +849,7 @@ dependencies = [ "serde_derive", "smallvec", "target-lexicon", - "wasmparser", + "wasmparser 0.202.0", "wasmtime-types", "wat", ] @@ -2763,7 +2763,7 @@ version = "0.0.0" dependencies = [ "cargo_metadata", "heck", - "wit-component", + "wit-component 0.202.0", ] [[package]] @@ -3097,7 +3097,7 @@ name = "verify-component-adapter" version = "20.0.0" dependencies = [ "anyhow", - "wasmparser", + "wasmparser 0.202.0", "wat", ] @@ -3188,7 +3188,7 @@ dependencies = [ "byte-array-literals", "object 0.33.0", "wasi", - "wasm-encoder", + "wasm-encoder 0.202.0", "wit-bindgen", ] @@ -3255,6 +3255,15 @@ dependencies = [ "leb128", ] +[[package]] +name = "wasm-encoder" +version = "0.202.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfd106365a7f5f7aa3c1916a98cbb3ad477f5ff96ddb130285a91c6e7429e67a" +dependencies = [ + "leb128", +] + [[package]] name = "wasm-metadata" version = "0.201.0" @@ -3267,36 +3276,52 @@ dependencies = [ "serde_derive", "serde_json", "spdx", - "wasm-encoder", - "wasmparser", + "wasm-encoder 0.201.0", + "wasmparser 0.201.0", +] + +[[package]] +name = "wasm-metadata" +version = "0.202.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "094aea3cb90e09f16ee25a4c0e324b3e8c934e7fd838bfa039aef5352f44a917" +dependencies = [ + "anyhow", + "indexmap 2.0.0", + "serde", + "serde_derive", + "serde_json", + "spdx", + "wasm-encoder 0.202.0", + "wasmparser 0.202.0", ] [[package]] name = "wasm-mutate" -version = "0.201.0" +version = "0.202.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4998a6d2c774d9ead7fd7e4d4c932b78c665ac893fd067ae7e18a62c3c4af71" +checksum = "8d82e837ffc4f88364b43e9aa2c415b27fd6526b7809bcfe83c5a974db7578b7" dependencies = [ "egg", "log", "rand", "thiserror", - "wasm-encoder", - "wasmparser", + "wasm-encoder 0.202.0", + "wasmparser 0.202.0", ] [[package]] name = "wasm-smith" -version = "0.201.0" +version = "0.202.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61ff53a54a853f174b0df74cdb1553f1451e7bcdc23b26b1379f664ee1913d1a" +checksum = "4cf58fe4c46def4c0cdab0818cf0e663db7a018473795349996c48335d5d1163" dependencies = [ "anyhow", "arbitrary", "flagset", "indexmap 2.0.0", "leb128", - "wasm-encoder", + "wasm-encoder 0.202.0", ] [[package]] @@ -3350,6 +3375,17 @@ dependencies = [ "semver", ] +[[package]] +name = "wasmparser" +version = "0.202.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6998515d3cf3f8b980ef7c11b29a9b1017d4cf86b99ae93b546992df9931413" +dependencies = [ + "bitflags 2.4.1", + "indexmap 2.0.0", + "semver", +] + [[package]] name = "wasmparser-nostd" version = "0.100.1" @@ -3361,12 +3397,12 @@ dependencies = [ [[package]] name = "wasmprinter" -version = "0.201.0" +version = "0.202.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a67e66da702706ba08729a78e3c0079085f6bfcb1a62e4799e97bbf728c2c265" +checksum = "ab1cc9508685eef9502e787f4d4123745f5651a1e29aec047645d3cac1e2da7a" dependencies = [ "anyhow", - "wasmparser", + "wasmparser 0.202.0", ] [[package]] @@ -3398,8 +3434,8 @@ dependencies = [ "target-lexicon", "tempfile", "wasi-common", - "wasm-encoder", - "wasmparser", + "wasm-encoder 0.202.0", + "wasmparser 0.202.0", "wasmtime-cache", "wasmtime-component-macro", "wasmtime-component-util", @@ -3538,7 +3574,7 @@ dependencies = [ "tracing", "walkdir", "wasi-common", - "wasmparser", + "wasmparser 0.202.0", "wasmtime", "wasmtime-cache", "wasmtime-cli-flags", @@ -3552,10 +3588,10 @@ dependencies = [ "wasmtime-wasi-nn", "wasmtime-wasi-threads", "wasmtime-wast", - "wast 201.0.0", + "wast 202.0.0", "wat", "windows-sys 0.52.0", - "wit-component", + "wit-component 0.202.0", ] [[package]] @@ -3584,7 +3620,7 @@ dependencies = [ "wasmtime", "wasmtime-component-util", "wasmtime-wit-bindgen", - "wit-parser", + "wit-parser 0.202.0", ] [[package]] @@ -3608,7 +3644,7 @@ dependencies = [ "object 0.33.0", "target-lexicon", "thiserror", - "wasmparser", + "wasmparser 0.202.0", "wasmtime-environ", "wasmtime-versioned-export-macros", ] @@ -3632,8 +3668,8 @@ dependencies = [ "serde_derive", "target-lexicon", "thiserror", - "wasm-encoder", - "wasmparser", + "wasm-encoder 0.202.0", + "wasmparser 0.202.0", "wasmprinter", "wasmtime-component-util", "wasmtime-types", @@ -3648,7 +3684,7 @@ dependencies = [ "component-fuzz-util", "env_logger", "libfuzzer-sys", - "wasmparser", + "wasmparser 0.202.0", "wasmprinter", "wasmtime-environ", "wat", @@ -3705,7 +3741,7 @@ dependencies = [ "rand", "smallvec", "target-lexicon", - "wasmparser", + "wasmparser 0.202.0", "wasmtime", "wasmtime-fuzzing", ] @@ -3725,12 +3761,12 @@ dependencies = [ "target-lexicon", "tempfile", "v8", - "wasm-encoder", + "wasm-encoder 0.202.0", "wasm-mutate", "wasm-smith", "wasm-spec-interpreter", "wasmi", - "wasmparser", + "wasmparser 0.202.0", "wasmprinter", "wasmtime", "wasmtime-wast", @@ -3777,7 +3813,7 @@ dependencies = [ "rand", "rustix", "sptr", - "wasm-encoder", + "wasm-encoder 0.202.0", "wasmtime-asm-macros", "wasmtime-environ", "wasmtime-fiber", @@ -3799,7 +3835,7 @@ dependencies = [ "serde", "serde_derive", "thiserror", - "wasmparser", + "wasmparser 0.202.0", ] [[package]] @@ -3906,7 +3942,7 @@ dependencies = [ "anyhow", "log", "wasmtime", - "wast 201.0.0", + "wast 202.0.0", ] [[package]] @@ -3918,7 +3954,7 @@ dependencies = [ "gimli", "object 0.33.0", "target-lexicon", - "wasmparser", + "wasmparser 0.202.0", "wasmtime-cranelift", "wasmtime-environ", "winch-codegen", @@ -3931,7 +3967,7 @@ dependencies = [ "anyhow", "heck", "indexmap 2.0.0", - "wit-parser", + "wit-parser 0.202.0", ] [[package]] @@ -3949,24 +3985,24 @@ dependencies = [ [[package]] name = "wast" -version = "201.0.0" +version = "202.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ef6e1ef34d7da3e2b374fd2b1a9c0227aff6cad596e1b24df9b58d0f6222faa" +checksum = "1fbcb11204515c953c9b42ede0a46a1c5e17f82af05c4fae201a8efff1b0f4fe" dependencies = [ "bumpalo", "leb128", "memchr", "unicode-width", - "wasm-encoder", + "wasm-encoder 0.202.0", ] [[package]] name = "wat" -version = "1.201.0" +version = "1.202.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453d5b37a45b98dee4f4cb68015fc73634d7883bbef1c65e6e9c78d454cf3f32" +checksum = "4de4b15a47135c56a3573406e9977b9518787a6154459b4842a9b9d3d1684848" dependencies = [ - "wast 201.0.0", + "wast 202.0.0", ] [[package]] @@ -4093,7 +4129,7 @@ dependencies = [ "regalloc2", "smallvec", "target-lexicon", - "wasmparser", + "wasmparser 0.202.0", "wasmtime-cranelift", "wasmtime-environ", ] @@ -4110,7 +4146,7 @@ dependencies = [ "similar", "target-lexicon", "toml", - "wasmparser", + "wasmparser 0.202.0", "wasmtime-environ", "wat", "winch-codegen", @@ -4140,7 +4176,7 @@ dependencies = [ "similar", "target-lexicon", "toml", - "wasmparser", + "wasmparser 0.202.0", "wasmtime-environ", "wat", "winch-codegen", @@ -4336,7 +4372,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e85e72719ffbccf279359ad071497e47eb0675fe22106dea4ed2d8a7fcb60ba4" dependencies = [ "anyhow", - "wit-parser", + "wit-parser 0.201.0", ] [[package]] @@ -4354,9 +4390,9 @@ dependencies = [ "anyhow", "heck", "indexmap 2.0.0", - "wasm-metadata", + "wasm-metadata 0.201.0", "wit-bindgen-core", - "wit-component", + "wit-component 0.201.0", ] [[package]] @@ -4386,10 +4422,29 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "wasm-encoder", - "wasm-metadata", - "wasmparser", - "wit-parser", + "wasm-encoder 0.201.0", + "wasm-metadata 0.201.0", + "wasmparser 0.201.0", + "wit-parser 0.201.0", +] + +[[package]] +name = "wit-component" +version = "0.202.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c836b1fd9932de0431c1758d8be08212071b6bba0151f7bac826dbc4312a2a9" +dependencies = [ + "anyhow", + "bitflags 2.4.1", + "indexmap 2.0.0", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder 0.202.0", + "wasm-metadata 0.202.0", + "wasmparser 0.202.0", + "wit-parser 0.202.0", ] [[package]] @@ -4407,7 +4462,25 @@ dependencies = [ "serde_derive", "serde_json", "unicode-xid", - "wasmparser", + "wasmparser 0.201.0", +] + +[[package]] +name = "wit-parser" +version = "0.202.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "744237b488352f4f27bca05a10acb79474415951c450e52ebd0da784c1df2bcc" +dependencies = [ + "anyhow", + "id-arena", + "indexmap 2.0.0", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser 0.202.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 069e9de4d1..5090a79938 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -238,15 +238,15 @@ rustix = "0.38.31" wit-bindgen = { version = "0.22.0", default-features = false } # wasm-tools family: -wasmparser = "0.201.0" -wat = "1.201.0" -wast = "201.0.0" -wasmprinter = "0.201.0" -wasm-encoder = "0.201.0" -wasm-smith = "0.201.0" -wasm-mutate = "0.201.0" -wit-parser = "0.201.0" -wit-component = "0.201.0" +wasmparser = "0.202.0" +wat = "1.202.0" +wast = "202.0.0" +wasmprinter = "0.202.0" +wasm-encoder = "0.202.0" +wasm-smith = "0.202.0" +wasm-mutate = "0.202.0" +wit-parser = "0.202.0" +wit-component = "0.202.0" # Non-Bytecode Alliance maintained dependencies: # -------------------------- diff --git a/crates/environ/src/component/types.rs b/crates/environ/src/component/types.rs index eecf00cf99..074ce8a16c 100644 --- a/crates/environ/src/component/types.rs +++ b/crates/environ/src/component/types.rs @@ -1136,8 +1136,8 @@ impl From<&wasmparser::PrimitiveValType> for InterfaceType { wasmparser::PrimitiveValType::U32 => InterfaceType::U32, wasmparser::PrimitiveValType::S64 => InterfaceType::S64, wasmparser::PrimitiveValType::U64 => InterfaceType::U64, - wasmparser::PrimitiveValType::Float32 => InterfaceType::Float32, - wasmparser::PrimitiveValType::Float64 => InterfaceType::Float64, + wasmparser::PrimitiveValType::F32 => InterfaceType::Float32, + wasmparser::PrimitiveValType::F64 => InterfaceType::Float64, wasmparser::PrimitiveValType::Char => InterfaceType::Char, wasmparser::PrimitiveValType::String => InterfaceType::String, } diff --git a/crates/wast/src/component.rs b/crates/wast/src/component.rs index 34c63260dd..8a7f19dc08 100644 --- a/crates/wast/src/component.rs +++ b/crates/wast/src/component.rs @@ -18,8 +18,8 @@ pub fn val(v: &WastVal<'_>) -> Result { WastVal::S32(b) => Val::S32(*b), WastVal::U64(b) => Val::U64(*b), WastVal::S64(b) => Val::S64(*b), - WastVal::Float32(b) => Val::Float32(f32::from_bits(b.bits)), - WastVal::Float64(b) => Val::Float64(f64::from_bits(b.bits)), + WastVal::F32(b) => Val::Float32(f32::from_bits(b.bits)), + WastVal::F64(b) => Val::Float64(f64::from_bits(b.bits)), WastVal::Char(b) => Val::Char(*b), WastVal::String(s) => Val::String(s.to_string().into()), WastVal::List(vals) => { @@ -101,11 +101,11 @@ pub fn match_val(expected: &WastVal<'_>, actual: &Val) -> Result<()> { Val::S64(a) => core::match_int(a, e), _ => mismatch(expected, actual), }, - WastVal::Float32(e) => match actual { + WastVal::F32(e) => match actual { Val::Float32(a) => core::match_f32(a.to_bits(), &NanPattern::Value(*e)), _ => mismatch(expected, actual), }, - WastVal::Float64(e) => match actual { + WastVal::F64(e) => match actual { Val::Float64(a) => core::match_f64(a.to_bits(), &NanPattern::Value(*e)), _ => mismatch(expected, actual), }, @@ -248,8 +248,8 @@ fn mismatch(expected: &WastVal<'_>, actual: &Val) -> Result<()> { WastVal::S32(..) => "s32", WastVal::U64(..) => "u64", WastVal::S64(..) => "s64", - WastVal::Float32(..) => "float32", - WastVal::Float64(..) => "float64", + WastVal::F32(..) => "f32", + WastVal::F64(..) => "f64", WastVal::Char(..) => "char", WastVal::String(..) => "string", WastVal::List(..) => "list", @@ -271,8 +271,8 @@ fn mismatch(expected: &WastVal<'_>, actual: &Val) -> Result<()> { Val::S32(..) => "s32", Val::U64(..) => "u64", Val::S64(..) => "s64", - Val::Float32(..) => "float32", - Val::Float64(..) => "float64", + Val::Float32(..) => "f32", + Val::Float64(..) => "f64", Val::Char(..) => "char", Val::String(..) => "string", Val::List(..) => "list", diff --git a/crates/wast/src/core.rs b/crates/wast/src/core.rs index 5a9abef3a2..ef9dc855b2 100644 --- a/crates/wast/src/core.rs +++ b/crates/wast/src/core.rs @@ -2,7 +2,7 @@ use anyhow::{bail, Context, Result}; use std::fmt::{Display, LowerHex}; use wasmtime::{ExternRef, Store, Val}; use wast::core::{HeapType, NanPattern, V128Pattern, WastArgCore, WastRetCore}; -use wast::token::{Float32, Float64}; +use wast::token::{F32, F64}; /// Translate from a `script::Value` to a `RuntimeValue`. pub fn val(store: &mut Store, v: &WastArgCore<'_>) -> Result { @@ -114,7 +114,7 @@ where } } -pub fn match_f32(actual: u32, expected: &NanPattern) -> Result<()> { +pub fn match_f32(actual: u32, expected: &NanPattern) -> Result<()> { match expected { // Check if an f32 (as u32 bits to avoid possible quieting when moving values in registers, e.g. // https://developer.arm.com/documentation/ddi0344/i/neon-and-vfp-programmers-model/modes-of-operation/default-nan-mode?lang=en) @@ -179,7 +179,7 @@ pub fn match_f32(actual: u32, expected: &NanPattern) -> Result<()> { } } -pub fn match_f64(actual: u64, expected: &NanPattern) -> Result<()> { +pub fn match_f64(actual: u64, expected: &NanPattern) -> Result<()> { match expected { // Check if an f64 (as u64 bits to avoid possible quieting when moving values in registers, e.g. // https://developer.arm.com/documentation/ddi0344/i/neon-and-vfp-programmers-model/modes-of-operation/default-nan-mode?lang=en) diff --git a/crates/wast/src/wast.rs b/crates/wast/src/wast.rs index 19b0b37860..3b42bfccbe 100644 --- a/crates/wast/src/wast.rs +++ b/crates/wast/src/wast.rs @@ -159,7 +159,7 @@ where #[cfg(not(feature = "component-model"))] Wat::Component(_) => bail!("component-model support not enabled"), }), - WastExecute::Get { module, global } => self.get(module.map(|s| s.name()), global), + WastExecute::Get { module, global, .. } => self.get(module.map(|s| s.name()), global), } } diff --git a/crates/wit-bindgen/src/rust.rs b/crates/wit-bindgen/src/rust.rs index 94226dea2a..7a6ba6e6e1 100644 --- a/crates/wit-bindgen/src/rust.rs +++ b/crates/wit-bindgen/src/rust.rs @@ -39,8 +39,8 @@ pub trait RustGenerator<'a> { Type::S16 => self.push_str("i16"), Type::S32 => self.push_str("i32"), Type::S64 => self.push_str("i64"), - Type::Float32 => self.push_str("f32"), - Type::Float64 => self.push_str("f64"), + Type::F32 => self.push_str("f32"), + Type::F64 => self.push_str("f64"), Type::Char => self.push_str("char"), Type::String => match mode { TypeMode::AllBorrowed(lt) => { diff --git a/supply-chain/imports.lock b/supply-chain/imports.lock index d666f0f99f..6226ab23de 100644 --- a/supply-chain/imports.lock +++ b/supply-chain/imports.lock @@ -876,36 +876,72 @@ when = "2024-02-27" user-id = 73222 user-login = "wasmtime-publish" +[[publisher.wasm-encoder]] +version = "0.202.0" +when = "2024-03-26" +user-id = 73222 +user-login = "wasmtime-publish" + [[publisher.wasm-metadata]] version = "0.201.0" when = "2024-02-27" user-id = 73222 user-login = "wasmtime-publish" +[[publisher.wasm-metadata]] +version = "0.202.0" +when = "2024-03-26" +user-id = 73222 +user-login = "wasmtime-publish" + [[publisher.wasm-mutate]] version = "0.201.0" when = "2024-02-27" user-id = 73222 user-login = "wasmtime-publish" +[[publisher.wasm-mutate]] +version = "0.202.0" +when = "2024-03-26" +user-id = 73222 +user-login = "wasmtime-publish" + [[publisher.wasm-smith]] version = "0.201.0" when = "2024-02-27" user-id = 73222 user-login = "wasmtime-publish" +[[publisher.wasm-smith]] +version = "0.202.0" +when = "2024-03-26" +user-id = 73222 +user-login = "wasmtime-publish" + [[publisher.wasmparser]] version = "0.201.0" when = "2024-02-27" user-id = 73222 user-login = "wasmtime-publish" +[[publisher.wasmparser]] +version = "0.202.0" +when = "2024-03-26" +user-id = 73222 +user-login = "wasmtime-publish" + [[publisher.wasmprinter]] version = "0.201.0" when = "2024-02-27" user-id = 73222 user-login = "wasmtime-publish" +[[publisher.wasmprinter]] +version = "0.202.0" +when = "2024-03-26" +user-id = 73222 +user-login = "wasmtime-publish" + [[publisher.wasmtime]] version = "18.0.2" when = "2024-02-28" @@ -1050,12 +1086,24 @@ when = "2024-02-27" user-id = 73222 user-login = "wasmtime-publish" +[[publisher.wast]] +version = "202.0.0" +when = "2024-03-26" +user-id = 73222 +user-login = "wasmtime-publish" + [[publisher.wat]] version = "1.201.0" when = "2024-02-27" user-id = 73222 user-login = "wasmtime-publish" +[[publisher.wat]] +version = "1.202.0" +when = "2024-03-26" +user-id = 73222 +user-login = "wasmtime-publish" + [[publisher.wiggle]] version = "18.0.2" when = "2024-02-28" @@ -1308,12 +1356,24 @@ when = "2024-02-27" user-id = 73222 user-login = "wasmtime-publish" +[[publisher.wit-component]] +version = "0.202.0" +when = "2024-03-26" +user-id = 73222 +user-login = "wasmtime-publish" + [[publisher.wit-parser]] version = "0.201.0" when = "2024-02-27" user-id = 73222 user-login = "wasmtime-publish" +[[publisher.wit-parser]] +version = "0.202.0" +when = "2024-03-26" +user-id = 73222 +user-login = "wasmtime-publish" + [[publisher.witx]] version = "0.9.1" when = "2021-06-22"