This is an automated email from the ASF dual-hosted git repository.
liurenjie1024 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-rust.git
The following commit(s) were added to refs/heads/main by this push:
new 84b2ba867 refactor: Drop smol runtime support (#1900)
84b2ba867 is described below
commit 84b2ba86765b96b3d4afc8b30ab29b1ef61be510
Author: Xuanwo <[email protected]>
AuthorDate: Mon Dec 8 18:45:42 2025 +0800
refactor: Drop smol runtime support (#1900)
## Which issue does this PR close?
- Closes https://github.com/apache/iceberg-rust/issues/1866
## What changes are included in this PR?
## Are these changes tested?
---------
Signed-off-by: Xuanwo <[email protected]>
Co-authored-by: Renjie Liu <[email protected]>
---
.github/workflows/ci.yml | 1 -
Cargo.lock | 189 ++------------------------------------
Cargo.toml | 1 -
crates/iceberg/Cargo.toml | 5 +-
crates/iceberg/src/io/storage.rs | 8 ++
crates/iceberg/src/runtime/mod.rs | 58 ++----------
6 files changed, 25 insertions(+), 237 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 7b7e81837..f393309bc 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -143,7 +143,6 @@ jobs:
matrix:
test-suite:
- { name: "default", args: "--all-targets --all-features
--workspace" }
- - { name: "smol", args: "--all-targets --no-default-features
--features smol --features storage-all --workspace" }
- { name: "doc", args: "--doc --all-features --workspace" }
name: Unit Tests (${{ matrix.test-suite.name }})
steps:
diff --git a/Cargo.lock b/Cargo.lock
index 736f2b146..4d9f2b99c 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -465,18 +465,6 @@ dependencies = [
"pin-project-lite",
]
-[[package]]
-name = "async-channel"
-version = "2.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2"
-dependencies = [
- "concurrent-queue",
- "event-listener-strategy",
- "futures-core",
- "pin-project-lite",
-]
-
[[package]]
name = "async-compression"
version = "0.4.19"
@@ -494,49 +482,6 @@ dependencies = [
"zstd-safe",
]
-[[package]]
-name = "async-executor"
-version = "1.13.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "497c00e0fd83a72a79a39fcbd8e3e2f055d6f6c7e025f3b3d91f4f8e76527fb8"
-dependencies = [
- "async-task",
- "concurrent-queue",
- "fastrand",
- "futures-lite",
- "pin-project-lite",
- "slab",
-]
-
-[[package]]
-name = "async-fs"
-version = "2.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8034a681df4aed8b8edbd7fbe472401ecf009251c8b40556b304567052e294c5"
-dependencies = [
- "async-lock",
- "blocking",
- "futures-lite",
-]
-
-[[package]]
-name = "async-io"
-version = "2.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "456b8a8feb6f42d237746d4b3e9a178494627745c3c56c6ea55d92ba50d026fc"
-dependencies = [
- "autocfg",
- "cfg-if",
- "concurrent-queue",
- "futures-io",
- "futures-lite",
- "parking",
- "polling",
- "rustix",
- "slab",
- "windows-sys 0.61.2",
-]
-
[[package]]
name = "async-lock"
version = "3.4.1"
@@ -548,35 +493,6 @@ dependencies = [
"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.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75"
-dependencies = [
- "async-channel",
- "async-io",
- "async-lock",
- "async-signal",
- "async-task",
- "blocking",
- "cfg-if",
- "event-listener",
- "futures-lite",
- "rustix",
-]
-
[[package]]
name = "async-recursion"
version = "1.1.1"
@@ -588,30 +504,6 @@ dependencies = [
"syn 2.0.108",
]
-[[package]]
-name = "async-signal"
-version = "0.2.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "43c070bbf59cd3570b6b2dd54cd772527c7c3620fce8be898406dd3ed6adc64c"
-dependencies = [
- "async-io",
- "async-lock",
- "atomic-waker",
- "cfg-if",
- "futures-core",
- "futures-io",
- "rustix",
- "signal-hook-registry",
- "slab",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "async-task"
-version = "4.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de"
-
[[package]]
name = "async-trait"
version = "0.1.89"
@@ -1185,19 +1077,6 @@ dependencies = [
"generic-array",
]
-[[package]]
-name = "blocking"
-version = "1.6.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e83f8d02be6967315521be875afa792a316e28d57b5a2d401897e2a7921b7f21"
-dependencies = [
- "async-channel",
- "async-task",
- "futures-io",
- "futures-lite",
- "piper",
-]
-
[[package]]
name = "bon"
version = "3.8.1"
@@ -2667,7 +2546,7 @@ dependencies = [
"libc",
"option-ext",
"redox_users",
- "windows-sys 0.61.2",
+ "windows-sys 0.59.0",
]
[[package]]
@@ -2809,7 +2688,7 @@ source =
"registry+https://github.com/rust-lang/crates.io-index"
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
dependencies = [
"libc",
- "windows-sys 0.61.2",
+ "windows-sys 0.52.0",
]
[[package]]
@@ -3052,19 +2931,6 @@ version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6"
-[[package]]
-name = "futures-lite"
-version = "2.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad"
-dependencies = [
- "fastrand",
- "futures-core",
- "futures-io",
- "parking",
- "pin-project-lite",
-]
-
[[package]]
name = "futures-macro"
version = "0.3.31"
@@ -3567,7 +3433,6 @@ dependencies = [
"serde_json",
"serde_repr",
"serde_with",
- "smol",
"strum 0.27.2",
"tempfile",
"thrift",
@@ -4565,7 +4430,7 @@ version = "0.50.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"
dependencies = [
- "windows-sys 0.61.2",
+ "windows-sys 0.59.0",
]
[[package]]
@@ -5077,17 +4942,6 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
-[[package]]
-name = "piper"
-version = "0.2.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066"
-dependencies = [
- "atomic-waker",
- "fastrand",
- "futures-io",
-]
-
[[package]]
name = "pkcs1"
version = "0.7.5"
@@ -5132,20 +4986,6 @@ version = "0.3.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c"
-[[package]]
-name = "polling"
-version = "3.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218"
-dependencies = [
- "cfg-if",
- "concurrent-queue",
- "hermit-abi",
- "pin-project-lite",
- "rustix",
- "windows-sys 0.61.2",
-]
-
[[package]]
name = "port_scanner"
version = "0.1.5"
@@ -5921,7 +5761,7 @@ dependencies = [
"errno",
"libc",
"linux-raw-sys",
- "windows-sys 0.61.2",
+ "windows-sys 0.52.0",
]
[[package]]
@@ -6478,23 +6318,6 @@ 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"
@@ -6993,7 +6816,7 @@ dependencies = [
"getrandom 0.3.4",
"once_cell",
"rustix",
- "windows-sys 0.61.2",
+ "windows-sys 0.52.0",
]
[[package]]
@@ -7819,7 +7642,7 @@ version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
dependencies = [
- "windows-sys 0.61.2",
+ "windows-sys 0.48.0",
]
[[package]]
diff --git a/Cargo.toml b/Cargo.toml
index 051215553..36093d92a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -116,7 +116,6 @@ serde_derive = "1.0.219"
serde_json = "1.0.142"
serde_repr = "0.1.16"
serde_with = "3.4"
-smol = "2.0.2"
sqllogictest = "0.28.3"
sqlx = { version = "0.8.1", default-features = false }
stacker = "0.1.20"
diff --git a/crates/iceberg/Cargo.toml b/crates/iceberg/Cargo.toml
index 895a5cf5e..84c90d466 100644
--- a/crates/iceberg/Cargo.toml
+++ b/crates/iceberg/Cargo.toml
@@ -29,7 +29,7 @@ license = { workspace = true }
repository = { workspace = true }
[features]
-default = ["storage-memory", "storage-fs", "storage-s3", "tokio"]
+default = ["storage-memory", "storage-fs", "storage-s3"]
storage-all = ["storage-memory", "storage-fs", "storage-s3", "storage-gcs"]
storage-azdls = ["opendal/services-azdls"]
@@ -39,8 +39,6 @@ storage-memory = ["opendal/services-memory"]
storage-oss = ["opendal/services-oss"]
storage-s3 = ["opendal/services-s3", "reqsign"]
-smol = ["dep:smol"]
-tokio = ["tokio/rt-multi-thread"]
[dependencies]
anyhow = { workspace = true }
@@ -85,7 +83,6 @@ 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/io/storage.rs b/crates/iceberg/src/io/storage.rs
index d5f2ad8fa..5880ccca5 100644
--- a/crates/iceberg/src/io/storage.rs
+++ b/crates/iceberg/src/io/storage.rs
@@ -15,6 +15,12 @@
// specific language governing permissions and limitations
// under the License.
+#[cfg(any(
+ feature = "storage-s3",
+ feature = "storage-gcs",
+ feature = "storage-oss",
+ feature = "storage-azdls",
+))]
use std::sync::Arc;
use opendal::layers::RetryLayer;
@@ -71,6 +77,7 @@ impl Storage {
/// Convert iceberg config to opendal config.
pub(crate) fn build(file_io_builder: FileIOBuilder) -> crate::Result<Self>
{
let (scheme_str, props, extensions) = file_io_builder.into_parts();
+ let _ = (&props, &extensions);
let scheme = Self::parse_scheme(&scheme_str)?;
match scheme {
@@ -127,6 +134,7 @@ impl Storage {
path: &'a impl AsRef<str>,
) -> crate::Result<(Operator, &'a str)> {
let path = path.as_ref();
+ let _ = path;
let (operator, relative_path): (Operator, &str) = match self {
#[cfg(feature = "storage-memory")]
Storage::Memory(op) => {
diff --git a/crates/iceberg/src/runtime/mod.rs
b/crates/iceberg/src/runtime/mod.rs
index d0a3ce660..61aa623f5 100644
--- a/crates/iceberg/src/runtime/mod.rs
+++ b/crates/iceberg/src/runtime/mod.rs
@@ -21,28 +21,20 @@ use std::future::Future;
use std::pin::Pin;
use std::task::{Context, Poll};
-pub enum JoinHandle<T> {
- #[cfg(feature = "tokio")]
- Tokio(tokio::task::JoinHandle<T>),
- #[cfg(all(feature = "smol", not(feature = "tokio")))]
- Smol(smol::Task<T>),
- #[cfg(all(not(feature = "smol"), not(feature = "tokio")))]
- Unimplemented(Box<T>),
-}
+use tokio::task;
+
+pub struct JoinHandle<T>(task::JoinHandle<T>);
+
+impl<T> Unpin for JoinHandle<T> {}
impl<T: Send + 'static> Future for JoinHandle<T> {
type Output = T;
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
match self.get_mut() {
- #[cfg(feature = "tokio")]
- JoinHandle::Tokio(handle) => Pin::new(handle)
+ JoinHandle(handle) => Pin::new(handle)
.poll(cx)
- .map(|h| h.expect("tokio spawned task failed")),
- #[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"),
+ .map(|r| r.expect("tokio spawned task failed")),
}
}
}
@@ -50,17 +42,10 @@ impl<T: Send + 'static> Future for JoinHandle<T> {
#[allow(dead_code)]
pub fn spawn<F>(f: F) -> JoinHandle<F::Output>
where
- F: Future + Send + 'static,
+ F: std::future::Future + Send + 'static,
F::Output: Send + 'static,
{
- #[cfg(feature = "tokio")]
- return JoinHandle::Tokio(tokio::task::spawn(f));
-
- #[cfg(all(feature = "smol", not(feature = "tokio")))]
- return JoinHandle::Smol(smol::spawn(f));
-
- #[cfg(all(not(feature = "smol"), not(feature = "tokio")))]
- unimplemented!("no runtime has been enabled")
+ JoinHandle(task::spawn(f))
}
#[allow(dead_code)]
@@ -69,45 +54,22 @@ where
F: FnOnce() -> T + Send + 'static,
T: Send + 'static,
{
- #[cfg(feature = "tokio")]
- return JoinHandle::Tokio(tokio::task::spawn_blocking(f));
-
- #[cfg(all(feature = "smol", not(feature = "tokio")))]
- return JoinHandle::Smol(smol::unblock(f));
-
- #[cfg(all(not(feature = "smol"), not(feature = "tokio")))]
- unimplemented!("no runtime has been enabled")
+ JoinHandle(task::spawn_blocking(f))
}
#[cfg(test)]
mod tests {
use super::*;
- #[cfg(feature = "tokio")]
#[tokio::test]
async fn test_tokio_spawn() {
let handle = spawn(async { 1 + 1 });
assert_eq!(handle.await, 2);
}
- #[cfg(feature = "tokio")]
#[tokio::test]
async fn test_tokio_spawn_blocking() {
let handle = spawn_blocking(|| 1 + 1);
assert_eq!(handle.await, 2);
}
-
- #[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 = "smol", not(feature = "tokio")))]
- #[smo::test]
- async fn test_smol_spawn_blocking() {
- let handle = spawn_blocking(|| 1 + 1);
- assert_eq!(handle.await, 2);
- }
}