-
Notifications
You must be signed in to change notification settings - Fork 59
Add windows support on async #290
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
1641dbf
to
2c3e9d0
Compare
@Tim-Zhang PTAL |
Add support for windows named pipes to the async codebase. This refactor the codes to use a transport abstraction instead of file descriptors. Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
Fix failure with deny workflow in CI. This requires bumping cargo-deny-action, which introduces a breaking change in the syntax of deny.toml Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
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 tried it out on windows and it works!
The windows API for querying the named pipe path explicitly mentions that it shouldn't be used with pipes. To avoid that, store the path of the pipe when binging it, and reuse that value. Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
Improve the error message when a server is started with no listener specified Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
@jprendes Thank you for your PR. The community has been waiting for this feature for a long time. |
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 took a look at the windows implementation and tried it out. The tests have also been enabled to run all the examples on Windows too (Thanks @jprendes!)
The rest of the refactoring look like an overall improvement to me as well but let the other maintainers decide on the changes there.
LGTM
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.
LGTM, Thanks!
Gentle ping :-) @Tim-Zhang |
@Tim-Zhang I think we are good here and is ready for your final approval |
Hi @jprendes I tried to run the example async-stream with the command
Is this expected behavior? Does this PR currently support async streams? |
That's odd.
and this on another terminal
and I get
|
I just noticed that I never enabled the async examples for windows in run_example, I'll push that |
This commit enables on Windows the async examples in the run_examples test Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
Looks like the streaming client is also working in CI |
@jprendes Sorry, I think it was a wrong bug report. Forget it please. |
since transport.rs has submodules, move it from transport.rs to transport/mod.rs Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
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.
LGTM, Thanks @jprendes
Bump crate versions for publishing. The compiler crate needs a major version bump after breaking changes introduced by PR containerd#291 The main crate needs a major version bump after the braking changes introduced by PR containerd#290 Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
Bump crate versions for publishing. The compiler crate needs a major version bump after breaking changes introduced by PR containerd#291 The main crate needs a major version bump after the braking changes introduced by PR containerd#290 Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
Bump crate versions for publishing. The compiler crate needs a major version bump after breaking changes introduced by PR containerd#291 The main crate needs a major version bump after the braking changes introduced by PR containerd#290 Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
Bump crate versions for publishing. The compiler crate needs a major version bump after breaking changes introduced by PR containerd#291 The main crate needs a major version bump after the braking changes introduced by PR containerd#290 Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
Bump crate versions for publishing. The compiler crate needs a major version bump after breaking changes introduced by PR containerd#291 The main crate needs a major version bump after the braking changes introduced by PR containerd#290 Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
Bump crate versions for publishing. The compiler crate needs a major version bump after breaking changes introduced by PR containerd#291 The codegen crate needs a major version bump because it exports an item from the compiler crate. The main crate needs a major version bump after the braking changes introduced by PR containerd#290 Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
Add windows support on async
Bump crate versions for publishing. The compiler crate needs a major version bump after breaking changes introduced by PR containerd#291 The codegen crate needs a major version bump because it exports an item from the compiler crate. The main crate needs a major version bump after the braking changes introduced by PR containerd#290 Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
This PR adds Windows support to the async feature.
It introduces a transport layer with structs:
Socket
: a thin wrapper around a boxedAsyncRead + AsyncWrite
.Listener
: a thin wrapper around a boxed stream ofSockets
These struct have implementations for: uds, vsocks, and named pipes.
In the process, this PR also introduces some breaking change in the public API.
Client::connect
is now async.Client::new
now takes aSocket
instead of aRawFd
.Client::from_raw_unix_listener_fd
, which takes aRawFd
and is markedunsafe
.Connection::new
now takes aSocket
instead of anyAsyncRead + AsyncWrite
Server::add_listener
now takes aListener
instead of aRawFd
.Server::set_domain_{unix,vsock}
have been removed.Client::add_{unix_vsock}_listener
, which takes aRawFd
and is markedunsafe
.Server
doesn't implementAsRawFd
orFromRawFd
anymore.TtrpcContext
doesn't have anfd
field anymore.I think it would be possible to add Windows support without breaking the public API, but I believe the proposed changes make more sense while still providing an upgrade path.