-
Notifications
You must be signed in to change notification settings - Fork 0
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
Default to async-std #129
Default to async-std #129
Conversation
- Change cfg directives to use async-std channels and executor if nothing is specified via rust flags. - Add new empty RUSTFLAGS matrix variant to CI jobs. - Add a justfile for local testing. - Update README.
@@ -41,7 +41,7 @@ opentelemetry-jaeger = { version = "0.19.0", features = [ | |||
], optional = true } | |||
opentelemetry-aws = { version = "0.8.0", features = ["trace"], optional = true } | |||
|
|||
[target.'cfg(all(async_executor_impl = "tokio"))'.dependencies] |
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'm not sure why these were all
and if that was intentional.
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.
Not sure on the Nix stuff, but it looks good to me.
One thing to look for when integrating upstream is we will have to change the flags there as well. Some repositories have cfg_attrs
that map to tokio::main
and async_std::main
I just made the more or less simplest nix flake that has everything this project needs. I tested it on NixOS and OSX. I didn't say anything because I thought it runs in the CI anyway and will be tested there but that workflow doesn't trigger on PRs. Triggered it manually now: https://github.com/EspressoSystems/async-compatibility-layer/actions/runs/9028630166/job/24809455559 It does still fail (like on |
- Use `env` command to set rustflags, otherwise nix develops tries to run RUSTFLAGS=... as a command. - Replace no longer necessary cancel-workflow-action with concurrency group.
I think we should use
Although this doesn't seem to play nicely with rust-analyzer. If I write |
For For |
@jbearer Do you have any thoughts on this matter? It seems that currently this crate does not provide all the features needed for compat between async-std and tokio in hotshot because in hotshot sometimes arguments are passed to |
There's no issue, based on discussion on zulip it should not be required for consumers of this crate to always set RUSTFLAGS.
Instead of checking for presence of async-std, tokio or flume specified with
--cfg
the crate now checks for presence of tokio or flume and defaults to async-std if neither of those are set.This PR:
nothing is specified via rust flags.
This PR does not:
Key places to review:
The cfg directives.
How to test this PR:
For example with
just test-all
or the other added just recipes.Things tested
Manually tested that setting setting channels to tokio without using the tokio executor still fails. E. .g.
env RUSTFLAGS="--cfg async_channel_impl=\"tokio\"" cargo check