Skip to content

Commit

Permalink
Upgrade to wasm-tools 220 and wit-bindgen 0.35 releases (#9601)
Browse files Browse the repository at this point in the history
* component-macro: paths are now an accessor on PackageSourceMap

* wast: WastArg enum is now non-exhaustive

and the error messages were mostly written the wrong way around

* upgrade to wasm-tools 220 release

* supply chain: vet of unicode-width and automatic changes

* github actions: upgrade to cargo-vet 0.10.0

* wasmtime requires ahash feature on hashbrown, a transitive must have been ticking it prior

* upgrade to wit-bindgen 0.35

which uses wasm-tools 220, eliminating the duplicate deps in the lockfile.

* vet wit-bindgen upgrade

* fuzzing: add WasmFeatures::EXTENDED_CONF to expected features

wasm-smith added it in bytecodealliance/wasm-tools#1861
  • Loading branch information
pchickey authored Nov 13, 2024
1 parent ba8131c commit 0e6c711
Show file tree
Hide file tree
Showing 10 changed files with 155 additions and 109 deletions.
2 changes: 1 addition & 1 deletion .github/actions/install-cargo-vet/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ inputs:
version:
description: 'Version to install'
required: false
default: '0.9.0'
default: '0.10.0'

runs:
using: composite
Expand Down
78 changes: 42 additions & 36 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -271,19 +271,19 @@ io-lifetimes = { version = "2.0.3", default-features = false }
io-extras = "0.18.1"
rustix = "0.38.31"
# wit-bindgen:
wit-bindgen = { version = "0.34.0", default-features = false }
wit-bindgen-rust-macro = { version = "0.34.0", default-features = false }
wit-bindgen = { version = "0.35.0", default-features = false }
wit-bindgen-rust-macro = { version = "0.35.0", default-features = false }

# wasm-tools family:
wasmparser = { version = "0.219.1", default-features = false }
wat = "1.219.1"
wast = "219.0.1"
wasmprinter = "0.219.1"
wasm-encoder = "0.219.1"
wasm-smith = "0.219.1"
wasm-mutate = "0.219.1"
wit-parser = "0.219.1"
wit-component = "0.219.1"
wasmparser = { version = "0.220.0", default-features = false }
wat = "1.220.0"
wast = "220.0.0"
wasmprinter = "0.220.0"
wasm-encoder = "0.220.0"
wasm-smith = "0.220.0"
wasm-mutate = "0.220.0"
wit-parser = "0.220.0"
wit-component = "0.220.0"

# Non-Bytecode Alliance maintained dependencies:
# --------------------------
Expand Down
2 changes: 1 addition & 1 deletion crates/component-macro/src/bindgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ fn parse_source(
};
let (pkg, sources) = resolve.push_path(normalized_path)?;
pkgs.push(pkg);
files.extend(sources);
files.extend(sources.paths().map(|p| p.to_owned()));
}
Ok(())
};
Expand Down
3 changes: 2 additions & 1 deletion crates/fuzzing/src/oracles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,8 @@ mod tests {
| WasmFeatures::WIDE_ARITHMETIC
| WasmFeatures::MEMORY64
| WasmFeatures::GC_TYPES
| WasmFeatures::CUSTOM_PAGE_SIZES;
| WasmFeatures::CUSTOM_PAGE_SIZES
| WasmFeatures::EXTENDED_CONST;

// All other features that wasmparser supports, which is presumably a
// superset of the features that wasm-smith supports, are listed here as
Expand Down
2 changes: 1 addition & 1 deletion crates/wasmtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ gimli = { workspace = true, optional = true }
addr2line = { workspace = true, optional = true }
semver = { workspace = true, optional = true }
smallvec = { workspace = true, optional = true }
hashbrown = { workspace = true }
hashbrown = { workspace = true, features = ["ahash"] }
libm = "0.2.7"
bitflags = { workspace = true }

Expand Down
12 changes: 4 additions & 8 deletions crates/wast/src/wast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ where
.iter()
.map(|v| match v {
WastArg::Core(v) => core::val(&mut self.store, v),
WastArg::Component(_) => bail!("expected component function, found core"),
_ => bail!("expected core function, found other other argument {v:?}"),
})
.collect::<Result<Vec<_>>>()?;

Expand All @@ -203,7 +203,7 @@ where
.iter()
.map(|v| match v {
WastArg::Component(v) => component::val(v),
WastArg::Core(_) => bail!("expected core function, found component"),
_ => bail!("expected component function, found other argument {v:?}"),
})
.collect::<Result<Vec<_>>>()?;

Expand Down Expand Up @@ -347,9 +347,7 @@ where
for (i, (v, e)) in values.iter().zip(results).enumerate() {
let e = match e {
WastRet::Core(core) => core,
WastRet::Component(_) => {
bail!("expected component value found core value")
}
_ => bail!("expected core value found other value {e:?}"),
};
core::match_val(&mut self.store, v, e)
.with_context(|| format!("result {i} didn't match"))?;
Expand All @@ -362,10 +360,8 @@ where
}
for (i, (v, e)) in values.iter().zip(results).enumerate() {
let e = match e {
WastRet::Core(_) => {
bail!("expected component value found core value")
}
WastRet::Component(val) => val,
_ => bail!("expected component value found other value {e:?}"),
};
component::match_val(e, v)
.with_context(|| format!("result {i} didn't match"))?;
Expand Down
Loading

0 comments on commit 0e6c711

Please sign in to comment.