diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7d94370fe5..8f2e1dfdad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -137,8 +137,8 @@ jobs: - name: Test run: cargo test --no-fail-fast --all-targets --all-features --workspace - - name: Async-std Test - run: cargo test --no-fail-fast --all-targets --no-default-features --features "async-std" --features "storage-all" --workspace + - name: Smol Test + run: cargo test --no-fail-fast --all-targets --no-default-features --features "smol" --features "storage-all" --workspace - name: Doc Test run: cargo test --no-fail-fast --doc --all-features --workspace diff --git a/Cargo.lock b/Cargo.lock index 371ddb65d3..ab43882e92 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -434,39 +434,18 @@ dependencies = [ "serde_json", ] -[[package]] -name = "async-attributes" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5" -dependencies = [ - "quote", - "syn 1.0.109", -] - [[package]] name = "async-broadcast" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532" dependencies = [ - "event-listener 5.4.1", + "event-listener", "event-listener-strategy", "futures-core", "pin-project-lite", ] -[[package]] -name = "async-channel" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" -dependencies = [ - "concurrent-queue", - "event-listener 2.5.3", - "futures-core", -] - [[package]] name = "async-channel" version = "2.5.0" @@ -511,18 +490,14 @@ dependencies = [ ] [[package]] -name = "async-global-executor" -version = "2.4.1" +name = "async-fs" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" +checksum = "09f7e37c0ed80b2a977691c47dae8625cfb21e205827106c64f7c588766b2e50" dependencies = [ - "async-channel 2.5.0", - "async-executor", - "async-io", "async-lock", "blocking", "futures-lite", - "once_cell", ] [[package]] @@ -549,11 +524,40 @@ version = "3.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5fd03604047cee9b6ce9de9f70c6cd540a0520c813cbd49bae61f33ab80ed1dc" dependencies = [ - "event-listener 5.4.1", + "event-listener", "event-listener-strategy", "pin-project-lite", ] +[[package]] +name = "async-net" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7" +dependencies = [ + "async-io", + "blocking", + "futures-lite", +] + +[[package]] +name = "async-process" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65daa13722ad51e6ab1a1b9c01299142bc75135b337923cfa10e79bbbd669f00" +dependencies = [ + "async-channel", + "async-io", + "async-lock", + "async-signal", + "async-task", + "blocking", + "cfg-if", + "event-listener", + "futures-lite", + "rustix 1.0.8", +] + [[package]] name = "async-recursion" version = "1.1.1" @@ -566,30 +570,21 @@ dependencies = [ ] [[package]] -name = "async-std" -version = "1.13.2" +name = "async-signal" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c8e079a4ab67ae52b7403632e4618815d6db36d2a010cfe41b02c1b1578f93b" +checksum = "f567af260ef69e1d52c2b560ce0ea230763e6fbb9214a85d768760a920e3e3c1" dependencies = [ - "async-attributes", - "async-channel 1.9.0", - "async-global-executor", "async-io", "async-lock", - "crossbeam-utils", - "futures-channel", + "atomic-waker", + "cfg-if", "futures-core", "futures-io", - "futures-lite", - "gloo-timers", - "kv-log-macro", - "log", - "memchr", - "once_cell", - "pin-project-lite", - "pin-utils", + "rustix 1.0.8", + "signal-hook-registry", "slab", - "wasm-bindgen-futures", + "windows-sys 0.60.2", ] [[package]] @@ -1195,7 +1190,7 @@ version = "1.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e83f8d02be6967315521be875afa792a316e28d57b5a2d401897e2a7921b7f21" dependencies = [ - "async-channel 2.5.0", + "async-channel", "async-task", "futures-io", "futures-lite", @@ -1523,7 +1518,7 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fde0e0ec90c9dfb3b4b1a0891a7dcd0e2bffde2f7efed5fe7c9bb00e5bfb915e" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -2723,7 +2718,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.60.2", ] [[package]] @@ -2749,12 +2744,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - [[package]] name = "event-listener" version = "5.4.1" @@ -2772,7 +2761,7 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" dependencies = [ - "event-listener 5.4.1", + "event-listener", "pin-project-lite", ] @@ -2818,7 +2807,7 @@ checksum = "0ce92ff622d6dadf7349484f42c93271a0d49b7cc4d466a936405bacbe10aa78" dependencies = [ "cfg-if", "rustix 1.0.8", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -3492,7 +3481,6 @@ dependencies = [ "arrow-select", "arrow-string", "as-any", - "async-std", "async-trait", "backon", "base64 0.22.1", @@ -3527,6 +3515,7 @@ dependencies = [ "serde_json", "serde_repr", "serde_with", + "smol", "strum 0.27.2", "tempfile", "tera", @@ -4054,15 +4043,6 @@ dependencies = [ "simple_asn1", ] -[[package]] -name = "kv-log-macro" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" -dependencies = [ - "log", -] - [[package]] name = "lazy_static" version = "1.5.0" @@ -4179,7 +4159,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" dependencies = [ "cfg-if", - "windows-targets 0.48.5", + "windows-targets 0.53.3", ] [[package]] @@ -4291,9 +4271,6 @@ name = "log" version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" -dependencies = [ - "value-bag", -] [[package]] name = "loom" @@ -4476,7 +4453,7 @@ dependencies = [ "crossbeam-channel", "crossbeam-epoch", "crossbeam-utils", - "event-listener 5.4.1", + "event-listener", "futures-util", "loom", "parking_lot", @@ -5480,7 +5457,7 @@ dependencies = [ "once_cell", "socket2 0.5.10", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -5961,7 +5938,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.4.15", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -5974,7 +5951,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.9.4", - "windows-sys 0.52.0", + "windows-sys 0.60.2", ] [[package]] @@ -6466,6 +6443,23 @@ dependencies = [ "serde", ] +[[package]] +name = "smol" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33bd3e260892199c3ccfc487c88b2da2265080acb316cd920da72fdfd7c599f" +dependencies = [ + "async-channel", + "async-executor", + "async-fs", + "async-io", + "async-lock", + "async-net", + "async-process", + "blocking", + "futures-lite", +] + [[package]] name = "snap" version = "1.1.1" @@ -6620,7 +6614,7 @@ dependencies = [ "crc", "crossbeam-queue", "either", - "event-listener 5.4.1", + "event-listener", "futures-core", "futures-intrusive", "futures-io", @@ -6799,7 +6793,7 @@ dependencies = [ "cfg-if", "libc", "psm", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -6945,7 +6939,7 @@ dependencies = [ "getrandom 0.3.3", "once_cell", "rustix 1.0.8", - "windows-sys 0.52.0", + "windows-sys 0.60.2", ] [[package]] @@ -7553,12 +7547,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" -[[package]] -name = "value-bag" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "943ce29a8a743eb10d6082545d861b24f9d1b160b7d741e0f2cdf726bec909c5" - [[package]] name = "vcpkg" version = "0.2.15" @@ -7839,7 +7827,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 385693edf4..24393c3305 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -51,7 +51,6 @@ arrow-schema = { version = "55" } arrow-select = { version = "55" } arrow-string = { version = "55" } as-any = "0.3.2" -async-std = "1.12" async-trait = "0.1.88" aws-config = "1.6.1" aws-sdk-glue = "1.39" @@ -110,6 +109,7 @@ serde_derive = "1.0.210" serde_json = "1.0.138" serde_repr = "0.1.16" serde_with = "3.4" +smol = "2.0.2" sqllogictest = "0.28" stacker = "0.1.20" strum = "0.27" diff --git a/crates/iceberg/Cargo.toml b/crates/iceberg/Cargo.toml index fe4fdf73d6..d592700b73 100644 --- a/crates/iceberg/Cargo.toml +++ b/crates/iceberg/Cargo.toml @@ -39,7 +39,7 @@ storage-memory = ["opendal/services-memory"] storage-oss = ["opendal/services-oss"] storage-s3 = ["opendal/services-s3", "reqsign"] -async-std = ["dep:async-std"] +smol = ["dep:smol"] tokio = ["tokio/rt-multi-thread"] [dependencies] @@ -55,7 +55,6 @@ arrow-schema = { workspace = true } arrow-select = { workspace = true } arrow-string = { workspace = true } as-any = { workspace = true } -async-std = { workspace = true, optional = true, features = ["attributes"] } async-trait = { workspace = true } backon = { workspace = true } base64 = { workspace = true } @@ -85,6 +84,7 @@ serde_derive = { workspace = true } serde_json = { workspace = true } serde_repr = { workspace = true } serde_with = { workspace = true } +smol = { workspace = true, optional = true } strum = { workspace = true, features = ["derive"] } thrift = { workspace = true } tokio = { workspace = true, optional = false, features = ["sync"] } diff --git a/crates/iceberg/src/runtime/mod.rs b/crates/iceberg/src/runtime/mod.rs index 65c30e82cc..d0a3ce6602 100644 --- a/crates/iceberg/src/runtime/mod.rs +++ b/crates/iceberg/src/runtime/mod.rs @@ -24,9 +24,9 @@ use std::task::{Context, Poll}; pub enum JoinHandle { #[cfg(feature = "tokio")] Tokio(tokio::task::JoinHandle), - #[cfg(all(feature = "async-std", not(feature = "tokio")))] - AsyncStd(async_std::task::JoinHandle), - #[cfg(all(not(feature = "async-std"), not(feature = "tokio")))] + #[cfg(all(feature = "smol", not(feature = "tokio")))] + Smol(smol::Task), + #[cfg(all(not(feature = "smol"), not(feature = "tokio")))] Unimplemented(Box), } @@ -39,9 +39,9 @@ impl Future for JoinHandle { JoinHandle::Tokio(handle) => Pin::new(handle) .poll(cx) .map(|h| h.expect("tokio spawned task failed")), - #[cfg(all(feature = "async-std", not(feature = "tokio")))] - JoinHandle::AsyncStd(handle) => Pin::new(handle).poll(cx), - #[cfg(all(not(feature = "async-std"), not(feature = "tokio")))] + #[cfg(all(feature = "smol", not(feature = "tokio")))] + JoinHandle::Smol(handle) => Pin::new(handle).poll(cx), + #[cfg(all(not(feature = "smol"), not(feature = "tokio")))] JoinHandle::Unimplemented(_) => unimplemented!("no runtime has been enabled"), } } @@ -56,10 +56,10 @@ where #[cfg(feature = "tokio")] return JoinHandle::Tokio(tokio::task::spawn(f)); - #[cfg(all(feature = "async-std", not(feature = "tokio")))] - return JoinHandle::AsyncStd(async_std::task::spawn(f)); + #[cfg(all(feature = "smol", not(feature = "tokio")))] + return JoinHandle::Smol(smol::spawn(f)); - #[cfg(all(not(feature = "async-std"), not(feature = "tokio")))] + #[cfg(all(not(feature = "smol"), not(feature = "tokio")))] unimplemented!("no runtime has been enabled") } @@ -72,10 +72,10 @@ where #[cfg(feature = "tokio")] return JoinHandle::Tokio(tokio::task::spawn_blocking(f)); - #[cfg(all(feature = "async-std", not(feature = "tokio")))] - return JoinHandle::AsyncStd(async_std::task::spawn_blocking(f)); + #[cfg(all(feature = "smol", not(feature = "tokio")))] + return JoinHandle::Smol(smol::unblock(f)); - #[cfg(all(not(feature = "async-std"), not(feature = "tokio")))] + #[cfg(all(not(feature = "smol"), not(feature = "tokio")))] unimplemented!("no runtime has been enabled") } @@ -97,16 +97,16 @@ mod tests { assert_eq!(handle.await, 2); } - #[cfg(all(feature = "async-std", not(feature = "tokio")))] - #[async_std::test] - async fn test_async_std_spawn() { + #[cfg(all(feature = "smol", not(feature = "tokio")))] + #[smol::test] + async fn test_smol_spawn() { let handle = spawn(async { 1 + 1 }); assert_eq!(handle.await, 2); } - #[cfg(all(feature = "async-std", not(feature = "tokio")))] - #[async_std::test] - async fn test_async_std_spawn_blocking() { + #[cfg(all(feature = "smol", not(feature = "tokio")))] + #[smo::test] + async fn test_smol_spawn_blocking() { let handle = spawn_blocking(|| 1 + 1); assert_eq!(handle.await, 2); }