mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-11 07:36:53 +00:00
fix(runtime): remove tokio io-uring feature and add regression guard (#4364)
Drop the [target.'cfg(target_os = "linux")'.dependencies] tokio "io-uring" feature from 6 crates and the rustfs binary. Because .cargo/config.toml enables --cfg tokio_unstable globally, this feature switched every Linux build's file I/O onto tokio's io_uring runtime backend. Restricted Linux environments (Docker default seccomp, gVisor, proot, old kernels) reject io_uring_setup with EACCES/ENOSYS, which tokio surfaced as PermissionDenied and RustFS reported as DiskAccessDenied at startup. Add scripts/check_no_tokio_io_uring.sh so the feature cannot silently return: it fails on any tokio dependency line enabling "io-uring", while still allowing a future application-level io-uring crate dependency. Wire it into make pre-commit/pre-pr/dev-check and CI. Tracking: rustfs/backlog#890 (parent rustfs/backlog#897) Co-authored-by: heihutu <heihutu@gmail.com>
This commit is contained in:
@@ -171,7 +171,3 @@ harness = false
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
# io-uring is Linux-only. Scope the feature to Linux targets.
|
||||
[target.'cfg(target_os = "linux")'.dependencies]
|
||||
tokio = { workspace = true, features = ["io-uring"] }
|
||||
|
||||
@@ -34,13 +34,6 @@ tokio = { workspace = true, features = ["io-util", "fs", "rt", "sync"] }
|
||||
memmap2 = { workspace = true }
|
||||
rustfs-io-metrics = { workspace = true }
|
||||
|
||||
# Enable tokio's io_uring-based runtime backend on Linux.
|
||||
# Note: this is a tokio runtime feature, not application-level io_uring usage.
|
||||
# See the Tokio 1.52.0 release notes and tokio-rs/tokio#7907 for the upstream
|
||||
# runtime feature context.
|
||||
[target.'cfg(target_os = "linux")'.dependencies]
|
||||
tokio = { workspace = true, features = ["io-uring"] }
|
||||
|
||||
[dev-dependencies]
|
||||
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }
|
||||
|
||||
|
||||
@@ -70,7 +70,3 @@ temp-env = { workspace = true }
|
||||
|
||||
[features]
|
||||
default = []
|
||||
|
||||
# io-uring is Linux-only. Scope the feature to Linux targets.
|
||||
[target.'cfg(target_os = "linux")'.dependencies]
|
||||
tokio = { workspace = true, features = ["io-uring"] }
|
||||
|
||||
@@ -136,7 +136,3 @@ tokio = { workspace = true, features = ["test-util", "macros", "rt"] }
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
# io-uring is Linux-only. Scope the feature to Linux targets.
|
||||
[target.'cfg(target_os = "linux")'.dependencies]
|
||||
tokio = { workspace = true, features = ["io-uring"] }
|
||||
|
||||
@@ -62,7 +62,3 @@ tokio = { workspace = true, features = ["test-util"] }
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
# io-uring is Linux-only. Scope the feature to Linux targets.
|
||||
[target.'cfg(target_os = "linux")'.dependencies]
|
||||
tokio = { workspace = true, features = ["io-uring"] }
|
||||
|
||||
@@ -54,7 +54,3 @@ tempfile = { workspace = true }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
# io-uring is Linux-only. Scope the feature to Linux targets.
|
||||
[target.'cfg(target_os = "linux")'.dependencies]
|
||||
tokio = { workspace = true, features = ["io-uring"] }
|
||||
|
||||
Reference in New Issue
Block a user