Conversation
EPERMEPERM
martin-g
left a comment
There was a problem hiding this comment.
LGTM!
I only wish there was an info log to tell me that uring is disabled for some reason.
There was a problem hiding this comment.
How to write tests for this fix? To make our testset self-contained, the crate libseccomp might be a good candidate. However, the libseccomp requires us to install the libseccomp.so on the system, it is a bit annoying for developer to run tests locally.
One possible solution is gating the test using special cfg and only apply this cfg on CI.
ADD-SP
left a comment
There was a problem hiding this comment.
Another alternative for testing is https://docs.rs/seccompiler/0.5.0/seccompiler/.
Darksonn
left a comment
There was a problem hiding this comment.
Testing this in CI sounds difficult, but can we perform a manual test?
ADD-SP
left a comment
There was a problem hiding this comment.
We can open another PR for testing if possible.
There was a problem hiding this comment.
Tested locally — this fix works as expected.
docker run --rm rust:latest bash -c "$(cat <<"EOF"
mkdir -p /tmp/test/src
cd /tmp/test
ln -s Cargo.toml a.toml
cat <<"EOF2" > Cargo.toml
[package]
edition = "2024"
name = "tokio-io-uring-symlink"
[dependencies]
tokio = { git = "https://github.com/tokio-rs/tokio.git", rev = "7f959e1049c8d252f4a1e18bbbabc94cfd91120d", features = ["full", "io-uring"] }
EOF2
cat <<"EOF2" > src/main.rs
#[tokio::main]
async fn main() {
tokio::fs::File::open("a.toml").await.unwrap();
}
EOF2
RUSTFLAGS='--cfg tokio_unstable' cargo run
EOF
)"
Motivation
Closes #7691.
Solution
If we get
EPERMat the initial io-uring syscall (io_uring_setup), then we set theUnsupportedflag internally, which disables subsequent io-uring operations.