Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions src/bin/wasm-tools/compose.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use anyhow::{Context, Result};
use clap::Parser;
use std::path::{Path, PathBuf};
use wasm_compose::{composer::ComponentComposer, config::Config};
use wasmparser::Validator;
use wasmparser::{Validator, WasmFeatures};

/// WebAssembly component composer.
///
Expand Down Expand Up @@ -68,13 +68,15 @@ impl Opts {
if config.skip_validation {
log::debug!("output validation was skipped");
} else {
Validator::new().validate_all(&bytes).with_context(|| {
let output = match self.output.output_path() {
Some(s) => format!(" `{}`", s.display()),
None => String::new(),
};
format!("failed to validate output component{output}")
})?;
Validator::new_with_features(WasmFeatures::all())
.validate_all(&bytes)
.with_context(|| {
let output = match self.output.output_path() {
Some(s) => format!(" `{}`", s.display()),
None => String::new(),
};
format!("failed to validate output component{output}")
})?;

log::debug!("output component validated successfully");
}
Expand Down