-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Use feature for io-uring instead of cfg #7547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Regarding the error that I see two possible options:
I'm somewhat inclined to option 1 because:
|
|
@mox692 I prefer the option 1, especially because "Almost all major 64-bit architectures are supported".
I don't fully understand, let's say I'm trying to locally compile tokio with |
Ah you're right, I think |
|
Yes, let's exclude it in cross-tests for now. |
|
Trying another run, I expect we will still have some issues but should be better. |
ADD-SP
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to express concern about the increasing complexity, this PR introduces a new feature flag under the --cfg tokio_unstable?
The discussion is about whether to test both with io-uring and without io-uring. If we do, shall we also test all possible combinations for the three (tracing, taskdump and io-uring) unstable feature flags? Or we just add combinations for io-uring?
See #7547 (comment) for more context.
mox692
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of nits.
|
There something weird with |
That sounds wiered. I'll try to figure out what's happening. |
|
It looks like this is expected behavior. Tier 3 targets in ci are not linux, so # This won't throw an error since this tier 3 target `armv7-sony-vita-newlibeabihf` isn't Linux, so the `io-uring` crate isn't even pulled in.
$ RUSTFLAGS="--cfg tokio_unstable" cargo build --features io-uring --target armv7-sony-vita-newlibeabihf
# This will throw an compile error from `io-uring` crate since it's linux but not supported arch, i686.
$ RUSTFLAGS="--cfg tokio_unstable" cargo build --features io-uring --target i686-unknown-linux-gnu |
|
Make sense @mox692 . I reckon it is ready now. Let me know if there is any change necessary. |
mox692
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I'll leave this a little while in case other members still have opinions for this.
ADD-SP
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good to me.
| - { os: windows-latest, features: "full,test-util" } | ||
| - { os: ubuntu-latest, features: "full,test-util" } | ||
| - { os: ubuntu-latest, features: "full,test-util,io-uring" } | ||
| - { os: macos-latest, features: "full,test-util" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also add a short comment to explain why did we use --features full,test-util instead of --all-features?
| cargo nextest run --features full,test-util | ||
| cargo test --doc --features full,test-util |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did we need to add test-util here?
| cargo nextest run -Zbuild-std --target target-specs/i686-unknown-linux-gnu.json -p tokio --features full,test-util | ||
| cargo test --doc -Zbuild-std --target target-specs/i686-unknown-linux-gnu.json -p tokio --features full,test-util |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also add a short comment to explain why did we use --features full,test-util instead of --all-features?
| # https://github.com/tokio-rs/tokio/issues/5373 | ||
| - name: Check | ||
| run: cargo hack check -Zbuild-std --target target-specs/i686-unknown-linux-gnu.json -p tokio --feature-powerset --depth 2 --keep-going | ||
| run: cargo hack check -Zbuild-std --target target-specs/i686-unknown-linux-gnu.json -p tokio --feature-powerset --skip io-uring --depth 2 --keep-going |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a short comment about --skip io-uring?
| inner: Kind::Std(options), | ||
| // TODO: Add support for converting `StdOpenOptions` to `UringOpenOptions` | ||
| // if user enables the `--cfg tokio_uring`. It is blocked by: | ||
| // if user enables `io-uring`. It is blocked by: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // if user enables `io-uring`. It is blocked by: | |
| // if user enables `io-uring` cargo feature. It is blocked by: |
nit
|
@Sytten This PR will be kind of important to define how users can opt in io_uring in the next release. We generally don't want to change the way to opt-in once we ship a new feature, even if it's unstable. |
|
@mox692 feel free to do so. I was too busy this week. I might have time tonight, but it is a bit complicated right now |
|
It looks like I can’t edit this branch, so I opened another PR #7621. |
|
Superseded by #7621 (derived from this PR), thanks for your contribution! |
Motivation
This was to remove the lockfile problem described in #7546
Solution
Moving away from cfg and into a feature that is only available when unstable is enabled.
It is a PITA for the CI I will admit, but this solution could also be applied to backtrace