diff --git a/Cargo.lock b/Cargo.lock index e6aae3e31a1..2756c0a21a8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -34,7 +34,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -262,7 +262,7 @@ checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" dependencies = [ "addr2line", "cc", - "cfg-if 1.0.0", + "cfg-if", "libc", "miniz_oxide 0.6.2", "object 0.30.4", @@ -307,9 +307,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.2" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbe3c979c178231552ecba20214a8272df4e09f232a87aef4320cf06539aded" +checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" [[package]] name = "bitvec" @@ -332,7 +332,7 @@ dependencies = [ "arrayref", "arrayvec 0.7.4", "cc", - "cfg-if 1.0.0", + "cfg-if", "constant_time_eq", "digest", ] @@ -501,12 +501,6 @@ dependencies = [ "jobserver", ] -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -705,7 +699,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen", ] @@ -750,7 +744,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9847f90f32a50b0dcbd68bc23ff242798b13080b97b0569f6ed96a45ce4cf2cd" dependencies = [ "autocfg", - "cfg-if 1.0.0", + "cfg-if", "libc", "scopeguard", "windows-sys 0.33.0", @@ -874,7 +868,7 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -925,7 +919,7 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", ] @@ -935,7 +929,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] @@ -947,7 +941,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" dependencies = [ "autocfg", - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", "memoffset 0.9.0", "scopeguard", @@ -959,7 +953,7 @@ version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1149,7 +1143,7 @@ version = "5.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "hashbrown 0.12.3", "lock_api", "once_cell", @@ -1228,7 +1222,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "dirs-sys-next", ] @@ -1343,7 +1337,7 @@ version = "0.8.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1464,7 +1458,7 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5cbc844cecaee9d4443931972e1289c8ff485cb4cc2767cb03ca139ed6885153" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall 0.2.16", "windows-sys 0.48.0", @@ -1660,7 +1654,7 @@ version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "libc", "wasi", @@ -2179,7 +2173,7 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -2224,18 +2218,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "isatty" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e31a8281fc93ec9693494da65fbf28c0c2aa60a2eaec25dc58e2f31952e95edc" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "redox_syscall 0.1.57", - "winapi", -] - [[package]] name = "itertools" version = "0.10.5" @@ -2300,7 +2282,7 @@ checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" dependencies = [ "arrayvec 0.5.2", "bitflags 1.3.2", - "cfg-if 1.0.0", + "cfg-if", "ryu", "static_assertions", ] @@ -2337,7 +2319,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d580318f95776505201b28cf98eb1fa5e4be3b689633ba6a3e6cd880ff22d8cb" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "windows-sys 0.48.0", ] @@ -2647,7 +2629,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" dependencies = [ "bitflags 1.3.2", - "cfg-if 1.0.0", + "cfg-if", "libc", "memoffset 0.6.5", ] @@ -2660,7 +2642,7 @@ checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4" dependencies = [ "autocfg", "bitflags 1.3.2", - "cfg-if 1.0.0", + "cfg-if", "libc", "memoffset 0.6.5", "pin-utils", @@ -2796,7 +2778,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d" dependencies = [ "bitflags 1.3.2", - "cfg-if 1.0.0", + "cfg-if", "foreign-types", "libc", "once_cell", @@ -2887,7 +2869,7 @@ version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "instant", "libc", "redox_syscall 0.2.16", @@ -2901,7 +2883,7 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall 0.3.5", "smallvec", @@ -3325,12 +3307,6 @@ dependencies = [ "num_cpus", ] -[[package]] -name = "redox_syscall" -version = "0.1.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" - [[package]] name = "redox_syscall" version = "0.2.16" @@ -3798,7 +3774,7 @@ version = "0.35.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3586be2cf6c0a8099a79a12b4084357aa9b3e0b0d7980e3b67aaf7a9d55f9f0" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "version-compare", ] @@ -4044,7 +4020,7 @@ version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest", ] @@ -4345,7 +4321,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" dependencies = [ "autocfg", - "cfg-if 1.0.0", + "cfg-if", "fastrand", "redox_syscall 0.3.5", "rustix", @@ -4422,7 +4398,7 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89e8bf7e0eb2dd7b4228cc1b6821fc5114cd6841ae59f652a85488c016091e5f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "getopts", "libc", "num_cpus", @@ -4464,7 +4440,7 @@ version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", ] @@ -4700,7 +4676,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8bd22a874a2d0b70452d5597b12c537331d49060824a95f49f108994f94aa4c" dependencies = [ - "bitflags 2.3.2", + "bitflags 2.3.3", "bytes", "futures-core", "futures-util", @@ -4732,7 +4708,7 @@ version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "log", "pin-project-lite", "tracing-attributes", @@ -5279,7 +5255,7 @@ version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen-macro", ] @@ -5327,7 +5303,7 @@ version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -5471,7 +5447,7 @@ version = "4.0.0" dependencies = [ "anyhow", "bytes", - "cfg-if 1.0.0", + "cfg-if", "derivative", "hashbrown 0.11.2", "indexmap", @@ -5542,7 +5518,7 @@ name = "wasmer-c-api" version = "4.0.0" dependencies = [ "cbindgen", - "cfg-if 1.0.0", + "cfg-if", "enumset", "field-offset", "inline-c", @@ -5610,7 +5586,7 @@ dependencies = [ "bytes", "bytesize", "cargo_metadata", - "cfg-if 1.0.0", + "cfg-if", "chrono", "clap 4.3.5", "colored 2.0.0", @@ -5621,7 +5597,7 @@ dependencies = [ "hex", "indexmap", "indicatif", - "isatty", + "is-terminal", "libc", "log", "object 0.30.4", @@ -5677,7 +5653,7 @@ name = "wasmer-compiler" version = "4.0.0" dependencies = [ "backtrace", - "cfg-if 1.0.0", + "cfg-if", "enum-iterator", "enumset", "hashbrown 0.11.2", @@ -5702,13 +5678,13 @@ name = "wasmer-compiler-cli" version = "4.0.0" dependencies = [ "anyhow", - "atty", "bytesize", - "cfg-if 1.0.0", + "cfg-if", "clap 4.3.5", "colored 2.0.0", "distance", "fern", + "is-terminal", "log", "target-lexicon 0.12.8", "unix_mode", @@ -6085,7 +6061,7 @@ version = "4.0.0" dependencies = [ "backtrace", "cc", - "cfg-if 1.0.0", + "cfg-if", "corosensei", "dashmap", "derivative", @@ -6114,7 +6090,7 @@ dependencies = [ "async-trait", "bincode", "bytes", - "cfg-if 1.0.0", + "cfg-if", "chrono", "cooked-waker", "dashmap", @@ -6195,7 +6171,7 @@ dependencies = [ "anyhow", "bitflags 1.3.2", "byteorder", - "cfg-if 1.0.0", + "cfg-if", "num_enum", "pretty_assertions", "serde", @@ -6256,7 +6232,7 @@ version = "4.0.0" dependencies = [ "anyhow", "build-deps", - "cfg-if 1.0.0", + "cfg-if", "compiler-test-derive", "criterion", "glob", diff --git a/lib/cli-compiler/Cargo.toml b/lib/cli-compiler/Cargo.toml index cc80d2c625f..3d7fabc02ea 100644 --- a/lib/cli-compiler/Cargo.toml +++ b/lib/cli-compiler/Cargo.toml @@ -22,7 +22,7 @@ doc = false [dependencies] wasmer-compiler = { version = "=4.0.0", path = "../compiler", features = ["compiler"] } wasmer-types = { version = "=4.0.0", path = "../types" } -atty = "0.2" +is-terminal = "0.4.7" colored = "2.0" anyhow = "1.0" # For the function names autosuggestion diff --git a/lib/cli-compiler/src/utils.rs b/lib/cli-compiler/src/utils.rs index a0c5d0912a6..7a4a925460d 100644 --- a/lib/cli-compiler/src/utils.rs +++ b/lib/cli-compiler/src/utils.rs @@ -1,5 +1,6 @@ //! Utility functions for the WebAssembly module use anyhow::{bail, Context, Result}; +use is_terminal::IsTerminal; use std::path::PathBuf; use std::{env, path::Path}; @@ -8,7 +9,7 @@ pub fn wasmer_should_print_color() -> bool { env::var("WASMER_COLOR") .ok() .and_then(|inner| inner.parse::().ok()) - .unwrap_or_else(|| atty::is(atty::Stream::Stdout)) + .unwrap_or_else(|| std::io::stdout().is_terminal()) } fn retrieve_alias_pathbuf(alias: &str, real_dir: &str) -> Result<(String, PathBuf)> { diff --git a/lib/cli/Cargo.toml b/lib/cli/Cargo.toml index f4c4233f935..87e23d8d231 100644 --- a/lib/cli/Cargo.toml +++ b/lib/cli/Cargo.toml @@ -52,6 +52,7 @@ wasmer-deploy-cli = { version = "0.1.16", default-features = false } # Third-party dependencies. atty = "0.2" +is-terminal = "0.4.7" colored = "2.0" anyhow = "1.0" spinoff = "0.5.4" @@ -74,7 +75,6 @@ regex = "1.6.0" toml = "0.5.9" url = "2.3.1" libc = { version = "^0.2", default-features = false } -isatty = "0.1.9" dialoguer = "0.10.2" tldextract = "0.6.0" hex = "0.4.3" diff --git a/lib/cli/src/logging.rs b/lib/cli/src/logging.rs index 80d8121cb2f..248ef43d30f 100644 --- a/lib/cli/src/logging.rs +++ b/lib/cli/src/logging.rs @@ -1,5 +1,6 @@ //! Logging functions for the debug feature. +use is_terminal::IsTerminal; use tracing::level_filters::LevelFilter; use tracing_subscriber::{fmt, layer::SubscriberExt, util::SubscriberInitExt, EnvFilter}; @@ -88,7 +89,7 @@ impl Output { /// For more, see https://github.com/tokio-rs/tracing/issues/2388 fn should_emit_colors(&self) -> bool { match self.color { - clap::ColorChoice::Auto => isatty::stderr_isatty(), + clap::ColorChoice::Auto => std::io::stderr().is_terminal(), clap::ColorChoice::Always => true, clap::ColorChoice::Never => false, } diff --git a/lib/cli/src/utils.rs b/lib/cli/src/utils.rs index 14041120722..970b1dfc537 100644 --- a/lib/cli/src/utils.rs +++ b/lib/cli/src/utils.rs @@ -1,5 +1,6 @@ //! Utility functions for the WebAssembly module use anyhow::{bail, Result}; +use is_terminal::IsTerminal; use std::env; use std::path::PathBuf; use wasmer_wasix::runners::MappedDirectory; @@ -9,7 +10,7 @@ pub fn wasmer_should_print_color() -> bool { env::var("WASMER_COLOR") .ok() .and_then(|inner| inner.parse::().ok()) - .unwrap_or_else(|| atty::is(atty::Stream::Stdout)) + .unwrap_or_else(|| std::io::stdout().is_terminal()) } fn retrieve_alias_pathbuf(alias: &str, real_dir: &str) -> Result {