From c6690d1c2771ce199de51c4b36623aa956ad43e1 Mon Sep 17 00:00:00 2001 From: Boshen Date: Tue, 23 Dec 2025 13:43:35 +0000 Subject: [PATCH] fix(rust): remove unsupported tokio io-std feature for WASM compatibility (#17311) ## Summary Removes the `io-std` tokio feature from packages that don't require it to fix WASM build compatibility. ## Context The `io-std` feature is not supported on WASM targets, causing builds to fail with: ``` error: Only features sync,macros,io-util,rt,time are supported on wasm. ``` ## Changes - **apps/oxfmt**: Removed `io-std` from tokio features (not used) - **apps/oxlint**: Removed `io-std` from tokio features (not used) - **crates/oxc_language_server**: - Kept `io-std` in main dependencies (required for `tokio::io::stdin()`/`stdout()` for LSP communication) - Removed `io-std` from dev-dependencies (tests use `DuplexStream`) ## Testing - All `oxc_language_server` tests pass (129 tests) - Builds successfully for native targets - Enables WASM builds to proceed --- apps/oxfmt/Cargo.toml | 2 +- apps/oxlint/Cargo.toml | 2 +- crates/oxc_language_server/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/oxfmt/Cargo.toml b/apps/oxfmt/Cargo.toml index eb1f7ef43026c..56274feac947f 100644 --- a/apps/oxfmt/Cargo.toml +++ b/apps/oxfmt/Cargo.toml @@ -47,7 +47,7 @@ serde_json = { workspace = true } simdutf8 = { workspace = true } sort-package-json = { workspace = true } oxc-toml = { workspace = true } -tokio = { workspace = true, features = ["rt-multi-thread", "io-std", "macros"] } +tokio = { workspace = true, features = ["rt-multi-thread", "macros"] } tracing = { workspace = true } tracing-subscriber = { workspace = true, features = [] } # Omit the `regex` feature diff --git a/apps/oxlint/Cargo.toml b/apps/oxlint/Cargo.toml index 7ed0f869c877f..26aba5c74dd1a 100644 --- a/apps/oxlint/Cargo.toml +++ b/apps/oxlint/Cargo.toml @@ -49,7 +49,7 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } simdutf8 = { workspace = true } tempfile = { workspace = true } -tokio = { workspace = true, features = ["rt-multi-thread", "io-std", "macros"] } +tokio = { workspace = true, features = ["rt-multi-thread", "macros"] } tracing-subscriber = { workspace = true, features = [] } # Omit the `regex` feature [target.'cfg(not(any(target_os = "linux", target_os = "freebsd", target_arch = "arm", target_family = "wasm")))'.dependencies] diff --git a/crates/oxc_language_server/Cargo.toml b/crates/oxc_language_server/Cargo.toml index 8679f9be6e380..b88c8da54a361 100644 --- a/crates/oxc_language_server/Cargo.toml +++ b/crates/oxc_language_server/Cargo.toml @@ -44,7 +44,7 @@ tower-lsp-server = { workspace = true, features = ["proposed"] } [dev-dependencies] insta = { workspace = true } -tokio = { workspace = true, features = ["rt-multi-thread", "io-std", "io-util", "macros"] } +tokio = { workspace = true, features = ["rt-multi-thread", "io-util", "macros"] } [features] default = ["linter", "formatter"]