diff --git a/bazel/BUILD.hiredis b/bazel/BUILD.hiredis index e97413d9d..7444da799 100644 --- a/bazel/BUILD.hiredis +++ b/bazel/BUILD.hiredis @@ -25,6 +25,7 @@ cc_library( ], exclude = [ + "ssl.c", "test.c", ], ), @@ -32,14 +33,7 @@ cc_library( "*.h", "adapters/*.h", ]), - copts = COPTS + select({ - "@bazel_tools//src/conditions:windows": [ - "-D" + "WIN32_REPLACE_FD_APIS", - "/FI" + "win32fd.h", - ], - "//conditions:default": [ - ], - }), + copts = COPTS, include_prefix = "hiredis", deps = [ ":_hiredis", diff --git a/bazel/ray_deps_setup.bzl b/bazel/ray_deps_setup.bzl index 50524259c..bd4111d21 100644 --- a/bazel/ray_deps_setup.bzl +++ b/bazel/ray_deps_setup.bzl @@ -89,14 +89,10 @@ def ray_deps_setup(): auto_http_archive( name = "com_github_redis_hiredis", build_file = "//bazel:BUILD.hiredis", - url = "https://github.com/redis/hiredis/archive/33152ad163a21f568fb40eeeb88b79365886b4ea.tar.gz", - sha256 = "9a91274dfd131111227b39ffa3cf7b446fbbd7ee2e5a94c8e7d8ad334b4ff255", + url = "https://github.com/redis/hiredis/archive/392de5d7f97353485df1237872cb682842e8d83f.tar.gz", + sha256 = "2101650d39a8f13293f263e9da242d2c6dee0cda08d343b2939ffe3d95cf3b8b", patches = [ - "//thirdparty/patches:hiredis-connect-rename.patch", "//thirdparty/patches:hiredis-windows-msvc.patch", - "//thirdparty/patches:hiredis-windows-sigpipe.patch", - "//thirdparty/patches:hiredis-windows-sockets.patch", - "//thirdparty/patches:hiredis-windows-strerror.patch", ], ) diff --git a/src/ray/gcs/asio.cc b/src/ray/gcs/asio.cc index e449a95bd..0de559d38 100644 --- a/src/ray/gcs/asio.cc +++ b/src/ray/gcs/asio.cc @@ -14,10 +14,6 @@ #include "asio.h" -#ifdef _WIN32 -#include -#endif - #include "ray/util/logging.h" RedisAsioClient::RedisAsioClient(boost::asio::io_service &io_service, @@ -37,7 +33,7 @@ RedisAsioClient::RedisAsioClient(boost::asio::io_service &io_service, #ifdef _WIN32 SOCKET sock = SOCKET_ERROR; WSAPROTOCOL_INFO pi; - if (WSADuplicateSocket(fh_get(c->fd), GetCurrentProcessId(), &pi) == 0) { + if (WSADuplicateSocket(c->fd, GetCurrentProcessId(), &pi) == 0) { DWORD flag = WSA_FLAG_OVERLAPPED; sock = WSASocket(pi.iAddressFamily, pi.iSocketType, pi.iProtocol, &pi, 0, flag); } diff --git a/thirdparty/patches/hiredis-connect-rename.patch b/thirdparty/patches/hiredis-connect-rename.patch deleted file mode 100644 index 6a95d5057..000000000 --- a/thirdparty/patches/hiredis-connect-rename.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git test.c test.c ---- test.c -+++ test.c -@@ -94,1 +94,1 @@ --static redisContext *connect(struct config config) { -+static redisContext *connect_(struct config config) { -@@ -251,1 +251,1 @@ -- c = connect(config); -+ c = connect_(config); -@@ -390,1 +390,1 @@ -- c = connect(config); -+ c = connect_(config); -@@ -471,1 +471,1 @@ -- c = connect(config); -+ c = connect_(config); -@@ -483,1 +483,1 @@ -- c = connect(config); -+ c = connect_(config); -@@ -517,1 +517,1 @@ -- c = connect(config); -+ c = connect_(config); -@@ -552,1 +552,1 @@ -- c = connect(config); -+ c = connect_(config); -@@ -586,1 +586,1 @@ -- redisContext *c = connect(config); -+ redisContext *c = connect_(config); --- diff --git a/thirdparty/patches/hiredis-windows-msvc.patch b/thirdparty/patches/hiredis-windows-msvc.patch index 33e0ea064..2d05b117c 100644 --- a/thirdparty/patches/hiredis-windows-msvc.patch +++ b/thirdparty/patches/hiredis-windows-msvc.patch @@ -14,11 +14,10 @@ diff --git sds.h sds.h +#pragma pack(pop) +#endif -diff --git net.c net.c ---- net.c -+++ net.c -@@ -52,1 +52,4 @@ - #include +diff --git fmacros.h fmacros.h +--- fmacros.h ++++ fmacros.h +@@ -12,0 +12,3 @@ +#if defined(_MSC_VER) && !defined(__clang__) && !defined(strdup) +#define strdup _strdup +#endif diff --git a/thirdparty/patches/hiredis-windows-sigpipe.patch b/thirdparty/patches/hiredis-windows-sigpipe.patch deleted file mode 100644 index bcfa5055e..000000000 --- a/thirdparty/patches/hiredis-windows-sigpipe.patch +++ /dev/null @@ -1,9 +0,0 @@ -diff --git test.c test.c ---- test.c -+++ test.c -@@ -762,2 +762,4 @@ int main(int argc, char **argv) { -+#ifndef _WIN32 - /* Ignore broken pipe signal (for I/O error tests). */ - signal(SIGPIPE, SIG_IGN); -+#endif --- diff --git a/thirdparty/patches/hiredis-windows-sockets.patch b/thirdparty/patches/hiredis-windows-sockets.patch deleted file mode 100644 index f458083b2..000000000 --- a/thirdparty/patches/hiredis-windows-sockets.patch +++ /dev/null @@ -1,58 +0,0 @@ -diff --git hiredis.c hiredis.c ---- hiredis.c -+++ hiredis.c -@@ -620,1 +620,1 @@ -- close(c->fd); -+ redisContextCloseFd(c); -@@ -648,1 +648,1 @@ -- close(c->fd); -+ redisContextCloseFd(c); -diff --git net.h net.h ---- net.h -+++ net.h -@@ -44,1 +44,2 @@ -+void redisContextCloseFd(redisContext *c); - int redisContextConnectTcp(redisContext *c, const char *addr, int port, const struct timeval *timeout); -diff --git net.c net.c ---- net.c -+++ net.c -@@ -60,1 +60,1 @@ --static void redisContextCloseFd(redisContext *c) { -+void redisContextCloseFd(redisContext *c) { -@@ -102,24 +102,33 @@ - static int redisSetBlocking(redisContext *c, int blocking) { - int flags; - -- /* Set the socket nonblocking. -+ /* Set the socket nonblocking. */ -+#ifdef _WINSOCKAPI_ -+ unsigned long value = !blocking; -+ if (ioctlsocket(c->fd, FIONBIO, &value) == SOCKET_ERROR) { -+ __redisSetErrorFromErrno(c,REDIS_ERR_IO,"ioctlsocket(FIONBIO)"); -+ redisContextCloseFd(c); -+ return REDIS_ERR; -+ } -+#else -- * Note that fcntl(2) for F_GETFL and F_SETFL can't be -+ /* Note that fcntl(2) for F_GETFL and F_SETFL can't be - * interrupted by a signal. */ - if ((flags = fcntl(c->fd, F_GETFL)) == -1) { - __redisSetErrorFromErrno(c,REDIS_ERR_IO,"fcntl(F_GETFL)"); - redisContextCloseFd(c); - return REDIS_ERR; - } - - if (blocking) - flags &= ~O_NONBLOCK; - else - flags |= O_NONBLOCK; - - if (fcntl(c->fd, F_SETFL, flags) == -1) { - __redisSetErrorFromErrno(c,REDIS_ERR_IO,"fcntl(F_SETFL)"); - redisContextCloseFd(c); - return REDIS_ERR; - } -+#endif - return REDIS_OK; - } --- diff --git a/thirdparty/patches/hiredis-windows-strerror.patch b/thirdparty/patches/hiredis-windows-strerror.patch deleted file mode 100644 index c650d4dcd..000000000 --- a/thirdparty/patches/hiredis-windows-strerror.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git hiredis.h hiredis.h ---- hiredis.h -+++ hiredis.h -@@ -87,5 +87,12 @@ -+#ifdef _WIN32 -+#define __redis_strerror_r(errno, buf, len) \ -+ do { \ -+ strerror_s((buf), (len), (errno)); \ -+ } while (0) -+#else - /* "regular" POSIX strerror_r that does the right thing. */ - #define __redis_strerror_r(errno, buf, len) \ - do { \ - strerror_r((errno), (buf), (len)); \ - } while (0) -+#endif ---