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

Windows support #132

Closed
Tracked by #49
mxpv opened this issue Dec 28, 2021 · 5 comments · Fixed by #172
Closed
Tracked by #49

Windows support #132

mxpv opened this issue Dec 28, 2021 · 5 comments · Fixed by #172

Comments

@mxpv
Copy link
Member

mxpv commented Dec 28, 2021

There is a desire to get Windows support in containerd/rust-extensions#4. Since the shim crate mainly depends on ttrpc-rust, I think it make sense to add windows support / CI checks here first.
Opening issue mainly for tracking (unfortunately I don't have proper environment to implement this).

@jsturtevant
Copy link
Collaborator

I am going to start to look into this

@jsturtevant
Copy link
Collaborator

the proto source generation works:

protoc --rust_out=. --ttrpc_out=. --plugin=protoc-gen-ttrpc=C:\Users\user\.cargo\bin\ttrpc_rust_plugin.exe .\oci.proto

Building doesn't not mainly due to the nix package

cargo build
Some errors have detailed explanations: E0412, E0422, E0425, E0432, E0433.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `ttrpc` due to 58 previous errors

@jsturtevant
Copy link
Collaborator

Confirmed the programmatic approach to source generate works as well.

@jsturtevant
Copy link
Collaborator

After looking into this a bit, It looks like the current approach in this library mostly uses some form of *nix Domain sockets:

ttrpc-rust/src/lib.rs

Lines 29 to 39 in af10ad4

//! # Socket address
//!
//! For Linux distributions, ttrpc-rust supports three types of socket:
//!
//! - `unix:///run/some.sock`: Normal Unix domain socket.
//! - `unix://@/run/some.sock`: Abstract Unix domain socket.
//! - `vsock://vsock://8:1024`: [vsock](https://man7.org/linux/man-pages/man7/vsock.7.html).
//!
//! For mscOS, ttrpc-rust **only** supports normal Unix domain socket:
//!
//! - `unix:///run/some.sock`: Normal Unix domain socket.

My first idea was to use Windows Unix Domain Socket compatibility to make the integration fairly straightforward.

After looking into a bit more (and talking with @cpuguy83) I realized that Containerd on Windows doesn't currently support UDS only named pipes on Windows, which is one of the big use cases for this library.

My current thoughts are to use https://github.com/tokio-rs/mio to integrate support for named pipes first. I choose library as there is already a indirect dependency through tokio package. Later if there was desire for other use cases beyond Containerd (where is strictly windows named pipes) we could use https://github.com/Azure/mio-uds-windows or tokio-rs/mio#1610 to integrate the UDS support.

@cpuguy83 @mxpv thoughts? I am new to Rust and these projects so if there is another direction, I should take let me know otherwise I will take a go at this and see what it looks like.

@jsturtevant
Copy link
Collaborator

quick update, I got the sync project working on windows. I am cleaning it up and adding a build step and should have something to share for feedback soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants