From 2c81c5619e80d69c96496098879620ed973d7b2c Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Wed, 19 Jul 2023 10:56:11 -0700 Subject: [PATCH] [deps] Remove libuv dependency (#33748) --- .gitmodules | 3 - bazel/grpc_deps.bzl | 22 - doc/core/grpc-polling-engines.md | 2 - third_party/BUILD | 1 - third_party/libuv | 1 - third_party/libuv.BUILD | 391 ------------------ .../run_tests/sanity/check_bazel_workspace.py | 1 - tools/run_tests/sanity/check_submodules.sh | 1 - 8 files changed, 422 deletions(-) delete mode 160000 third_party/libuv delete mode 100644 third_party/libuv.BUILD diff --git a/.gitmodules b/.gitmodules index 55b22264b89..99016a3d37d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -22,9 +22,6 @@ [submodule "third_party/googletest"] path = third_party/googletest url = https://github.com/google/googletest.git -[submodule "third_party/libuv"] - path = third_party/libuv - url = https://github.com/libuv/libuv.git [submodule "third_party/opencensus-proto"] path = third_party/opencensus-proto url = https://github.com/census-instrumentation/opencensus-proto.git diff --git a/bazel/grpc_deps.bzl b/bazel/grpc_deps.bzl index 7b124cc170b..ce0f40493d1 100644 --- a/bazel/grpc_deps.bzl +++ b/bazel/grpc_deps.bzl @@ -195,16 +195,6 @@ def grpc_deps(): actual = "@io_opencensus_cpp//opencensus/exporters/stats/stackdriver:stackdriver_exporter", ) - native.bind( - name = "libuv", - actual = "@com_github_libuv_libuv//:libuv", - ) - - native.bind( - name = "libuv_test", - actual = "@com_github_libuv_libuv//:libuv_test", - ) - native.bind( name = "googleapis_trace_grpc_service", actual = "@com_google_googleapis//google/devtools/cloudtrace/v2:cloudtrace_cc_grpc", @@ -443,18 +433,6 @@ def grpc_deps(): ], ) - if "com_github_libuv_libuv" not in native.existing_rules(): - http_archive( - name = "com_github_libuv_libuv", - build_file = "@com_github_grpc_grpc//third_party:libuv.BUILD", - sha256 = "5ca4e9091f3231d8ad8801862dc4e851c23af89c69141d27723157776f7291e7", - strip_prefix = "libuv-02a9e1be252b623ee032a3137c0b0c94afbe6809", - urls = [ - "https://storage.googleapis.com/grpc-bazel-mirror/github.com/libuv/libuv/archive/02a9e1be252b623ee032a3137c0b0c94afbe6809.tar.gz", - "https://github.com/libuv/libuv/archive/02a9e1be252b623ee032a3137c0b0c94afbe6809.tar.gz", - ], - ) - if "com_google_googleapis" not in native.existing_rules(): http_archive( name = "com_google_googleapis", diff --git a/doc/core/grpc-polling-engines.md b/doc/core/grpc-polling-engines.md index 0a15e3312bb..64d1aeae46f 100644 --- a/doc/core/grpc-polling-engines.md +++ b/doc/core/grpc-polling-engines.md @@ -24,8 +24,6 @@ There are multiple polling engine implementations depending on the OS and the OS - `poll` (If kernel does not have epoll support) - Mac: **`poll`** (default) - Windows: (no name) -- One-off polling engines: - - NodeJS : `libuv` polling engine implementation (requires different compile `#define`s) ## Polling Engine Interface diff --git a/third_party/BUILD b/third_party/BUILD index 72a4730d890..b346d6edc0f 100644 --- a/third_party/BUILD +++ b/third_party/BUILD @@ -10,7 +10,6 @@ exports_files([ "six.BUILD", "enum34.BUILD", "futures.BUILD", - "libuv.BUILD", "protobuf.patch", "rules_python.patch", "protoc-gen-validate.patch", diff --git a/third_party/libuv b/third_party/libuv deleted file mode 160000 index 02a9e1be252..00000000000 --- a/third_party/libuv +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 02a9e1be252b623ee032a3137c0b0c94afbe6809 diff --git a/third_party/libuv.BUILD b/third_party/libuv.BUILD deleted file mode 100644 index a3a9355d7d9..00000000000 --- a/third_party/libuv.BUILD +++ /dev/null @@ -1,391 +0,0 @@ -# Copyright 2021 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -load("@bazel_skylib//lib:selects.bzl", "selects") - -config_setting( - name = "darwin", - values = {"cpu": "darwin"}, -) - -config_setting( - name = "darwin_x86_64", - values = {"cpu": "darwin_x86_64"}, -) - -config_setting( - name = "darwin_arm64", - values = {"cpu": "darwin_arm64"}, -) - -config_setting( - name = "darwin_arm64e", - values = {"cpu": "darwin_arm64e"}, -) - -config_setting( - name = "windows", - values = {"cpu": "x64_windows"}, -) - -config_setting( - name = "freebsd", - constraint_values = ["@platforms//os:freebsd"], -) - -# Android is not officially supported through C++. -# This just helps with the build for now. -config_setting( - name = "android", - values = { - "crosstool_top": "//external:android/crosstool", - }, -) - -# iOS is not officially supported through C++. -# This just helps with the build for now. -config_setting( - name = "ios_x86_64", - values = {"cpu": "ios_x86_64"}, -) - -config_setting( - name = "ios_armv7", - values = {"cpu": "ios_armv7"}, -) - -config_setting( - name = "ios_armv7s", - values = {"cpu": "ios_armv7s"}, -) - -config_setting( - name = "ios_arm64", - values = {"cpu": "ios_arm64"}, -) - -# The following architectures are found in -# https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/rules/apple/ApplePlatform.java -config_setting( - name = "tvos_x86_64", - values = {"cpu": "tvos_x86_64"}, -) - -config_setting( - name = "tvos_arm64", - values = {"cpu": "tvos_arm64"}, -) - -config_setting( - name = "watchos_i386", - values = {"cpu": "watchos_i386"}, -) - -config_setting( - name = "watchos_x86_64", - values = {"cpu": "watchos_x86_64"}, -) - -config_setting( - name = "watchos_armv7k", - values = {"cpu": "watchos_armv7k"}, -) - -config_setting( - name = "watchos_arm64_32", - values = {"cpu": "watchos_arm64_32"}, -) - -selects.config_setting_group( - name = "apple", - match_any = [ - ":darwin", - ":darwin_x86_64", - ":darwin_arm64", - ":darwin_arm64e", - "ios_x86_64", - "ios_armv7", - "ios_armv7s", - "ios_arm64", - "tvos_x86_64", - "tvos_arm64", - "watchos_i386", - "watchos_x86_64", - "watchos_armv7k", - "watchos_arm64_32", - ], -) - -COMMON_LIBUV_HEADERS = [ - "include/uv.h", - "include/uv/errno.h", - "include/uv/threadpool.h", - "include/uv/version.h", - "include/uv/tree.h", -] - -UNIX_LIBUV_HEADERS = [ - "include/uv/unix.h", - "src/unix/atomic-ops.h", - "src/unix/internal.h", - "src/unix/spinlock.h", -] - -LINUX_LIBUV_HEADERS = [ - "include/uv/linux.h", - "src/unix/linux-syscalls.h", -] - -ANDROID_LIBUV_HEADERS = [ - "include/uv/android-ifaddrs.h", -] - -DARWIN_LIBUV_HEADERS = [ - "include/uv/darwin.h", -] - -WINDOWS_LIBUV_HEADERS = [ - "include/uv/win.h", - "src/win/atomicops-inl.h", - "src/win/handle-inl.h", - "src/win/internal.h", - "src/win/req-inl.h", - "src/win/stream-inl.h", - "src/win/winapi.h", - "src/win/winsock.h", -] - -COMMON_LIBUV_SOURCES = [ - "src/fs-poll.c", - "src/heap-inl.h", - "src/idna.c", - "src/idna.h", - "src/inet.c", - "src/queue.h", - "src/strscpy.c", - "src/strscpy.h", - "src/threadpool.c", - "src/timer.c", - "src/uv-data-getter-setters.c", - "src/uv-common.c", - "src/uv-common.h", - "src/version.c", -] - -UNIX_LIBUV_SOURCES = [ - "src/unix/async.c", - "src/unix/atomic-ops.h", - "src/unix/core.c", - "src/unix/dl.c", - "src/unix/fs.c", - "src/unix/getaddrinfo.c", - "src/unix/getnameinfo.c", - "src/unix/internal.h", - "src/unix/loop.c", - "src/unix/loop-watcher.c", - "src/unix/pipe.c", - "src/unix/poll.c", - "src/unix/process.c", - "src/unix/signal.c", - "src/unix/spinlock.h", - "src/unix/stream.c", - "src/unix/tcp.c", - "src/unix/thread.c", - "src/unix/tty.c", - "src/unix/udp.c", -] - -LINUX_LIBUV_SOURCES = [ - "src/unix/linux-core.c", - "src/unix/linux-inotify.c", - "src/unix/linux-syscalls.c", - "src/unix/linux-syscalls.h", - "src/unix/procfs-exepath.c", - "src/unix/proctitle.c", - "src/unix/sysinfo-loadavg.c", - "src/unix/sysinfo-memory.c", -] - -ANDROID_LIBUV_SOURCES = [ - "src/unix/android-ifaddrs.c", - "src/unix/pthread-fixes.c", -] - -DARWIN_LIBUV_SOURCES = [ - "src/unix/bsd-ifaddrs.c", - "src/unix/darwin.c", - "src/unix/fsevents.c", - "src/unix/kqueue.c", - "src/unix/darwin-proctitle.c", - "src/unix/proctitle.c", -] - -WINDOWS_LIBUV_SOURCES = [ - "src/win/async.c", - "src/win/atomicops-inl.h", - "src/win/core.c", - "src/win/detect-wakeup.c", - "src/win/dl.c", - "src/win/error.c", - "src/win/fs-event.c", - "src/win/fs.c", - "src/win/getaddrinfo.c", - "src/win/getnameinfo.c", - "src/win/handle.c", - "src/win/handle-inl.h", - "src/win/internal.h", - "src/win/loop-watcher.c", - "src/win/pipe.c", - "src/win/poll.c", - "src/win/process-stdio.c", - "src/win/process.c", - "src/win/req-inl.h", - "src/win/signal.c", - "src/win/stream.c", - "src/win/stream-inl.h", - "src/win/tcp.c", - "src/win/thread.c", - "src/win/tty.c", - "src/win/udp.c", - "src/win/util.c", - "src/win/winapi.c", - "src/win/winapi.h", - "src/win/winsock.c", - "src/win/winsock.h", -] - -cc_library( - name = "libuv", - srcs = select({ - ":android": COMMON_LIBUV_SOURCES + UNIX_LIBUV_SOURCES + LINUX_LIBUV_SOURCES + ANDROID_LIBUV_SOURCES, - ":apple": COMMON_LIBUV_SOURCES + UNIX_LIBUV_SOURCES + DARWIN_LIBUV_SOURCES, - ":windows": COMMON_LIBUV_SOURCES + WINDOWS_LIBUV_SOURCES, - "//conditions:default": COMMON_LIBUV_SOURCES + UNIX_LIBUV_SOURCES + LINUX_LIBUV_SOURCES, - }), - hdrs = select({ - ":android": COMMON_LIBUV_HEADERS + UNIX_LIBUV_HEADERS + LINUX_LIBUV_HEADERS + ANDROID_LIBUV_HEADERS, - ":apple": COMMON_LIBUV_HEADERS + UNIX_LIBUV_HEADERS + DARWIN_LIBUV_HEADERS, - ":windows": COMMON_LIBUV_HEADERS + WINDOWS_LIBUV_HEADERS, - "//conditions:default": COMMON_LIBUV_HEADERS + UNIX_LIBUV_HEADERS + LINUX_LIBUV_HEADERS, - }), - copts = [ - "-D_LARGEFILE_SOURCE", - "-D_FILE_OFFSET_BITS=64", - "-D_GNU_SOURCE", - "-pthread", - "--std=gnu89", - "-pedantic", - "-Wno-error", - "-Wno-strict-aliasing", - "-Wstrict-aliasing", - "-O2", - "-Wno-implicit-function-declaration", - "-Wno-unused-function", - "-Wno-unused-variable", - ] + select({ - ":apple": [], - ":windows": [ - "-DWIN32_LEAN_AND_MEAN", - "-D_WIN32_WINNT=0x0600", - ], - "//conditions:default": [ - "-Wno-tree-vrp", - "-Wno-omit-frame-pointer", - "-D_DARWIN_USE_64_BIT_INODE=1", - "-D_DARWIN_UNLIMITED_SELECT=1", - ], - }), - includes = [ - "include", - "src", - ], - linkopts = select({ - ":windows": [ - "-Xcrosstool-compilation-mode=$(COMPILATION_MODE)", - "-Wl,Iphlpapi.lib", - "-Wl,Psapi.lib", - "-Wl,User32.lib", - "-Wl,Userenv.lib", - ], - "//conditions:default": [], - }), - visibility = [ - "//visibility:public", - ], -) - -cc_library( - name = "libuv_test", - srcs = [ - "test/test-timer.c", - "test/test-timer-again.c", - "test/test-timer-from-check.c", - "test/test-getaddrinfo.c", - "test/test-gethostname.c", - "test/test-getnameinfo.c", - "test/test-getsockname.c", - ], - hdrs = [ - "test/runner.h", - "test/runner-unix.h", - "test/task.h", - ], - includes = [ - "include", - "src", - ], - deps = [ - ":libuv" - ], - copts = [ - "-D_LARGEFILE_SOURCE", - "-D_FILE_OFFSET_BITS=64", - "-D_GNU_SOURCE", - "-pthread", - "--std=gnu89", - "-pedantic", - "-Wno-error", - "-Wno-strict-aliasing", - "-Wstrict-aliasing", - "-O2", - "-Wno-implicit-function-declaration", - "-Wno-unused-function", - "-Wno-unused-variable", - ] + select({ - ":apple": [], - ":windows": [ - "-DWIN32_LEAN_AND_MEAN", - "-D_WIN32_WINNT=0x0600", - ], - "//conditions:default": [ - "-Wno-tree-vrp", - "-Wno-omit-frame-pointer", - "-D_DARWIN_USE_64_BIT_INODE=1", - "-D_DARWIN_UNLIMITED_SELECT=1", - ], - }), - linkopts = select({ - ":windows": [ - "-Xcrosstool-compilation-mode=$(COMPILATION_MODE)", - "-Wl,Iphlpapi.lib", - "-Wl,Psapi.lib", - "-Wl,User32.lib", - "-Wl,Userenv.lib", - ], - "//conditions:default": [], - }), - visibility = [ - "//visibility:public", - ], -) diff --git a/tools/run_tests/sanity/check_bazel_workspace.py b/tools/run_tests/sanity/check_bazel_workspace.py index 8d37a4bb92d..2b78c439c18 100755 --- a/tools/run_tests/sanity/check_bazel_workspace.py +++ b/tools/run_tests/sanity/check_bazel_workspace.py @@ -71,7 +71,6 @@ _GRPC_DEP_NAMES = [ "io_bazel_rules_go", "build_bazel_rules_apple", "build_bazel_apple_support", - "com_github_libuv_libuv", "com_googlesource_code_re2", "bazel_gazelle", "opencensus_proto", diff --git a/tools/run_tests/sanity/check_submodules.sh b/tools/run_tests/sanity/check_submodules.sh index 0332888f7e9..7fd75cb3a73 100755 --- a/tools/run_tests/sanity/check_submodules.sh +++ b/tools/run_tests/sanity/check_submodules.sh @@ -33,7 +33,6 @@ third_party/cares/cares 6360e96b5cf8e5980c887ce58ef727e53d77243a third_party/envoy-api e53e7bbd012f81965f2e79848ad9a58ceb67201f third_party/googleapis 2f9af297c84c55c8b871ba4495e01ade42476c92 third_party/googletest 0e402173c97aea7a00749e825b194bfede4f2e45 -third_party/libuv 02a9e1be252b623ee032a3137c0b0c94afbe6809 third_party/opencensus-proto 4aa53e15cbf1a47bc9087e6cfdca214c1eea4e89 third_party/opentelemetry 60fa8754d890b5c55949a8c68dcfd7ab5c2395df third_party/protobuf 2c5fa078d8e86e5f4bd34e6f4c9ea9e8d7d4d44a