Repository: bytecodealliance/wasm-tools
Pull request #1365 (2024-01-09 16:02:59)

Remove support for encoding old component metadata format
This commit is a follow-up to #1260, #1270, and #1308. This is the next step in the transition to updating how type information is encoded in object files in core WebAssembly binaries when transforming them into a component. The old format has been enabled by default since the 1.0.54 release of `wasm-tools` in late November. and has been supported since the 1.0.51 release in early November.

Support has been preserved for continuing to emit the old format in case any tooling accidentally hadn't updated but now feels like the right time to remove the ability to emit the old format. The old format can still be parsed if historical object files are in use and the hope is that it's not too bad to leave that piece sticking around for awhile.


Patch:
diff --git a/Cargo.lock b/Cargo.lock
index bd68f90a..d29094a7 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1702,7 +1702,7 @@ checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b"
 
 [[package]]
 name = "wasm-compose"
-version = "0.4.16"
+version = "0.5.0"
 dependencies = [
  "anyhow",
  "glob",
@@ -1716,9 +1716,9 @@ dependencies = [
  "serde_derive",
  "serde_yaml",
  "smallvec",
- "wasm-encoder 0.38.1",
- "wasmparser 0.118.1",
- "wasmprinter 0.2.75",
+ "wasm-encoder 0.39.0",
+ "wasmparser 0.119.0",
+ "wasmprinter 0.2.76",
  "wat",
  "wit-component",
 ]
@@ -1734,17 +1734,17 @@ dependencies = [
 
 [[package]]
 name = "wasm-encoder"
-version = "0.38.1"
+version = "0.39.0"
 dependencies = [
  "anyhow",
  "leb128",
  "tempfile",
- "wasmparser 0.118.1",
+ "wasmparser 0.119.0",
 ]
 
 [[package]]
 name = "wasm-metadata"
-version = "0.10.14"
+version = "0.10.15"
 dependencies = [
  "anyhow",
  "clap 4.4.8",
@@ -1753,14 +1753,14 @@ dependencies = [
  "serde_derive",
  "serde_json",
  "spdx",
- "wasm-encoder 0.38.1",
- "wasmparser 0.118.1",
+ "wasm-encoder 0.39.0",
+ "wasmparser 0.119.0",
  "wat",
 ]
 
 [[package]]
 name = "wasm-mutate"
-version = "0.2.43"
+version = "0.2.44"
 dependencies = [
  "anyhow",
  "clap 4.4.8",
@@ -1769,9 +1769,9 @@ dependencies = [
  "log",
  "rand",
  "thiserror",
- "wasm-encoder 0.38.1",
- "wasmparser 0.118.1",
- "wasmprinter 0.2.75",
+ "wasm-encoder 0.39.0",
+ "wasmparser 0.119.0",
+ "wasmprinter 0.2.76",
  "wat",
 ]
 
@@ -1788,14 +1788,14 @@ dependencies = [
  "num_cpus",
  "rand",
  "wasm-mutate",
- "wasmparser 0.118.1",
- "wasmprinter 0.2.75",
+ "wasmparser 0.119.0",
+ "wasmprinter 0.2.76",
  "wasmtime",
 ]
 
 [[package]]
 name = "wasm-shrink"
-version = "0.1.44"
+version = "0.1.45"
 dependencies = [
  "anyhow",
  "blake3",
@@ -1804,14 +1804,14 @@ dependencies = [
  "log",
  "rand",
  "wasm-mutate",
- "wasmparser 0.118.1",
- "wasmprinter 0.2.75",
+ "wasmparser 0.119.0",
+ "wasmprinter 0.2.76",
  "wat",
 ]
 
 [[package]]
 name = "wasm-smith"
-version = "0.13.1"
+version = "0.14.0"
 dependencies = [
  "anyhow",
  "arbitrary",
@@ -1824,15 +1824,15 @@ dependencies = [
  "rand",
  "serde",
  "serde_derive",
- "wasm-encoder 0.38.1",
- "wasmparser 0.118.1",
- "wasmprinter 0.2.75",
+ "wasm-encoder 0.39.0",
+ "wasmparser 0.119.0",
+ "wasmprinter 0.2.76",
  "wat",
 ]
 
 [[package]]
 name = "wasm-tools"
-version = "1.0.54"
+version = "1.0.55"
 dependencies = [
  "addr2line 0.21.0",
  "anyhow",
@@ -1854,17 +1854,17 @@ dependencies = [
  "tempfile",
  "termcolor",
  "wasm-compose",
- "wasm-encoder 0.38.1",
+ "wasm-encoder 0.39.0",
  "wasm-metadata",
  "wasm-mutate",
  "wasm-shrink",
  "wasm-smith",
- "wasmparser 0.118.1",
- "wasmprinter 0.2.75",
+ "wasmparser 0.119.0",
+ "wasmprinter 0.2.76",
  "wast",
  "wat",
  "wit-component",
- "wit-parser 0.13.0",
+ "wit-parser 0.13.1",
  "wit-smith",
 ]
 
@@ -1876,8 +1876,8 @@ dependencies = [
  "wasm-mutate",
  "wasm-shrink",
  "wasm-smith",
- "wasmparser 0.118.1",
- "wasmprinter 0.2.75",
+ "wasmparser 0.119.0",
+ "wasmprinter 0.2.76",
  "wast",
  "wat",
 ]
@@ -1892,16 +1892,16 @@ dependencies = [
  "libfuzzer-sys",
  "log",
  "tempfile",
- "wasm-encoder 0.38.1",
+ "wasm-encoder 0.39.0",
  "wasm-mutate",
  "wasm-smith",
- "wasmparser 0.118.1",
- "wasmprinter 0.2.75",
+ "wasmparser 0.119.0",
+ "wasmprinter 0.2.76",
  "wasmtime",
  "wast",
  "wat",
  "wit-component",
- "wit-parser 0.13.0",
+ "wit-parser 0.13.1",
  "wit-smith",
 ]
 
@@ -1927,7 +1927,7 @@ dependencies = [
 
 [[package]]
 name = "wasmparser"
-version = "0.118.1"
+version = "0.119.0"
 dependencies = [
  "anyhow",
  "bitflags 2.4.1",
@@ -1938,7 +1938,7 @@ dependencies = [
  "once_cell",
  "rayon",
  "semver",
- "wasm-encoder 0.38.1",
+ "wasm-encoder 0.39.0",
  "wast",
  "wat",
 ]
@@ -1955,13 +1955,13 @@ dependencies = [
 
 [[package]]
 name = "wasmprinter"
-version = "0.2.75"
+version = "0.2.76"
 dependencies = [
  "anyhow",
  "diff",
  "rayon",
  "tempfile",
- "wasmparser 0.118.1",
+ "wasmparser 0.119.0",
  "wast",
  "wat",
 ]
@@ -2219,21 +2219,21 @@ dependencies = [
 
 [[package]]
 name = "wast"
-version = "69.0.1"
+version = "70.0.0"
 dependencies = [
  "anyhow",
  "leb128",
  "memchr",
  "rayon",
  "unicode-width",
- "wasm-encoder 0.38.1",
- "wasmparser 0.118.1",
+ "wasm-encoder 0.39.0",
+ "wasmparser 0.119.0",
  "wat",
 ]
 
 [[package]]
 name = "wat"
-version = "1.0.82"
+version = "1.0.83"
 dependencies = [
  "wast",
 ]
@@ -2363,7 +2363,7 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
 
 [[package]]
 name = "wit-component"
-version = "0.19.0"
+version = "0.19.1"
 dependencies = [
  "anyhow",
  "bitflags 2.4.1",
@@ -2375,14 +2375,14 @@ dependencies = [
  "serde",
  "serde_derive",
  "serde_json",
- "wasm-encoder 0.38.1",
+ "wasm-encoder 0.39.0",
  "wasm-metadata",
- "wasmparser 0.118.1",
- "wasmprinter 0.2.75",
+ "wasmparser 0.119.0",
+ "wasmprinter 0.2.76",
  "wasmtime",
  "wast",
  "wat",
- "wit-parser 0.13.0",
+ "wit-parser 0.13.1",
 ]
 
 [[package]]
@@ -2403,7 +2403,7 @@ dependencies = [
 
 [[package]]
 name = "wit-parser"
-version = "0.13.0"
+version = "0.13.1"
 dependencies = [
  "anyhow",
  "env_logger",
@@ -2427,13 +2427,13 @@ dependencies = [
  "env_logger",
  "libfuzzer-sys",
  "log",
- "wasmprinter 0.2.75",
- "wit-parser 0.13.0",
+ "wasmprinter 0.2.76",
+ "wit-parser 0.13.1",
 ]
 
 [[package]]
 name = "wit-smith"
-version = "0.1.24"
+version = "0.1.25"
 dependencies = [
  "arbitrary",
  "clap 4.4.8",
@@ -2441,7 +2441,7 @@ dependencies = [
  "log",
  "semver",
  "wit-component",
- "wit-parser 0.13.0",
+ "wit-parser 0.13.1",
 ]
 
 [[package]]
diff --git a/Cargo.toml b/Cargo.toml
index dad0bd26..c2f3105f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "wasm-tools"
-version = "1.0.54"
+version = "1.0.55"
 authors = ["The Wasmtime Project Developers"]
 edition.workspace = true
 description = "CLI tools for interoperating with WebAssembly files"
@@ -46,19 +46,19 @@ pretty_assertions = "1.3.0"
 semver = "1.0.0"
 smallvec = "1.11.1"
 
-wasm-compose = { version = "0.4.16", path = "crates/wasm-compose" }
-wasm-encoder = { version = "0.38.1", path = "crates/wasm-encoder" }
-wasm-metadata = { version = "0.10.14", path = "crates/wasm-metadata" }
-wasm-mutate = { version = "0.2.43", path = "crates/wasm-mutate" }
-wasm-shrink = { version = "0.1.44", path = "crates/wasm-shrink" }
-wasm-smith = { version = "0.13.1", path = "crates/wasm-smith" }
-wasmparser = { version = "0.118.1", path = "crates/wasmparser" }
-wasmprinter = { version = "0.2.75", path = "crates/wasmprinter" }
-wast = { version = "69.0.1", path = "crates/wast" }
-wat = { version = "1.0.82", path = "crates/wat" }
-wit-component = { version = "0.19.0", path = "crates/wit-component" }
-wit-parser = { version = "0.13.0", path = "crates/wit-parser" }
-wit-smith = { version = "0.1.24", path = "crates/wit-smith" }
+wasm-compose = { version = "0.5.0", path = "crates/wasm-compose" }
+wasm-encoder = { version = "0.39.0", path = "crates/wasm-encoder" }
+wasm-metadata = { version = "0.10.15", path = "crates/wasm-metadata" }
+wasm-mutate = { version = "0.2.44", path = "crates/wasm-mutate" }
+wasm-shrink = { version = "0.1.45", path = "crates/wasm-shrink" }
+wasm-smith = { version = "0.14.0", path = "crates/wasm-smith" }
+wasmparser = { version = "0.119.0", path = "crates/wasmparser" }
+wasmprinter = { version = "0.2.76", path = "crates/wasmprinter" }
+wast = { version = "70.0.0", path = "crates/wast" }
+wat = { version = "1.0.83", path = "crates/wat" }
+wit-component = { version = "0.19.1", path = "crates/wit-component" }
+wit-parser = { version = "0.13.1", path = "crates/wit-parser" }
+wit-smith = { version = "0.1.25", path = "crates/wit-smith" }
 
 [dependencies]
 anyhow = { workspace = true }
diff --git a/crates/wasm-compose/Cargo.toml b/crates/wasm-compose/Cargo.toml
index a9e0cea2..82679094 100644
--- a/crates/wasm-compose/Cargo.toml
+++ b/crates/wasm-compose/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "wasm-compose"
-version = "0.4.16"
+version = "0.5.0"
 edition.workspace = true
 authors = ["Peter Huene <peter@huene.dev>"]
 license = "Apache-2.0 WITH LLVM-exception"
diff --git a/crates/wasm-encoder/Cargo.toml b/crates/wasm-encoder/Cargo.toml
index 9f81d75f..b1ce7b1c 100644
--- a/crates/wasm-encoder/Cargo.toml
+++ b/crates/wasm-encoder/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "wasm-encoder"
-version = "0.38.1"
+version = "0.39.0"
 authors = ["Nick Fitzgerald <fitzgen@gmail.com>"]
 edition.workspace = true
 license = "Apache-2.0 WITH LLVM-exception"
diff --git a/crates/wasm-metadata/Cargo.toml b/crates/wasm-metadata/Cargo.toml
index 43bbb573..6e72f803 100644
--- a/crates/wasm-metadata/Cargo.toml
+++ b/crates/wasm-metadata/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "wasm-metadata"
-version = "0.10.14"
+version = "0.10.15"
 edition.workspace = true
 license = "Apache-2.0 WITH LLVM-exception"
 repository = "https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wasm-metadata"
diff --git a/crates/wasm-mutate/Cargo.toml b/crates/wasm-mutate/Cargo.toml
index 816483ac..e53ad1a7 100644
--- a/crates/wasm-mutate/Cargo.toml
+++ b/crates/wasm-mutate/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "wasm-mutate"
-version = "0.2.43"
+version = "0.2.44"
 edition.workspace = true
 license = "Apache-2.0 WITH LLVM-exception"
 repository = "https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wasm-mutate"
diff --git a/crates/wasm-shrink/Cargo.toml b/crates/wasm-shrink/Cargo.toml
index 17fd9754..d08378a5 100644
--- a/crates/wasm-shrink/Cargo.toml
+++ b/crates/wasm-shrink/Cargo.toml
@@ -8,7 +8,7 @@ license = "Apache-2.0 WITH LLVM-exception"
 readme = "./README.md"
 repository = "https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wasm-shrink"
 name = "wasm-shrink"
-version = "0.1.44"
+version = "0.1.45"
 
 [dependencies]
 anyhow = { workspace = true }
diff --git a/crates/wasm-smith/Cargo.toml b/crates/wasm-smith/Cargo.toml
index 89e739d6..0c6092ca 100644
--- a/crates/wasm-smith/Cargo.toml
+++ b/crates/wasm-smith/Cargo.toml
@@ -8,7 +8,7 @@ license = "Apache-2.0 WITH LLVM-exception"
 name = "wasm-smith"
 readme = "./README.md"
 repository = "https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wasm-smith"
-version = "0.13.1"
+version = "0.14.0"
 exclude = ["/benches/corpus"]
 
 [[bench]]
diff --git a/crates/wasmparser/Cargo.toml b/crates/wasmparser/Cargo.toml
index 00031a80..8b6dfae5 100644
--- a/crates/wasmparser/Cargo.toml
+++ b/crates/wasmparser/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "wasmparser"
-version = "0.118.1"
+version = "0.119.0"
 authors = ["Yury Delendik <ydelendik@mozilla.com>"]
 license = "Apache-2.0 WITH LLVM-exception"
 repository = "https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wasmparser"
diff --git a/crates/wasmprinter/Cargo.toml b/crates/wasmprinter/Cargo.toml
index e59fb811..f5e5979f 100644
--- a/crates/wasmprinter/Cargo.toml
+++ b/crates/wasmprinter/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "wasmprinter"
-version = "0.2.75"
+version = "0.2.76"
 authors = ["Alex Crichton <alex@alexcrichton.com>"]
 edition.workspace = true
 license = "Apache-2.0 WITH LLVM-exception"
diff --git a/crates/wast/Cargo.toml b/crates/wast/Cargo.toml
index 642c3854..8b5b1a09 100644
--- a/crates/wast/Cargo.toml
+++ b/crates/wast/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "wast"
-version = "69.0.1"
+version = "70.0.0"
 authors = ["Alex Crichton <alex@alexcrichton.com>"]
 edition.workspace = true
 license = "Apache-2.0 WITH LLVM-exception"
diff --git a/crates/wat/Cargo.toml b/crates/wat/Cargo.toml
index 851f5f13..9bfcbe9e 100644
--- a/crates/wat/Cargo.toml
+++ b/crates/wat/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "wat"
-version = "1.0.82"
+version = "1.0.83"
 authors = ["Alex Crichton <alex@alexcrichton.com>"]
 edition.workspace = true
 license = "Apache-2.0 WITH LLVM-exception"
diff --git a/crates/wit-component/Cargo.toml b/crates/wit-component/Cargo.toml
index d4df5ca7..f763306a 100644
--- a/crates/wit-component/Cargo.toml
+++ b/crates/wit-component/Cargo.toml
@@ -1,7 +1,7 @@
 [package]
 name = "wit-component"
 authors = ["Peter Huene <peter@huene.dev>"]
-version = "0.19.0"
+version = "0.19.1"
 edition.workspace = true
 license = "Apache-2.0 WITH LLVM-exception"
 readme = "README.md"
diff --git a/crates/wit-component/src/encoding.rs b/crates/wit-component/src/encoding.rs
index f6de9d2a..2665fbe2 100644
--- a/crates/wit-component/src/encoding.rs
+++ b/crates/wit-component/src/encoding.rs
@@ -94,7 +94,7 @@ const INDIRECT_TABLE_NAME: &str = "$imports";
 
 pub mod docs;
 mod wit;
-pub use wit::{encode, encode_component, encode_world};
+pub use wit::{encode, encode_world};
 
 mod types;
 use types::{InstanceTypeEncoder, RootTypeEncoder, ValtypeEncoder};
diff --git a/crates/wit-component/src/lib.rs b/crates/wit-component/src/lib.rs
index 92205a32..e16d2523 100644
--- a/crates/wit-component/src/lib.rs
+++ b/crates/wit-component/src/lib.rs
@@ -216,7 +216,7 @@ pub fn embed_component_metadata(
     world: WorldId,
     encoding: StringEncoding,
 ) -> Result<()> {
-    let encoded = metadata::encode(&wit_resolver, world, encoding, None, None)?;
+    let encoded = metadata::encode(&wit_resolver, world, encoding, None)?;
 
     let section = wasm_encoder::CustomSection {
         name: "component-type".into(),
diff --git a/crates/wit-component/src/metadata.rs b/crates/wit-component/src/metadata.rs
index 0bd1d5b2..2ea73155 100644
--- a/crates/wit-component/src/metadata.rs
+++ b/crates/wit-component/src/metadata.rs
@@ -47,7 +47,7 @@ use anyhow::{bail, Context, Result};
 use indexmap::IndexMap;
 use std::borrow::Cow;
 use wasm_encoder::{
-    ComponentBuilder, ComponentExportKind, ComponentType, ComponentTypeRef, CustomSection, Encode,
+    ComponentBuilder, ComponentExportKind, ComponentType, ComponentTypeRef, CustomSection,
 };
 use wasm_metadata::Producers;
 use wasmparser::types::ComponentAnyTypeId;
@@ -170,94 +170,34 @@ pub fn encode(
     world: WorldId,
     string_encoding: StringEncoding,
     extra_producers: Option<&Producers>,
-    use_next_encoding: Option<bool>,
 ) -> Result<Vec<u8>> {
-    enum EncodingFormat {
-        // The encoding of the previous format was:
-        //
-        //  * A version byte, at the time 0x03.
-        //  * A string-encoding byte.
-        //  * A string which is the name of a world.
-        //  * A wasm-encoded WIT package which contains the previous world.
-        //
-        // Note that this branch will be deleted in the near future.
-        Previous,
-
-        // The current format.
-        Next,
+    let ty = crate::encoding::encode_world(resolve, world)?;
+
+    let world = &resolve.worlds[world];
+    let mut outer_ty = ComponentType::new();
+    outer_ty.ty().component(&ty);
+    outer_ty.export(
+        &resolve.id_of_name(world.package.unwrap(), &world.name),
+        ComponentTypeRef::Component(0),
+    );
+
+    let mut builder = ComponentBuilder::default();
+
+    let string_encoding = encode_string_encoding(string_encoding);
+    builder.custom_section(&CustomSection {
+        name: CUSTOM_SECTION_NAME.into(),
+        data: Cow::Borrowed(&[CURRENT_VERSION, string_encoding]),
+    });
+
+    let ty = builder.type_component(&outer_ty);
+    builder.export(&world.name, ComponentExportKind::Type, ty, None);
+
+    let mut producers = crate::base_producers();
+    if let Some(p) = extra_producers {
+        producers.merge(&p);
     }
-
-    let format = match use_next_encoding {
-        Some(true) => EncodingFormat::Next,
-        Some(false) => EncodingFormat::Previous,
-        None => match std::env::var("WIT_COMPONENT_NEW_ENCODE") {
-            Ok(s) if s == "0" => EncodingFormat::Previous,
-            _ => EncodingFormat::Next,
-        },
-    };
-
-    let ret = match format {
-        EncodingFormat::Previous => {
-            let world = &resolve.worlds[world];
-            let pkg = &resolve.packages[world.package.unwrap()];
-            assert!(
-                resolve
-                    .packages
-                    .iter()
-                    .filter(|(_, p)| p.name == pkg.name)
-                    .count()
-                    == 1
-            );
-
-            let mut ret = Vec::new();
-            ret.push(0x03);
-            ret.push(encode_string_encoding(string_encoding));
-            world.name.encode(&mut ret);
-            // This appends a wasm binary encoded Component to the ret:
-            let mut component_builder =
-                crate::encoding::encode_component(None, resolve, world.package.unwrap())?;
-
-            let mut producers = crate::base_producers();
-            if let Some(p) = extra_producers {
-                producers.merge(&p);
-            }
-            component_builder.raw_custom_section(&producers.raw_custom_section());
-
-            ret.extend(component_builder.finish());
-            ret
-        }
-        EncodingFormat::Next => {
-            let ty = crate::encoding::encode_world(resolve, world)?;
-
-            let world = &resolve.worlds[world];
-            let mut outer_ty = ComponentType::new();
-            outer_ty.ty().component(&ty);
-            outer_ty.export(
-                &resolve.id_of_name(world.package.unwrap(), &world.name),
-                ComponentTypeRef::Component(0),
-            );
-
-            let mut builder = ComponentBuilder::default();
-
-            let string_encoding = encode_string_encoding(string_encoding);
-            builder.custom_section(&CustomSection {
-                name: CUSTOM_SECTION_NAME.into(),
-                data: Cow::Borrowed(&[CURRENT_VERSION, string_encoding]),
-            });
-
-            let ty = builder.type_component(&outer_ty);
-            builder.export(&world.name, ComponentExportKind::Type, ty, None);
-
-            let mut producers = crate::base_producers();
-            if let Some(p) = extra_producers {
-                producers.merge(&p);
-            }
-            builder.raw_custom_section(&producers.raw_custom_section());
-            builder.finish()
-        }
-    };
-
-    Ok(ret)
+    builder.raw_custom_section(&producers.raw_custom_section());
+    Ok(builder.finish())
 }
 
 fn decode_custom_section(wasm: &[u8]) -> Result<(Resolve, WorldId, StringEncoding)> {
diff --git a/crates/wit-parser/Cargo.toml b/crates/wit-parser/Cargo.toml
index 6508cd57..a9b3b6f6 100644
--- a/crates/wit-parser/Cargo.toml
+++ b/crates/wit-parser/Cargo.toml
@@ -1,7 +1,7 @@
 [package]
 name = "wit-parser"
 authors = ["Alex Crichton <alex@alexcrichton.com>"]
-version = "0.13.0"
+version = "0.13.1"
 edition.workspace = true
 license = "Apache-2.0 WITH LLVM-exception"
 readme = "README.md"
diff --git a/crates/wit-smith/Cargo.toml b/crates/wit-smith/Cargo.toml
index 2fa51fd3..e280fbec 100644
--- a/crates/wit-smith/Cargo.toml
+++ b/crates/wit-smith/Cargo.toml
@@ -5,7 +5,7 @@ edition.workspace = true
 license = "Apache-2.0 WITH LLVM-exception"
 name = "wit-smith"
 repository = "https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wit-smith"
-version = "0.1.24"
+version = "0.1.25"
 
 [dependencies]
 arbitrary = { workspace = true, features = ["derive"] }


Test patch:
diff --git a/crates/wit-component/tests/components.rs b/crates/wit-component/tests/components.rs
index 27871d55..84cdfa41 100644
--- a/crates/wit-component/tests/components.rs
+++ b/crates/wit-component/tests/components.rs
@@ -205,13 +205,8 @@ fn read_core_module(path: &Path, resolve: &Resolve, pkg: PackageId) -> Result<Ve
     let mut producers = wasm_metadata::Producers::empty();
     producers.add("processed-by", "my-fake-bindgen", "123.45");
 
-    let encoded = wit_component::metadata::encode(
-        resolve,
-        world,
-        StringEncoding::UTF8,
-        Some(&producers),
-        Some(true),
-    )?;
+    let encoded =
+        wit_component::metadata::encode(resolve, world, StringEncoding::UTF8, Some(&producers))?;
 
     let section = wasm_encoder::CustomSection {
         name: "component-type".into(),