diff --git a/.cargo/config.toml b/.cargo/config.toml index 28198e936c6..d4cebf551ca 100755 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -31,7 +31,6 @@ rustflags = [ # "-Wclippy::same_name_method", "-Aclippy::default_constructed_unit_structs", - "--cfg", "tokio_unstable" ] # Fix napi breaking in test environment diff --git a/Cargo.lock b/Cargo.lock index af711184144..5f01920ac98 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -155,28 +155,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "async-stream" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" -dependencies = [ - "async-stream-impl", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-stream-impl" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.90", -] - [[package]] name = "async-trait" version = "0.1.83" @@ -197,12 +175,6 @@ dependencies = [ "critical-section", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "auto_impl" version = "1.2.0" @@ -220,53 +192,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" -[[package]] -name = "axum" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f43644eed690f5374f1af436ecd6aea01cd201f6fbdf0178adaf6907afb2cec" -dependencies = [ - "async-trait", - "axum-core", - "bytes", - "futures-util", - "http", - "http-body", - "http-body-util", - "itoa", - "matchit", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "rustversion", - "serde", - "sync_wrapper 1.0.1", - "tower 0.5.1", - "tower-layer", - "tower-service", -] - -[[package]] -name = "axum-core" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6b8ba012a258d63c9adfa28b9ddcf66149da6f986c5b5452e629d5ee64bf00" -dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http", - "http-body", - "http-body-util", - "mime", - "pin-project-lite", - "rustversion", - "sync_wrapper 1.0.1", - "tower-layer", - "tower-service", -] - [[package]] name = "backtrace" version = "0.3.68" @@ -652,45 +577,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "console-api" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ed14aa9c9f927213c6e4f3ef75faaad3406134efe84ba2cb7983431d5f0931" -dependencies = [ - "futures-core", - "prost", - "prost-types", - "tonic", - "tracing-core", -] - -[[package]] -name = "console-subscriber" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e3a111a37f3333946ebf9da370ba5c5577b18eb342ec683eb488dd21980302" -dependencies = [ - "console-api", - "crossbeam-channel", - "crossbeam-utils", - "futures-task", - "hdrhistogram", - "humantime", - "hyper-util", - "prost", - "prost-types", - "serde", - "serde_json", - "thread_local", - "tokio", - "tokio-stream", - "tonic", - "tracing", - "tracing-core", - "tracing-subscriber", -] - [[package]] name = "const-str" version = "0.3.2" @@ -1715,25 +1601,6 @@ dependencies = [ "regex-syntax 0.8.5", ] -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap 2.7.0", - "slab", - "tokio", - "tokio-util", - "tracing", -] - [[package]] name = "half" version = "2.4.1" @@ -1825,19 +1692,6 @@ dependencies = [ "hashbrown 0.14.5", ] -[[package]] -name = "hdrhistogram" -version = "7.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "765c9198f173dd59ce26ff9f95ef0aafd0a0fe01fb9d72841bc5066a4c06511d" -dependencies = [ - "base64 0.21.7", - "byteorder", - "flate2", - "nom", - "num-traits", -] - [[package]] name = "heapless" version = "0.7.17" @@ -1912,101 +1766,6 @@ dependencies = [ "itoa", ] -[[package]] -name = "http-body" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" -dependencies = [ - "bytes", - "http", -] - -[[package]] -name = "http-body-util" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" -dependencies = [ - "bytes", - "futures-util", - "http", - "http-body", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - -[[package]] -name = "hyper" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "smallvec", - "tokio", - "want", -] - -[[package]] -name = "hyper-timeout" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3203a961e5c83b6f5498933e78b6b263e208c197b63e9c6c53cc82ffd3f63793" -dependencies = [ - "hyper", - "hyper-util", - "pin-project-lite", - "tokio", - "tower-service", -] - -[[package]] -name = "hyper-util" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "http", - "http-body", - "hyper", - "pin-project-lite", - "socket2 0.5.7", - "tokio", - "tower 0.4.13", - "tower-service", - "tracing", -] - [[package]] name = "iana-time-zone" version = "0.1.57" @@ -2566,12 +2325,6 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" -[[package]] -name = "matchit" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" - [[package]] name = "md4" version = "0.10.2" @@ -2723,17 +2476,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "mio" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" -dependencies = [ - "libc", - "wasi", - "windows-sys 0.52.0", -] - [[package]] name = "more-asserts" version = "0.2.2" @@ -3348,38 +3090,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "prost" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b0487d90e047de87f984913713b85c601c05609aad5b0df4b4573fbf69aa13f" -dependencies = [ - "bytes", - "prost-derive", -] - -[[package]] -name = "prost-derive" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9552f850d5f0964a4e4d0bf306459ac29323ddfbae05e35a7c0d35cb0803cc5" -dependencies = [ - "anyhow", - "itertools 0.13.0", - "proc-macro2", - "quote", - "syn 2.0.90", -] - -[[package]] -name = "prost-types" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4759aa0d3a6232fb8dbdb97b61de2c20047c68aca932c7ed76da9d788508d670" -dependencies = [ - "prost", -] - [[package]] name = "psm" version = "0.1.21" @@ -4988,7 +4698,6 @@ dependencies = [ name = "rspack_tracing" version = "0.2.0" dependencies = [ - "console-subscriber", "tracing", "tracing-chrome", "tracing-subscriber", @@ -5402,16 +5111,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "socket2" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - [[package]] name = "sourcemap" version = "9.0.0" @@ -6745,18 +6444,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - -[[package]] -name = "sync_wrapper" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" - [[package]] name = "synstructure" version = "0.13.1" @@ -6966,14 +6653,9 @@ checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" dependencies = [ "backtrace", "bytes", - "libc", - "mio 1.0.3", "parking_lot", "pin-project-lite", - "socket2 0.5.7", "tokio-macros", - "tracing", - "windows-sys 0.52.0", ] [[package]] @@ -7057,82 +6739,6 @@ dependencies = [ "winnow 0.6.20", ] -[[package]] -name = "tonic" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6f6ba989e4b2c58ae83d862d3a3e27690b6e3ae630d0deb59f3697f32aa88ad" -dependencies = [ - "async-stream", - "async-trait", - "axum", - "base64 0.22.1", - "bytes", - "h2", - "http", - "http-body", - "http-body-util", - "hyper", - "hyper-timeout", - "hyper-util", - "percent-encoding", - "pin-project", - "prost", - "socket2 0.5.7", - "tokio", - "tokio-stream", - "tower 0.4.13", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "indexmap 1.9.3", - "pin-project", - "pin-project-lite", - "rand", - "slab", - "tokio", - "tokio-util", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f" -dependencies = [ - "futures-core", - "futures-util", - "pin-project-lite", - "sync_wrapper 0.1.2", - "tower-layer", - "tower-service", -] - -[[package]] -name = "tower-layer" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" - -[[package]] -name = "tower-service" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" - [[package]] name = "tracing" version = "0.1.41" @@ -7216,12 +6822,6 @@ dependencies = [ "stable_deref_trait", ] -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - [[package]] name = "trybuild" version = "1.0.101" @@ -7483,9 +7083,9 @@ dependencies = [ "bytes", "derivative", "futures", - "mio 0.8.11", + "mio", "serde", - "socket2 0.4.9", + "socket2", "thiserror", "tracing", ] @@ -7608,15 +7208,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" diff --git a/crates/node_binding/binding.d.ts b/crates/node_binding/binding.d.ts index 3543cee6483..a2d051c980b 100644 --- a/crates/node_binding/binding.d.ts +++ b/crates/node_binding/binding.d.ts @@ -2037,7 +2037,7 @@ export interface RawTrustedTypes { * Author Donny/강동윤 * Copyright (c) */ -export declare function registerGlobalTrace(filter: string, layer: "chrome" | "logger"| "console", output: string): void +export declare function registerGlobalTrace(filter: string, layer: "chrome" | "logger", output: string): void export declare enum RegisterJsTapKind { CompilerThisCompilation = 0, diff --git a/crates/node_binding/src/lib.rs b/crates/node_binding/src/lib.rs index a7b9684295c..ad6d4d8d479 100644 --- a/crates/node_binding/src/lib.rs +++ b/crates/node_binding/src/lib.rs @@ -246,7 +246,7 @@ static GLOBAL_TRACE_STATE: Mutex = Mutex::new(TraceState::Off); #[napi] pub fn register_global_trace( filter: String, - #[napi(ts_arg_type = "\"chrome\" | \"logger\"| \"console\"")] layer: String, + #[napi(ts_arg_type = "\"chrome\" | \"logger\"")] layer: String, output: String, ) { let mut state = GLOBAL_TRACE_STATE @@ -255,10 +255,6 @@ pub fn register_global_trace( if matches!(&*state, TraceState::Off) { let guard = match layer.as_str() { "chrome" => rspack_tracing::enable_tracing_by_env_with_chrome_layer(&filter, &output), - "console" => { - rspack_tracing::enable_tracing_by_env_with_tokio_console(); - None - } "logger" => { rspack_tracing::enable_tracing_by_env(&filter, &output); None diff --git a/crates/rspack_tracing/Cargo.toml b/crates/rspack_tracing/Cargo.toml index 725b5790c07..ab3d079336d 100644 --- a/crates/rspack_tracing/Cargo.toml +++ b/crates/rspack_tracing/Cargo.toml @@ -9,7 +9,6 @@ version = "0.2.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -console-subscriber = { version = "0.4.0" } tracing = { workspace = true } tracing-chrome = "0.7.2" tracing-subscriber = { workspace = true, features = ["env-filter"] } diff --git a/crates/rspack_tracing/src/lib.rs b/crates/rspack_tracing/src/lib.rs index 95c76ca6aaf..bbe799e4164 100644 --- a/crates/rspack_tracing/src/lib.rs +++ b/crates/rspack_tracing/src/lib.rs @@ -84,17 +84,11 @@ fn generate_common_layers( } layers } -// register layer for tokio_console, and tokio_console use network to send trace info so no need to pass result by string back -pub fn enable_tracing_by_env_with_tokio_console() { - if !IS_TRACING_ENABLED.swap(true, Ordering::Relaxed) { - console_subscriber::init(); - } -} + pub fn enable_tracing_by_env_with_chrome_layer(filter: &str, output: &str) -> Option { if !IS_TRACING_ENABLED.swap(true, Ordering::Relaxed) { use tracing_chrome::ChromeLayerBuilder; use tracing_subscriber::prelude::*; - let console_layer = console_subscriber::ConsoleLayer::builder().spawn(); let trace_writer = TraceWriter::from(output); let (chrome_layer, guard) = ChromeLayerBuilder::new() .include_args(true) @@ -106,7 +100,6 @@ pub fn enable_tracing_by_env_with_chrome_layer(filter: &str, output: &str) -> Op tracing_subscriber::registry() .with(layers) .with(chrome_layer.with_filter(FilterEvent {})) - .with(console_layer) .init(); Some(guard) } else { diff --git a/justfile b/justfile index 311bd2e95de..82c749d578c 100755 --- a/justfile +++ b/justfile @@ -12,7 +12,7 @@ _default: setup: # Install Rust-related tools cargo install cargo-binstall - cargo binstall taplo-cli cargo-release cargo-insta cargo-deny tokio-console -y + cargo binstall taplo-cli cargo-release cargo-insta cargo-deny -y # Setup Node.js environment corepack enable diff --git a/packages/rspack-cli/src/utils/profile.ts b/packages/rspack-cli/src/utils/profile.ts index 6681733fe9a..bffa100f9de 100644 --- a/packages/rspack-cli/src/utils/profile.ts +++ b/packages/rspack-cli/src/utils/profile.ts @@ -134,7 +134,7 @@ function resolveRustTraceOptions(value: string): RustTraceOptions { layer === "chrome" ? parsed.get("output") || defaultRustTraceChromeOutput : parsed.get("output") || defaultRustTraceLoggerOutput; - if (layer !== "chrome" && layer !== "logger" && layer !== "console") { + if (layer !== "chrome" && layer !== "logger") { throw new Error( `${layer} is not a valid layer, should be chrome or logger` );