-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
feat(quinn,quinn-udp): Introduce net
feature to allow disabling socket2
and std::net::UdpSocket
dependencies
#2037
base: main
Are you sure you want to change the base?
Conversation
4fa89dd
to
a934ab4
Compare
I realized this PR is missing some rationale, so I'm writing this on the top level for better visibility:
This was one of the first things I was thinking initially, too. The only definitions that The fundamental problem IMO is that The solution would be to separate out the type definitions of
Yes, there's no way of using The alternative would be integrating with |
a934ab4
to
a12a85a
Compare
…cket2` and `std::net::UdpSocket` dependencies
a12a85a
to
8b20acd
Compare
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.
Okay, I think this all makes sense. Thanks!
@Ralith ping? |
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 understand the rational above for importing quinn-udp
in a WASM context.
That said, for what my opinion is worth here, I can't judge whether it is worth the complexity it introduces. Will defer to the actual Quinn maintainers.
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.
Instead of the many cfg(feature = "net")
, wouldn't something along the following be simpler?
#[cfg(feature = "net")]
use net::*;
#[cfg(feature = "net")]
mod net {
// Everything that was previously feature flagged behind net.
}
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've got a version where I've experimented with that.
It's a much more invasive change, I'm not sure if it's much better?
I can add it to this PR if other people agree: n0-computer@d06b71b
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.
Thanks for the commit. I didn't think of the fact that unix.rs
and windows.rs
would need to be under the net/
module.
At this point I don't have a better idea, nor a preference for the options listed here.
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.
couldnt windows and unix stuff be stuffed under a "system" "sys" or something like that.
You mentioned that you also considered gating on target instead of a cargo feature. Can you elaborate on why you went with the feature instead? I think exposing a subset API on some targets is less hazardous than a cargo feature, particularly as this is technically a semver break affecting users who have |
Changes
net
feature toquinn-udp
andquinn
socket2
dependency as optional (only enabled withnet
feature)std::net::UdpSocket
(e.g.Runtime::wrap_udp_socket
orEndpoint::rebind
) becomes gated bynet
featureweb_time
dependency toquinn-udp
andquinn
that is only enabled inwasm32-unknown-unknown
targetNote: The
net
feature will be implied by currentruntime-*
features.Testing
Runtime
implementation in the browser and nodejs.I'm not contributing this test (yet?) as discussed.
(import "env" ...)
in thequinn
.wasm
file when built.This is a good, even if not quite sufficient effort in making sure the Wasm build doesn't break.