Skip to content

Component-model-async wit-bindgen does not support tracing: true #11245

@rvolosatovs

Description

@rvolosatovs

Steps to Reproduce

apply:

diff --git a/crates/wasi/src/p3/bindings.rs b/crates/wasi/src/p3/bindings.rs
index 864d1eb8a4..560ffa5de8 100644
--- a/crates/wasi/src/p3/bindings.rs
+++ b/crates/wasi/src/p3/bindings.rs
@@ -117,9 +117,7 @@ mod generated {
     wasmtime::component::bindgen!({
         path: "src/p3/wit",
         world: "wasi:cli/command",
-        // TODO: Enable `tracing` once fixed:
-        // https://github.com/bytecodealliance/wasmtime/issues/11245
-        //tracing: true,
+        tracing: true,
         trappable_imports: true,
         concurrent_exports: true,
         concurrent_imports: true,

to:

$ git checkout 2b8322817e # latest `main` as of time of writing
$ curl -sL https://github.com/bytecodealliance/wasmtime/pull/11221.patch | git am -3
$ curl -sL https://github.com/bytecodealliance/wasmtime/pull/11244.patch | git am -3

or, potentially, latest main if/when #11221 and #11244 are merged

then:

$ cargo build -p wasmtime-wasi --features p3

Expected Results

Success

Actual Results

error[E0277]: `HostStream<u8>` doesn't implement `std::fmt::Debug`
   --> crates/wasi/src/p3/bindings.rs:117:5
    |
117 | /     wasmtime::component::bindgen!({
118 | |         path: "src/p3/wit",
119 | |         world: "wasi:cli/command",
120 | |         tracing: true,
...   |
167 | |         },
168 | |     });
    | |______^ `HostStream<u8>` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `HostStream<u8>`
    = help: the trait `std::fmt::Debug` is implemented for `std::result::Result<T, E>`
    = note: required for `std::result::Result<HostStream<u8>, wasmtime::Error>` to implement `std::fmt::Debug`
    = note: 1 redundant requirement hidden
    = note: required for `&std::result::Result<HostStream<u8>, wasmtime::Error>` to implement `std::fmt::Debug`
note: required by a bound in `tracing::field::debug`
   --> /Users/rvolosatovs/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tracing-core-0.1.31/src/field.rs:365:8
    |
363 | pub fn debug<T>(t: T) -> DebugValue<T>
    |        ----- required by a bound in this function
364 | where
365 |     T: fmt::Debug,
    |        ^^^^^^^^^^ required by this bound in `debug`
    = note: this error originates in the macro `wasmtime::component::bindgen` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: `HostStream<u8>` doesn't implement `std::fmt::Debug`
   --> crates/wasi/src/p3/bindings.rs:117:5
    |
117 | /     wasmtime::component::bindgen!({
118 | |         path: "src/p3/wit",
119 | |         world: "wasi:cli/command",
120 | |         tracing: true,
...   |
167 | |         },
168 | |     });
    | |______^ `HostStream<u8>` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `HostStream<u8>`
    = help: the trait `tracing::Value` is implemented for `DebugValue<T>`
    = note: required for `std::result::Result<HostStream<u8>, wasmtime::Error>` to implement `std::fmt::Debug`
    = note: 1 redundant requirement hidden
    = note: required for `&std::result::Result<HostStream<u8>, wasmtime::Error>` to implement `std::fmt::Debug`
    = note: required for `DebugValue<&std::result::Result<HostStream<u8>, wasmtime::Error>>` to implement `tracing::Value`
    = note: required for the cast from `&DebugValue<&std::result::Result<HostStream<u8>, wasmtime::Error>>` to `&dyn tracing::Value`
    = note: this error originates in the macro `$crate::valueset` which comes from the expansion of the macro `wasmtime::component::bindgen` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: `HostStream<u8>` doesn't implement `std::fmt::Debug`
   --> crates/wasi/src/p3/bindings.rs:117:5
    |
117 | /     wasmtime::component::bindgen!({
118 | |         path: "src/p3/wit",
119 | |         world: "wasi:cli/command",
120 | |         tracing: true,
...   |
167 | |         },
168 | |     });
    | |______^ `HostStream<u8>` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `HostStream<u8>`
    = note: required for `&HostStream<u8>` to implement `std::fmt::Debug`
note: required by a bound in `tracing::field::debug`
   --> /Users/rvolosatovs/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tracing-core-0.1.31/src/field.rs:365:8
    |
363 | pub fn debug<T>(t: T) -> DebugValue<T>
    |        ----- required by a bound in this function
364 | where
365 |     T: fmt::Debug,
    |        ^^^^^^^^^^ required by this bound in `debug`
    = note: this error originates in the macro `wasmtime::component::bindgen` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: `HostStream<u8>` doesn't implement `std::fmt::Debug`
   --> crates/wasi/src/p3/bindings.rs:117:5
    |
117 | /     wasmtime::component::bindgen!({
118 | |         path: "src/p3/wit",
119 | |         world: "wasi:cli/command",
120 | |         tracing: true,
...   |
167 | |         },
168 | |     });
    | |______^ `HostStream<u8>` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `HostStream<u8>`
    = help: the trait `tracing::Value` is implemented for `DebugValue<T>`
    = note: required for `&HostStream<u8>` to implement `std::fmt::Debug`
    = note: required for `DebugValue<&HostStream<u8>>` to implement `tracing::Value`
    = note: required for the cast from `&DebugValue<&HostStream<u8>>` to `&dyn tracing::Value`
    = note: this error originates in the macro `$crate::valueset` which comes from the expansion of the macro `wasmtime::component::bindgen` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: `HostStream<u8>` doesn't implement `std::fmt::Debug`
   --> crates/wasi/src/p3/bindings.rs:117:5
    |
117 | /     wasmtime::component::bindgen!({
118 | |         path: "src/p3/wit",
119 | |         world: "wasi:cli/command",
120 | |         tracing: true,
...   |
167 | |         },
168 | |     });
    | |______^ `HostStream<u8>` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `HostStream<u8>`
    = help: the trait `std::fmt::Debug` is implemented for `std::result::Result<T, E>`
    = note: required for `(HostStream<u8>, HostFuture<Result<(), ErrorCode>>)` to implement `std::fmt::Debug`
    = note: 2 redundant requirements hidden
    = note: required for `&Result<(HostStream<u8>, HostFuture<Result<(), ...>>), ...>` to implement `std::fmt::Debug`
note: required by a bound in `tracing::field::debug`
   --> /Users/rvolosatovs/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tracing-core-0.1.31/src/field.rs:365:8
    |
363 | pub fn debug<T>(t: T) -> DebugValue<T>
    |        ----- required by a bound in this function
364 | where
365 |     T: fmt::Debug,
    |        ^^^^^^^^^^ required by this bound in `debug`
    = note: the full name for the type has been written to '/Users/rvolosatovs/src/github.com/bytecodealliance/wasmtime/target/debug/deps/wasmtime_wasi-d64b71307fef0f36.long-type-14822806477592345179.txt'
    = note: consider using `--verbose` to print the full type name to the console
    = note: this error originates in the macro `wasmtime::component::bindgen` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: `HostFuture<Result<(), ErrorCode>>` doesn't implement `std::fmt::Debug`
   --> crates/wasi/src/p3/bindings.rs:117:5
    |
117 | /     wasmtime::component::bindgen!({
118 | |         path: "src/p3/wit",
119 | |         world: "wasi:cli/command",
120 | |         tracing: true,
...   |
167 | |         },
168 | |     });
    | |______^ `HostFuture<Result<(), ErrorCode>>` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `HostFuture<Result<(), ErrorCode>>`
    = help: the trait `std::fmt::Debug` is implemented for `std::result::Result<T, E>`
    = note: required for `(HostStream<u8>, HostFuture<Result<(), ErrorCode>>)` to implement `std::fmt::Debug`
    = note: 2 redundant requirements hidden
    = note: required for `&Result<(HostStream<u8>, HostFuture<Result<(), ...>>), ...>` to implement `std::fmt::Debug`
note: required by a bound in `tracing::field::debug`
   --> /Users/rvolosatovs/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tracing-core-0.1.31/src/field.rs:365:8
    |
363 | pub fn debug<T>(t: T) -> DebugValue<T>
    |        ----- required by a bound in this function
364 | where
365 |     T: fmt::Debug,
    |        ^^^^^^^^^^ required by this bound in `debug`
    = note: the full name for the type has been written to '/Users/rvolosatovs/src/github.com/bytecodealliance/wasmtime/target/debug/deps/wasmtime_wasi-d64b71307fef0f36.long-type-5122028963844032631.txt'
    = note: consider using `--verbose` to print the full type name to the console
    = note: this error originates in the macro `wasmtime::component::bindgen` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: `HostStream<p3::bindings::generated::wasi::filesystem::types::DirectoryEntry>` doesn't implement `std::fmt::Debug`
   --> crates/wasi/src/p3/bindings.rs:117:5
    |
117 | /     wasmtime::component::bindgen!({
118 | |         path: "src/p3/wit",
119 | |         world: "wasi:cli/command",
120 | |         tracing: true,
...   |
167 | |         },
168 | |     });
    | |______^ `HostStream<p3::bindings::generated::wasi::filesystem::types::DirectoryEntry>` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `HostStream<p3::bindings::generated::wasi::filesystem::types::DirectoryEntry>`
    = help: the trait `std::fmt::Debug` is implemented for `std::result::Result<T, E>`
    = note: required for `(HostStream<DirectoryEntry>, HostFuture<Result<(), ErrorCode>>)` to implement `std::fmt::Debug`
    = note: 2 redundant requirements hidden
    = note: required for `&Result<(HostStream<DirectoryEntry>, HostFuture<...>), ...>` to implement `std::fmt::Debug`
note: required by a bound in `tracing::field::debug`
   --> /Users/rvolosatovs/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tracing-core-0.1.31/src/field.rs:365:8
    |
363 | pub fn debug<T>(t: T) -> DebugValue<T>
    |        ----- required by a bound in this function
364 | where
365 |     T: fmt::Debug,
    |        ^^^^^^^^^^ required by this bound in `debug`
    = note: the full name for the type has been written to '/Users/rvolosatovs/src/github.com/bytecodealliance/wasmtime/target/debug/deps/wasmtime_wasi-d64b71307fef0f36.long-type-4157191365064489854.txt'
    = note: consider using `--verbose` to print the full type name to the console
    = note: this error originates in the macro `wasmtime::component::bindgen` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: `HostFuture<Result<(), ErrorCode>>` doesn't implement `std::fmt::Debug`
   --> crates/wasi/src/p3/bindings.rs:117:5
    |
117 | /     wasmtime::component::bindgen!({
118 | |         path: "src/p3/wit",
119 | |         world: "wasi:cli/command",
120 | |         tracing: true,
...   |
167 | |         },
168 | |     });
    | |______^ `HostFuture<Result<(), ErrorCode>>` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `HostFuture<Result<(), ErrorCode>>`
    = help: the trait `tracing::Value` is implemented for `DebugValue<T>`
    = note: required for `(HostStream<u8>, HostFuture<Result<(), ErrorCode>>)` to implement `std::fmt::Debug`
    = note: 2 redundant requirements hidden
    = note: required for `&Result<(HostStream<u8>, HostFuture<Result<(), ...>>), ...>` to implement `std::fmt::Debug`
    = note: required for `DebugValue<&Result<(HostStream<u8>, HostFuture<...>), ...>>` to implement `tracing::Value`
    = note: required for the cast from `&DebugValue<&Result<(HostStream<u8>, HostFuture<...>), ...>>` to `&dyn tracing::Value`
    = note: the full name for the type has been written to '/Users/rvolosatovs/src/github.com/bytecodealliance/wasmtime/target/debug/deps/wasmtime_wasi-d64b71307fef0f36.long-type-5122028963844032631.txt'
    = note: consider using `--verbose` to print the full type name to the console
    = note: this error originates in the macro `$crate::valueset` which comes from the expansion of the macro `wasmtime::component::bindgen` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: `HostStream<p3::bindings::generated::wasi::filesystem::types::DirectoryEntry>` doesn't implement `std::fmt::Debug`
   --> crates/wasi/src/p3/bindings.rs:117:5
    |
117 | /     wasmtime::component::bindgen!({
118 | |         path: "src/p3/wit",
119 | |         world: "wasi:cli/command",
120 | |         tracing: true,
...   |
167 | |         },
168 | |     });
    | |______^ `HostStream<p3::bindings::generated::wasi::filesystem::types::DirectoryEntry>` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `HostStream<p3::bindings::generated::wasi::filesystem::types::DirectoryEntry>`
    = help: the trait `tracing::Value` is implemented for `DebugValue<T>`
    = note: required for `(HostStream<DirectoryEntry>, HostFuture<Result<(), ErrorCode>>)` to implement `std::fmt::Debug`
    = note: 2 redundant requirements hidden
    = note: required for `&Result<(HostStream<DirectoryEntry>, HostFuture<...>), ...>` to implement `std::fmt::Debug`
    = note: required for `DebugValue<&Result<(HostStream<DirectoryEntry>, ...), ...>>` to implement `tracing::Value`
    = note: required for the cast from `&DebugValue<&Result<(HostStream<DirectoryEntry>, ...), ...>>` to `&dyn tracing::Value`
    = note: the full name for the type has been written to '/Users/rvolosatovs/src/github.com/bytecodealliance/wasmtime/target/debug/deps/wasmtime_wasi-d64b71307fef0f36.long-type-4157191365064489854.txt'
    = note: consider using `--verbose` to print the full type name to the console
    = note: this error originates in the macro `$crate::valueset` which comes from the expansion of the macro `wasmtime::component::bindgen` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: `HostStream<Resource<TcpSocket>>` doesn't implement `std::fmt::Debug`
   --> crates/wasi/src/p3/bindings.rs:117:5
    |
117 | /     wasmtime::component::bindgen!({
118 | |         path: "src/p3/wit",
119 | |         world: "wasi:cli/command",
120 | |         tracing: true,
...   |
167 | |         },
168 | |     });
    | |______^ `HostStream<Resource<TcpSocket>>` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `HostStream<Resource<TcpSocket>>`
    = help: the trait `std::fmt::Debug` is implemented for `std::result::Result<T, E>`
    = note: required for `Result<HostStream<Resource<TcpSocket>>, ErrorCode>` to implement `std::fmt::Debug`
    = note: 2 redundant requirements hidden
    = note: required for `&Result<Result<HostStream<Resource<TcpSocket>>, ...>, ...>` to implement `std::fmt::Debug`
note: required by a bound in `tracing::field::debug`
   --> /Users/rvolosatovs/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tracing-core-0.1.31/src/field.rs:365:8
    |
363 | pub fn debug<T>(t: T) -> DebugValue<T>
    |        ----- required by a bound in this function
364 | where
365 |     T: fmt::Debug,
    |        ^^^^^^^^^^ required by this bound in `debug`
    = note: the full name for the type has been written to '/Users/rvolosatovs/src/github.com/bytecodealliance/wasmtime/target/debug/deps/wasmtime_wasi-d64b71307fef0f36.long-type-11162026718848291328.txt'
    = note: consider using `--verbose` to print the full type name to the console
    = note: this error originates in the macro `wasmtime::component::bindgen` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: `HostFuture<Result<(), ErrorCode>>` doesn't implement `std::fmt::Debug`
   --> crates/wasi/src/p3/bindings.rs:117:5
    |
117 | /     wasmtime::component::bindgen!({
118 | |         path: "src/p3/wit",
119 | |         world: "wasi:cli/command",
120 | |         tracing: true,
...   |
167 | |         },
168 | |     });
    | |______^ `HostFuture<Result<(), ErrorCode>>` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `HostFuture<Result<(), ErrorCode>>`
    = help: the trait `std::fmt::Debug` is implemented for `std::result::Result<T, E>`
    = note: required for `(HostStream<u8>, HostFuture<Result<(), ErrorCode>>)` to implement `std::fmt::Debug`
    = note: 2 redundant requirements hidden
    = note: required for `&Result<(HostStream<u8>, HostFuture<Result<(), ...>>), ...>` to implement `std::fmt::Debug`
note: required by a bound in `tracing::field::debug`
   --> /Users/rvolosatovs/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tracing-core-0.1.31/src/field.rs:365:8
    |
363 | pub fn debug<T>(t: T) -> DebugValue<T>
    |        ----- required by a bound in this function
364 | where
365 |     T: fmt::Debug,
    |        ^^^^^^^^^^ required by this bound in `debug`
    = note: the full name for the type has been written to '/Users/rvolosatovs/src/github.com/bytecodealliance/wasmtime/target/debug/deps/wasmtime_wasi-d64b71307fef0f36.long-type-15637155410496564636.txt'
    = note: consider using `--verbose` to print the full type name to the console
    = note: this error originates in the macro `wasmtime::component::bindgen` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: `HostStream<Resource<TcpSocket>>` doesn't implement `std::fmt::Debug`
   --> crates/wasi/src/p3/bindings.rs:117:5
    |
117 | /     wasmtime::component::bindgen!({
118 | |         path: "src/p3/wit",
119 | |         world: "wasi:cli/command",
120 | |         tracing: true,
...   |
167 | |         },
168 | |     });
    | |______^ `HostStream<Resource<TcpSocket>>` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `HostStream<Resource<TcpSocket>>`
    = help: the trait `tracing::Value` is implemented for `DebugValue<T>`
    = note: required for `Result<HostStream<Resource<TcpSocket>>, ErrorCode>` to implement `std::fmt::Debug`
    = note: 2 redundant requirements hidden
    = note: required for `&Result<Result<HostStream<Resource<TcpSocket>>, ...>, ...>` to implement `std::fmt::Debug`
    = note: required for `DebugValue<&Result<Result<HostStream<...>, ...>, ...>>` to implement `tracing::Value`
    = note: required for the cast from `&DebugValue<&Result<Result<HostStream<...>, ...>, ...>>` to `&dyn tracing::Value`
    = note: the full name for the type has been written to '/Users/rvolosatovs/src/github.com/bytecodealliance/wasmtime/target/debug/deps/wasmtime_wasi-d64b71307fef0f36.long-type-11162026718848291328.txt'
    = note: consider using `--verbose` to print the full type name to the console
    = note: this error originates in the macro `$crate::valueset` which comes from the expansion of the macro `wasmtime::component::bindgen` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: `HostFuture<Result<(), ErrorCode>>` doesn't implement `std::fmt::Debug`
   --> crates/wasi/src/p3/bindings.rs:117:5
    |
117 | /     wasmtime::component::bindgen!({
118 | |         path: "src/p3/wit",
119 | |         world: "wasi:cli/command",
120 | |         tracing: true,
...   |
167 | |         },
168 | |     });
    | |______^ `HostFuture<Result<(), ErrorCode>>` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `HostFuture<Result<(), ErrorCode>>`
    = help: the trait `tracing::Value` is implemented for `DebugValue<T>`
    = note: required for `(HostStream<u8>, HostFuture<Result<(), ErrorCode>>)` to implement `std::fmt::Debug`
    = note: 2 redundant requirements hidden
    = note: required for `&Result<(HostStream<u8>, HostFuture<Result<(), ...>>), ...>` to implement `std::fmt::Debug`
    = note: required for `DebugValue<&Result<(HostStream<u8>, HostFuture<...>), ...>>` to implement `tracing::Value`
    = note: required for the cast from `&DebugValue<&Result<(HostStream<u8>, HostFuture<...>), ...>>` to `&dyn tracing::Value`
    = note: the full name for the type has been written to '/Users/rvolosatovs/src/github.com/bytecodealliance/wasmtime/target/debug/deps/wasmtime_wasi-d64b71307fef0f36.long-type-15637155410496564636.txt'
    = note: consider using `--verbose` to print the full type name to the console
    = note: this error originates in the macro `$crate::valueset` which comes from the expansion of the macro `wasmtime::component::bindgen` (in Nightly builds, run with -Z macro-backtrace for more info)

Versions and Environment

Wasmtime version or commit: 2b83228 with patches

Operating system: MacOS

Architecture: aarch64-darwin

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions