-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
remove requirement on HAVE_SYS_UN_H for unix domain sockets on Windows #7737
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.
👍
It seems to not be quite true everywhere:
|
I'll take a look into that. I'm guessing there is a mismatch between different toolchains/compilers? I'm not very familiar with Windows world :/ Also I might have had wrong compilation options (or just missing something) when I was compiling it myself on my machine - I was just using this as is. However, I think this might be unlikely as |
The MinGW I have (TDM-gcc 8.0.0) have #if !defined(HAVE_SOCKADDR_UN)
struct sockaddr_un {
sa_family_t sun_family;
char sun_path [200];
};
#endif |
73bec01
to
23e31db
Compare
Ahh this doesn't seem to do the trick as well. I think it might work but only with cmake build. |
I added a little change, so it should now work not only with cmake. |
757c00b
to
429917b
Compare
I changed it to something much simpler. It should work for all cases and builds where it previously worked and for cases where sockaddr_un is manually defined on Windows in |
429917b
to
584b7e6
Compare
rebased |
Thanks! |
Summary: Vendoring this patch: curl/curl#7737 to curl-sys rust crate. On windows the hg client is using curl that's bundled with sys-curl. I need this patch to have unix domain sockets working in hg client on windows. I had to manually vendor https://raw.githubusercontent.com/mzr/curl/57e7ec4dbe4dd2831de51f2644879387d2ea7b44/docs/INSTALL because reindeer didn't do it. IDK why. oss-eden-{darwin,linux,windows}-getdeps fail with: ``` FAILED: eden/scm/lib/backingstore/CMakeFiles/rust_backingstore.cargo eden/scm/lib/backingstore/debug/libbackingstore.a eden/scm/lib/backingstore/release/libbackingstore.a cd /data/sandcastle/temp/fbcode_builder_getdeps/shipit/eden/eden/scm/lib/backingstore && /data/sandcastle/temp/fbcode_builder_getdeps/installed/cmake-hQhVzQT-WzFKTeqXjLxo5lLi8IG4_MjX2-YRqptCUVs/bin/cmake -E remove -f /data/sandcastle/temp/fbcode_builder_getdeps/shipit/eden/eden/scm/lib/backingstore/Cargo.lock && /data/sandcastle/temp/fbcode_builder_getdeps/installed/cmake-hQhVzQT-WzFKTeqXjLxo5lLi8IG4_MjX2-YRqptCUVs/bin/cmake -E env CARGO_TARGET_DIR=/data/sandcastle/temp/fbcode_builder_getdeps/build/eden/eden/scm/lib/backingstore CARGO_HOME=/data/sandcastle/temp/fbcode_builder_getdeps/build/eden/_cargo_home cargo build --release -p backingstore --features fb Blocking waiting for file lock on package cache Blocking waiting for file lock on package cache error: failed to calculate checksum of: /data/sandcastle/boxes/eden-trunk-hg-fbcode-fbsource/third-party/rust/vendor/curl-sys-0.4.45+curl-7.78.0/curl/docs/INSTALL Caused by: failed to open file `/data/sandcastle/boxes/eden-trunk-hg-fbcode-fbsource/third-party/rust/vendor/curl-sys-0.4.45+curl-7.78.0/curl/docs/INSTALL` Caused by: No such file or directory (os error 2) ``` Not idea how to fix this. Seems related to the fact that reindeer didn't vendor docs/INSTALL. # EDIT: # It might been caused by some bug in hg. now it's fine # The failure in oss-eden-linux-getdeps looks unrelated (something with rocksdb) Reviewed By: krallin Differential Revision: D31370778 fbshipit-source-id: a1245f8cb6b58f5765e34c95dfd78325a8e6e457
Summary: Vendoring this patch: curl/curl#7737 to curl-sys rust crate. On windows the hg client is using curl that's bundled with sys-curl. I need this patch to have unix domain sockets working in hg client on windows. I had to manually vendor https://raw.githubusercontent.com/mzr/curl/57e7ec4dbe4dd2831de51f2644879387d2ea7b44/docs/INSTALL because reindeer didn't do it. IDK why. oss-eden-{darwin,linux,windows}-getdeps fail with: ``` FAILED: eden/scm/lib/backingstore/CMakeFiles/rust_backingstore.cargo eden/scm/lib/backingstore/debug/libbackingstore.a eden/scm/lib/backingstore/release/libbackingstore.a cd /data/sandcastle/temp/fbcode_builder_getdeps/shipit/eden/eden/scm/lib/backingstore && /data/sandcastle/temp/fbcode_builder_getdeps/installed/cmake-hQhVzQT-WzFKTeqXjLxo5lLi8IG4_MjX2-YRqptCUVs/bin/cmake -E remove -f /data/sandcastle/temp/fbcode_builder_getdeps/shipit/eden/eden/scm/lib/backingstore/Cargo.lock && /data/sandcastle/temp/fbcode_builder_getdeps/installed/cmake-hQhVzQT-WzFKTeqXjLxo5lLi8IG4_MjX2-YRqptCUVs/bin/cmake -E env CARGO_TARGET_DIR=/data/sandcastle/temp/fbcode_builder_getdeps/build/eden/eden/scm/lib/backingstore CARGO_HOME=/data/sandcastle/temp/fbcode_builder_getdeps/build/eden/_cargo_home cargo build --release -p backingstore --features fb Blocking waiting for file lock on package cache Blocking waiting for file lock on package cache error: failed to calculate checksum of: /data/sandcastle/boxes/eden-trunk-hg-fbcode-fbsource/third-party/rust/vendor/curl-sys-0.4.45+curl-7.78.0/curl/docs/INSTALL Caused by: failed to open file `/data/sandcastle/boxes/eden-trunk-hg-fbcode-fbsource/third-party/rust/vendor/curl-sys-0.4.45+curl-7.78.0/curl/docs/INSTALL` Caused by: No such file or directory (os error 2) ``` Not idea how to fix this. Seems related to the fact that reindeer didn't vendor docs/INSTALL. # EDIT: # It might been caused by some bug in hg. now it's fine # The failure in oss-eden-linux-getdeps looks unrelated (something with rocksdb) Reviewed By: krallin Differential Revision: D31370778 fbshipit-source-id: a1245f8cb6b58f5765e34c95dfd78325a8e6e457
Summary: Vendoring this patch: curl/curl#7737 to curl-sys rust crate. On windows the hg client is using curl that's bundled with sys-curl. I need this patch to have unix domain sockets working in hg client on windows. I had to manually vendor https://raw.githubusercontent.com/mzr/curl/57e7ec4dbe4dd2831de51f2644879387d2ea7b44/docs/INSTALL because reindeer didn't do it. IDK why. oss-eden-{darwin,linux,windows}-getdeps fail with: ``` FAILED: eden/scm/lib/backingstore/CMakeFiles/rust_backingstore.cargo eden/scm/lib/backingstore/debug/libbackingstore.a eden/scm/lib/backingstore/release/libbackingstore.a cd /data/sandcastle/temp/fbcode_builder_getdeps/shipit/eden/eden/scm/lib/backingstore && /data/sandcastle/temp/fbcode_builder_getdeps/installed/cmake-hQhVzQT-WzFKTeqXjLxo5lLi8IG4_MjX2-YRqptCUVs/bin/cmake -E remove -f /data/sandcastle/temp/fbcode_builder_getdeps/shipit/eden/eden/scm/lib/backingstore/Cargo.lock && /data/sandcastle/temp/fbcode_builder_getdeps/installed/cmake-hQhVzQT-WzFKTeqXjLxo5lLi8IG4_MjX2-YRqptCUVs/bin/cmake -E env CARGO_TARGET_DIR=/data/sandcastle/temp/fbcode_builder_getdeps/build/eden/eden/scm/lib/backingstore CARGO_HOME=/data/sandcastle/temp/fbcode_builder_getdeps/build/eden/_cargo_home cargo build --release -p backingstore --features fb Blocking waiting for file lock on package cache Blocking waiting for file lock on package cache error: failed to calculate checksum of: /data/sandcastle/boxes/eden-trunk-hg-fbcode-fbsource/third-party/rust/vendor/curl-sys-0.4.45+curl-7.78.0/curl/docs/INSTALL Caused by: failed to open file `/data/sandcastle/boxes/eden-trunk-hg-fbcode-fbsource/third-party/rust/vendor/curl-sys-0.4.45+curl-7.78.0/curl/docs/INSTALL` Caused by: No such file or directory (os error 2) ``` Not idea how to fix this. Seems related to the fact that reindeer didn't vendor docs/INSTALL. # EDIT: # It might been caused by some bug in hg. now it's fine # The failure in oss-eden-linux-getdeps looks unrelated (something with rocksdb) Reviewed By: krallin Differential Revision: D31370778 fbshipit-source-id: a1245f8cb6b58f5765e34c95dfd78325a8e6e457
Summary: Bumping versions because I need this patch: curl/curl#7737. It's now in the 0.4.41 version of curl-rust and 0.4.51 version of curl-sys. I previously added it here D31370778 (083a9ad), but it somehow got removed here D32340068 (3d32723). Reviewed By: jsgf Differential Revision: D32791487 fbshipit-source-id: 8d7efaa3713b5cfa65b81d85d8d5f68bc8b8435a
As described in #5162 curl with option
--unix-socket
on Windows was failing with:It happened because in
Curl_addr2string
's switch statement, case withAF_UNIX
was behinddefine(HAVE_SYS_UN_H) && defined(AF_UNIX)
. There is nosys/un.h
on Windows. On Windowssockaddr_un
is defined inafunix.h
(not insys/un.h
as it's on unix-like OSs). After this change, curl with--unix-socket
worked for me as expected.I'm not sure if this is the proper way to fix this, so I'd welcome some feedback. Also, I'm counting on tests that should run on this PR to see if things are OK.