-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
UnixStream/UnixListener on Windows #150428
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
This comment has been minimized.
This comment has been minimized.
|
r? libs |
|
No reviewers could be found from initial request |
|
@dtolnay Could you check this pr too? |
|
Reminder, once the PR becomes ready for a review, use |
|
@rustbot ready |
|
Let's try to re-roll again r? libs |
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.
Please also keep commits squashed as you go.
| use crate::{fmt, io, mem}; | ||
|
|
||
| #[cfg(not(doc))] | ||
| pub fn sockaddr_un(path: &Path) -> io::Result<(SOCKADDR_UN, usize)> { |
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.
Reading https://devblogs.microsoft.com/commandline/af_unix-comes-to-windows/, it looks to me like abstract and unnamed sockets should both be supported by Windows as well. Presumably the implementation should as such more closely mirror library/std/src/os/unix/net/addr.rs?
That would also fix the problem in fmt::Debug, where you bail if it's not a path socket incorrectly; it would make more sense for me if it used the same strategy as the unix impl.
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.
Maybe abstract sockets not support by Windows. Set first byte of sun_path to zero cause code: 10022 when connect
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.
Can you add an unresolved question to the tracking issue about that? It doesn't seem expected to me given:
The second category is the ‘abstract’ socket address where the first character in ‘sun_path’ is a null byte. Windows implementation of AF_UNIX socket can also accept abstract addresses. The one difference noteworthy here is that the Windows unix socket implementation currently does not support the autobind feature whereby an abstract address is auto-generated by the implementation on behalf of the user.
Maybe something is wrong with our setup or the blog post is stale...
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.
@Mark-Simulacrum seems like microsoft not impl full AF_UNIX yet. I will add this ref to tracking issue.
I suggest specifying in the documentation that only AF_UNIX SOCK_STREAM with TRUE paths is supported
|
@rustbot ready |
|
r=me with commits squashed. |
This comment has been minimized.
This comment has been minimized.
|
@bors try jobs=aarch64-msvc-1 |
This comment has been minimized.
This comment has been minimized.
UnixStream/UnixListener on Windows try-job: aarch64-msvc-1
|
💔 Test for 02b5504 failed: CI. Failed job:
|
This comment has been minimized.
This comment has been minimized.
This commit introduces initial, unstable support for Unix domain sockets (UDS) on Windows, behind the `windows_unix_domain_sockets` feature gate Added types: - `std::os::windows::net::SocketAddr`: represents a UDS address with support for pathname addresses (abstract and unnamed are parsed but not yet fully supported). - `std::os::windows::net::UnixListener`: server-side UDS listener. - `std::os::windows::net::UnixStream`: client/server stream for UDS. Key features: - Binding and connecting using filesystem paths. - Basic I/O via `Read`/`Write`. - Address querying (`local_addr`, `peer_addr`). - Non-blocking mode, timeouts, and socket duplication. - Includes basic test coverage for smoke, echo, path length, and bind reuse.
|
@bors try jobs=aarch64-msvc-1 |
This comment has been minimized.
This comment has been minimized.
UnixStream/UnixListener on Windows try-job: aarch64-msvc-1
|
@bors r+ rollup=iffy |
…acrum UnixStream/UnixListener on Windows Hi, I re impl this. Hope you test it.
…uwer Rollup of 10 pull requests Successful merges: - #150428 (UnixStream/UnixListener on Windows ) - #147400 (TryFrom<integer> for bool) - #150993 (std: sys: uefi: os: Implement join_paths) - #151483 (Add regression test for issue #138225) - #151568 (Update hexagon target linker configurations) - #151725 (Fix outdated Debian Ports ISO reference) - #151895 (Move UI tests batch) - #151923 (Fix ICE when projection error reporting sees opaque alias terms) - #151947 (Include assoc const projections in CFI trait object) - #151948 (Handle unbalanced delimiters gracefully in make_attr_token_stream)
This comment has been minimized.
This comment has been minimized.
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 57d2fb1 (parent) -> 92ea9b2 (this PR) Test differencesShow 37 test diffsStage 2
Additionally, 33 doctest diffs were found. These are ignored, as they are noisy. Job group index Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 92ea9b29d1d0d124df37e3392bbbe9898ca7dd96 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (92ea9b2): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results (secondary 3.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 7.7%, secondary -4.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 473.934s -> 470.853s (-0.65%) |
Hi, I re impl this. Hope you test it.