Skip to content
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

feature request: expose tokio vs async-global-executor feature flags #21

Open
dignifiedquire opened this issue Jul 7, 2022 · 8 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@dignifiedquire
Copy link
Member

Looking at rtnetlink it already exposes both the async-global-executor and tokio executors as features, so I think it should be mostly a matter of threading it through.

@mxinden
Copy link
Member

mxinden commented Jul 11, 2022

I would welcome this change. @dignifiedquire do you want to propose a patch?

@thomaseizinger
Copy link

Currently, the linux implementation also hardcodes the use of smol. Would you see changing that in scope @mxinden ?

Disclaimer: I am pretty unfamiliar with this crate and only had a brief look.

@dignifiedquire
Copy link
Member Author

@mxinden I can take a look next week probably, if nobody claims it before.

@thomaseizinger I would try to avoid smol in this setup and use tokio/async-std directly depending on the current feature.

@dignifiedquire
Copy link
Member Author

I am failing to do this, because this needs to enable features depending on the target, and cargo has not implemented this yet :/ If anyone has ideas, I am all ears.

@thomaseizinger
Copy link

Is this becausertnetlink is only a dependency on Linux and therefore, the feature flag can't target it on other platforms?

@dignifiedquire
Copy link
Member Author

yes, exactly

@thomaseizinger
Copy link

I wonder if the crate renaming works on the level already?

If yes, we could try and make an empty crate with just two features that we can add for those targets and rename it to rtnetlink.

Alternatively, we could make a proxy crate that re-exports everything from rtnetlink that compiles on all platforms but doesn't have any code for MacOS and Windows.

The former would be nice because it is a one-time effort whereas for the latter, we would have to always release a new version, every time they release one.

A third idea would be to ask the maintainers of rtnetlink to cfg(target) their entire crate under linux.

@nazar-pc
Copy link

nazar-pc commented Sep 14, 2024

I just noticed that with tokio-only rust-libp2p addition of libp2p-tcp pulls in this dependency, which adds async-io and a whole bunch of related files to lock file even though tokio feature is used. I see async-io is still used as a fallback on some platforms, are there platforms of interest that are supported by it, but not by tokio?

UPD: It pulls the whole smol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants