diff --git a/Cargo.lock b/Cargo.lock index e84eb5adfb66..3b6e0bb5a7f0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1827,6 +1827,16 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + [[package]] name = "num-traits" version = "0.2.15" @@ -1938,6 +1948,12 @@ dependencies = [ "pretty_env_logger 0.4.0", ] +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + [[package]] name = "paste" version = "1.0.7" @@ -2824,6 +2840,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" dependencies = [ "matchers", + "nu-ansi-term", "once_cell", "regex", "sharded-slab", @@ -3376,6 +3393,7 @@ dependencies = [ "tempfile", "test-programs-artifacts", "tokio", + "tracing-subscriber", "walkdir", "wasm-encoder", "wasmparser", diff --git a/Cargo.toml b/Cargo.toml index c029cb08c13e..ec36b875ec19 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,6 +39,7 @@ wasmtime-runtime = { workspace = true } clap = { workspace = true, features = ["color", "suggestions", "derive"] } anyhow = { workspace = true } target-lexicon = { workspace = true } +tracing-subscriber = { workspace = true } once_cell = { workspace = true } listenfd = "1.0.0" wat = { workspace = true } @@ -263,7 +264,7 @@ indexmap = "2.0.0" pretty_env_logger = "0.5.0" syn = "2.0.25" test-log = { version = "0.2", default-features = false, features = ["trace"] } -tracing-subscriber = { version = "0.3.1", default-features = false, features = ['fmt', 'env-filter'] } +tracing-subscriber = { version = "0.3.1", default-features = false, features = ['fmt', 'env-filter', 'ansi'] } url = "2.3.1" [features] diff --git a/src/bin/wasmtime.rs b/src/bin/wasmtime.rs index 46868b3aca05..6e289a74b0f3 100644 --- a/src/bin/wasmtime.rs +++ b/src/bin/wasmtime.rs @@ -82,6 +82,16 @@ impl Wasmtime { } fn main() -> Result<()> { + use std::io::IsTerminal; + use tracing_subscriber::{EnvFilter, FmtSubscriber}; + + let mut b = FmtSubscriber::builder() + .with_writer(std::io::stderr) + .with_env_filter(EnvFilter::from_env("WASMTIME_LOG")); + if std::io::stderr().is_terminal() { + b = b.with_ansi(true); + } + b.init(); Wasmtime::parse().execute() } diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml index 075dd2052ca5..f03ba4690de3 100644 --- a/supply-chain/audits.toml +++ b/supply-chain/audits.toml @@ -1626,6 +1626,12 @@ criteria = "safe-to-deploy" version = "0.2.11" notes = "build is only looking for environment variables to set cfg. only two minor uses of unsafe,on macos, with ffi bindings to digest primitives and libc atexit. otherwise, this is an abstraction over three very complex systems (schannel, security-framework, and openssl) which may end up having subtle differences, but none of those are apparent from the implementation of this crate" +[[audits.nu-ansi-term]] +who = "Pat Hickey " +criteria = "safe-to-deploy" +version = "0.46.0" +notes = "one use of unsafe to call windows specific api to get console handle." + [[audits.object]] who = "Chris Fallin " criteria = "safe-to-deploy" @@ -1707,6 +1713,12 @@ who = "Andrew Brown " criteria = "safe-to-deploy" delta = "0.4.2 -> 0.5.0" +[[audits.overload]] +who = "Pat Hickey " +criteria = "safe-to-deploy" +version = "0.1.1" +notes = "small crate, only defines macro-rules!, nicely documented as well" + [[audits.peeking_take_while]] who = "Nick Fitzgerald " criteria = "safe-to-deploy" @@ -1904,6 +1916,12 @@ criteria = "safe-to-deploy" delta = "0.9.9 -> 0.10.2" notes = "This upgrade is mostly a code refactor, as far as I can tell. No new uses of unsafe nor any new ambient capabilities usage." +[[audits.sharded-slab]] +who = "Pat Hickey " +criteria = "safe-to-deploy" +version = "0.1.4" +notes = "I always really enjoy reading eliza's code, she left perfect comments at every use of unsafe." + [[audits.signal-hook-registry]] who = "Pat Hickey " criteria = "safe-to-deploy" @@ -2017,6 +2035,12 @@ who = "Pat Hickey " criteria = "safe-to-deploy" version = "0.2.11" +[[audits.thread_local]] +who = "Pat Hickey " +criteria = "safe-to-deploy" +version = "1.1.4" +notes = "uses unsafe to implement thread local storage of objects" + [[audits.tinyvec]] who = "Alex Crichton " criteria = "safe-to-deploy" @@ -2096,6 +2120,11 @@ This is a relatively minor set of releases with minor refactorings and bug fixes. Nothing fundamental was added in these changes. """ +[[audits.tracing-subscriber]] +who = "Pat Hickey " +criteria = "safe-to-deploy" +version = "0.3.17" + [[audits.tracing-subscriber]] who = "Alex Crichton " criteria = "safe-to-run" diff --git a/supply-chain/config.toml b/supply-chain/config.toml index e1d1435fb93f..8a9194695100 100644 --- a/supply-chain/config.toml +++ b/supply-chain/config.toml @@ -169,9 +169,6 @@ audit-as-crates-io = true [policy.wasmtime-wit-bindgen] audit-as-crates-io = true -[policy.wasmtime-wmemcheck] -audit-as-crates-io = true - [policy.wiggle] audit-as-crates-io = true @@ -527,10 +524,6 @@ notes = "contains assembly language and object file implementations of crypto pr version = "0.3.0" criteria = "safe-to-deploy" -[[exemptions.sharded-slab]] -version = "0.1.4" -criteria = "safe-to-run" - [[exemptions.shellexpand]] version = "2.1.0" criteria = "safe-to-deploy" @@ -579,10 +572,6 @@ criteria = "safe-to-deploy" version = "0.1.17" criteria = "safe-to-deploy" -[[exemptions.thread_local]] -version = "1.1.4" -criteria = "safe-to-run" - [[exemptions.tinytemplate]] version = "1.2.1" criteria = "safe-to-run" @@ -608,10 +597,6 @@ criteria = "safe-to-deploy" version = "0.1.28" criteria = "safe-to-deploy" -[[exemptions.tracing-subscriber]] -version = "0.3.11" -criteria = "safe-to-run" - [[exemptions.typenum]] version = "1.15.0" criteria = "safe-to-deploy" diff --git a/supply-chain/imports.lock b/supply-chain/imports.lock index 50f08e4660f1..e80834140421 100644 --- a/supply-chain/imports.lock +++ b/supply-chain/imports.lock @@ -1010,12 +1010,6 @@ when = "2023-09-20" user-id = 73222 user-login = "wasmtime-publish" -[[publisher.wasmtime-wmemcheck]] -version = "13.0.0" -when = "2023-09-20" -user-id = 73222 -user-login = "wasmtime-publish" - [[publisher.wast]] version = "65.0.2" when = "2023-09-26" diff --git a/tests/all/cli_tests.rs b/tests/all/cli_tests.rs index 997738cdd848..a114e2a3e2be 100644 --- a/tests/all/cli_tests.rs +++ b/tests/all/cli_tests.rs @@ -32,7 +32,7 @@ pub fn get_wasmtime_command() -> Result { // If we're running tests with a "runner" then we might be doing something // like cross-emulation, so spin up the emulator rather than the tests // itself, which may not be natively executable. - let cmd = if let Some((_, runner)) = runner { + let mut cmd = if let Some((_, runner)) = runner { let mut parts = runner.split_whitespace(); let mut cmd = Command::new(parts.next().unwrap()); for arg in parts { @@ -44,6 +44,10 @@ pub fn get_wasmtime_command() -> Result { Command::new(&me) }; + if let Ok(val) = std::env::var("WASMTIME_LOG") { + cmd.env("WASMTIME_LOG", val); + } + Ok(cmd) }