-
Notifications
You must be signed in to change notification settings - Fork 250
Add cygwin support #568
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
base: master
Are you sure you want to change the base?
Add cygwin support #568
Conversation
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 we add something to the CI to ensure it keeps working?
It actually doesn't work all the time, because of bugs of cygwin. To be specific, the test |
The maintainer of cygwin told me a workaround for the test |
@Thomasdezeeuw ping? |
Could you review this PR again? @Thomasdezeeuw |
@Thomasdezeeuw @Darksonn Would you review again? This PR is the last blocker to build cargo on cygwin. |
I'm sorry to be blocking you, I've just been really busy lately and have very little spare time to review stuff (also see any pr on this repo). I'll try to give it a proper review again, but I can't promise anything. |
Cygwin support in rustc This PR builds host rustc targeting cygwin. - [x] rust-lang/stacker#122 - [x] nagisa/rust_libloading#173 - [x] Detegr/rust-ctrlc#131 - [x] rust-random/getrandom#654 - [x] msys2/MSYS2-packages#5350 - [x] rust-lang#140886 - [x] rust-lang#140921 - [x] rust-lang#140973 Currently supported: * rustc * rustdoc * rustfmt * clippy Blocking: * cargo: blocked by rust-lang/socket2#568 * rust-analyzer: needs `cargo update`, fixed upstream ``` $ rustc --version --verbose rustc 1.88.0-dev binary: rustc commit-hash: unknown commit-date: unknown host: x86_64-pc-cygwin release: 1.88.0-dev LLVM version: 20.1.4 ```
Cygwin support in rustc This PR builds host rustc targeting cygwin. - [x] rust-lang/stacker#122 - [x] nagisa/rust_libloading#173 - [x] Detegr/rust-ctrlc#131 - [x] rust-random/getrandom#654 - [x] msys2/MSYS2-packages#5350 - [x] rust-lang#140886 - [x] rust-lang#140921 - [x] rust-lang#140973 Currently supported: * rustc * rustdoc * rustfmt * clippy Blocking: * cargo: blocked by rust-lang/socket2#568 * rust-analyzer: needs `cargo update`, fixed upstream ``` $ rustc --version --verbose rustc 1.88.0-dev binary: rustc commit-hash: unknown commit-date: unknown host: x86_64-pc-cygwin release: 1.88.0-dev LLVM version: 20.1.4 ```
Cygwin support in rustc This PR builds host rustc targeting cygwin. - [x] rust-lang/stacker#122 - [x] nagisa/rust_libloading#173 - [x] Detegr/rust-ctrlc#131 - [x] rust-random/getrandom#654 - [x] msys2/MSYS2-packages#5350 - [x] rust-lang#140886 - [x] rust-lang#140921 - [x] rust-lang#140973 Currently supported: * rustc * rustdoc * rustfmt * clippy Blocking: * cargo: blocked by rust-lang/socket2#568 * rust-analyzer: needs `cargo update`, fixed upstream ``` $ rustc --version --verbose rustc 1.88.0-dev binary: rustc commit-hash: unknown commit-date: unknown host: x86_64-pc-cygwin release: 1.88.0-dev LLVM version: 20.1.4 ```
Cygwin support in rustc This PR builds host rustc targeting cygwin. - [x] rust-lang/stacker#122 - [x] nagisa/rust_libloading#173 - [x] Detegr/rust-ctrlc#131 - [x] rust-random/getrandom#654 - [x] msys2/MSYS2-packages#5350 - [x] rust-lang#140886 - [x] rust-lang#140921 - [x] rust-lang#140973 Currently supported: * rustc * rustdoc * rustfmt * clippy Blocking: * cargo: blocked by rust-lang/socket2#568 * rust-analyzer: needs `cargo update`, fixed upstream ``` $ rustc --version --verbose rustc 1.88.0-dev binary: rustc commit-hash: unknown commit-date: unknown host: x86_64-pc-cygwin release: 1.88.0-dev LLVM version: 20.1.4 ```
Cygwin support in rustc This PR builds host rustc targeting cygwin. - [x] rust-lang/stacker#122 - [x] nagisa/rust_libloading#173 - [x] Detegr/rust-ctrlc#131 - [x] rust-random/getrandom#654 - [x] msys2/MSYS2-packages#5350 - [x] rust-lang#140886 - [x] rust-lang#140921 - [x] rust-lang#140973 Currently supported: * rustc * rustdoc * rustfmt * clippy Blocking: * cargo: blocked by rust-lang/socket2#568 * rust-analyzer: needs `cargo update`, fixed upstream ``` $ rustc --version --verbose rustc 1.88.0-dev binary: rustc commit-hash: unknown commit-date: unknown host: x86_64-pc-cygwin release: 1.88.0-dev LLVM version: 20.1.4 ```
Well, it's OK. Anyone has their busy time:) It seems that you're the only active maintainer of this repo...? It's a little surprising because, I thought that the rust crates team should maintain such fundamental crate more actively:) |
Cygwin support in rustc This PR builds host rustc targeting cygwin. - [x] rust-lang/stacker#122 - [x] nagisa/rust_libloading#173 - [x] Detegr/rust-ctrlc#131 - [x] rust-random/getrandom#654 - [x] msys2/MSYS2-packages#5350 - [x] rust-lang/rust#140886 - [x] rust-lang/rust#140921 - [x] rust-lang/rust#140973 Currently supported: * rustc * rustdoc * rustfmt * clippy Blocking: * cargo: blocked by rust-lang/socket2#568 * rust-analyzer: needs `cargo update`, fixed upstream ``` $ rustc --version --verbose rustc 1.88.0-dev binary: rustc commit-hash: unknown commit-date: unknown host: x86_64-pc-cygwin release: 1.88.0-dev LLVM version: 20.1.4 ```
Cygwin support in rustc This PR builds host rustc targeting cygwin. - [x] rust-lang/stacker#122 - [x] nagisa/rust_libloading#173 - [x] Detegr/rust-ctrlc#131 - [x] rust-random/getrandom#654 - [x] msys2/MSYS2-packages#5350 - [x] rust-lang/rust#140886 - [x] rust-lang/rust#140921 - [x] rust-lang/rust#140973 Currently supported: * rustc * rustdoc * rustfmt * clippy Blocking: * cargo: blocked by rust-lang/socket2#568 * rust-analyzer: needs `cargo update`, fixed upstream ``` $ rustc --version --verbose rustc 1.88.0-dev binary: rustc commit-hash: unknown commit-date: unknown host: x86_64-pc-cygwin release: 1.88.0-dev LLVM version: 20.1.4 ```
src/sys/unix.rs
Outdated
/// Sets `SO_PEERCRED` to null on the socket. | ||
/// It disables the initial handshake of unix domain sockets. |
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 please improve the documentation for this. It should explain that normally cygwin performs an AF_LOCAL
handshake when opening local sockets, and that this option turns off that cygwin extension. Also please include a link to the discussion thread about it.
It would also make sense to document on connect
about this behavior. It's unfortunate that cygwin differs like this, but if that's how the OS works, then I'm not sure we can do much about it.
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.
FYI, I have llvm/llvm-project#140353 for the same issue. It only seems to be a problem in the tests though (I think any real-world case would have at least separate threads if not processes involved, or they could use socketpair
which takes care of getting both sides of the socket connected to each other at once)
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.
OK, docs are added for set_no_peercred
, connect
and accept
.
This PR makes it compile on cygwin.