From 005d74c84e6ad5b0771a879c3cbb596cfb43c13b Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Fri, 20 Nov 2020 14:41:01 -0500 Subject: [PATCH 01/10] Get CURL working for BAZEL build. - Pull a specific version of CURL as a dep. - Add this version of CURL as a dep to the test of the CURL client. - CURL should not be a dependency in any other way, but may be built if you glob-build. --- BUILD | 0 WORKSPACE | 10 ++ bazel/curl.bzl | 201 +++++++++++++++++++++++++++++++++++++++++ ext/test/http/BUILD | 12 +++ third_party/BUILD | 3 + third_party/curl.BUILD | 37 ++++++++ 6 files changed, 263 insertions(+) create mode 100644 BUILD create mode 100644 bazel/curl.bzl create mode 100644 ext/test/http/BUILD create mode 100644 third_party/BUILD create mode 100644 third_party/curl.BUILD diff --git a/BUILD b/BUILD new file mode 100644 index 0000000000..e69de29bb2 diff --git a/WORKSPACE b/WORKSPACE index ef2c9611be..a4517d2f43 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -102,3 +102,13 @@ http_archive( load("@com_github_jupp0r_prometheus_cpp//bazel:repositories.bzl", "prometheus_cpp_repositories") prometheus_cpp_repositories() + + +# libcurl - An optional dependency we pull in for tests. +http_archive( + name = "curl", + urls = ["https://curl.haxx.se/download/curl-7.73.0.tar.gz"], + strip_prefix = "curl-7.73.0", + #TODO - SHA + build_file = "@//third_party:curl.BUILD", +) \ No newline at end of file diff --git a/bazel/curl.bzl b/bazel/curl.bzl new file mode 100644 index 0000000000..21d99e4583 --- /dev/null +++ b/bazel/curl.bzl @@ -0,0 +1,201 @@ +# Copyright 2020, OpenTelemetry 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. + +# Compiler options for building libcurl. + +BASE_CURL_COPTS = [ + # Disable everything else except HTTP protocol. + "-DHTTP_ONLY=1", + "-DENABLE_IPV6=1", + "-DGETHOSTNAME_TYPE_ARG2=size_t", + "-DGETSERVBYPORT_R_ARGS=6", + "-DGETSERVBYPORT_R_BUFSIZE=4096", + "-DHAVE_ALARM=1", + "-DHAVE_ALLOCA_H=1", + "-DHAVE_ARPA_INET_H=1", + "-DHAVE_ARPA_TFTP_H=1", + "-DHAVE_ASSERT_H=1", + "-DHAVE_BASENAME=1", + "-DHAVE_BOOL_T=1", + "-DHAVE_CLOCK_GETTIME_MONOTONIC=1", + "-DHAVE_CONNECT=1", + "-DHAVE_DLFCN_H=1", + "-DHAVE_ENGINE_LOAD_BUILTIN_ENGINES=1", + "-DHAVE_ERRNO_H=1", + "-DHAVE_FCNTL=1", + "-DHAVE_FCNTL_H=1", + "-DHAVE_FCNTL_O_NONBLOCK=1", + "-DHAVE_FDOPEN=1", + "-DHAVE_FREEADDRINFO=1", + "-DHAVE_FREEIFADDRS=1", + "-DHAVE_FSETXATTR=1", + "-DHAVE_FSETXATTR_5=1", + "-DHAVE_FTRUNCATE=1", + "-DHAVE_GAI_STRERROR=1", + "-DHAVE_GETADDRINFO=1", + "-DHAVE_GETADDRINFO_THREADSAFE=1", + "-DHAVE_GETEUID=1", + "-DHAVE_GETHOSTBYADDR=1", + "-DHAVE_GETHOSTBYADDR_R=1", + "-DHAVE_GETHOSTBYADDR_R_8=1", + "-DHAVE_GETHOSTBYNAME=1", + "-DHAVE_GETHOSTBYNAME_R=1", + "-DHAVE_GETHOSTBYNAME_R_6=1", + "-DHAVE_GETHOSTNAME=1", + "-DHAVE_GETIFADDRS=1", + "-DHAVE_GETNAMEINFO=1", + "-DHAVE_GETPPID=1", + "-DHAVE_GETPWUID=1", + "-DHAVE_GETPWUID_R=1", + "-DHAVE_GETRLIMIT=1", + "-DHAVE_GETSERVBYPORT_R=1", + "-DHAVE_GETTIMEOFDAY=1", + "-DHAVE_GMTIME_R=1", + "-DHAVE_IFADDRS_H=1", + "-DHAVE_IF_NAMETOINDEX=1", + "-DHAVE_INET_NTOP=1", + "-DHAVE_INET_PTON=1", + "-DHAVE_INTTYPES_H=1", + "-DHAVE_IOCTL=1", + "-DHAVE_IOCTL_FIONBIO=1", + "-DHAVE_IOCTL_SIOCGIFADDR=1", + "-DHAVE_LIBGEN_H=1", + "-DHAVE_LL=1", + "-DHAVE_LOCALE_H=1", + "-DHAVE_LOCALTIME_R=1", + "-DHAVE_LONGLONG=1", + "-DHAVE_MALLOC_H=1", + "-DHAVE_MEMORY_H=1", + "-DHAVE_NETDB_H=1", + "-DHAVE_NETINET_IN_H=1", + "-DHAVE_NETINET_TCP_H=1", + "-DHAVE_NET_IF_H=1", + "-DHAVE_PIPE=1", + "-DHAVE_POLL=1", + "-DHAVE_POLL_FINE=1", + "-DHAVE_POLL_H=1", + "-DHAVE_POSIX_STRERROR_R=1", + "-DHAVE_PTHREAD_H=1", + "-DHAVE_PWD_H=1", + "-DHAVE_RECV=1", + "-DHAVE_SELECT=1", + "-DHAVE_SEND=1", + "-DHAVE_SETJMP_H=1", + "-DHAVE_SETLOCALE=1", + "-DHAVE_SETRLIMIT=1", + "-DHAVE_SETSOCKOPT=1", + "-DHAVE_SGTTY_H=1", + "-DHAVE_SIGACTION=1", + "-DHAVE_SIGINTERRUPT=1", + "-DHAVE_SIGNAL=1", + "-DHAVE_SIGNAL_H=1", + "-DHAVE_SIGSETJMP=1", + "-DHAVE_SIG_ATOMIC_T=1", + "-DHAVE_SOCKADDR_IN6_SIN6_SCOPE_ID=1", + "-DHAVE_SOCKET=1", + "-DHAVE_SOCKETPAIR=1", + "-DHAVE_STDBOOL_H=1", + "-DHAVE_STDINT_H=1", + "-DHAVE_STDIO_H=1", + "-DHAVE_STDLIB_H=1", + "-DHAVE_STRCASECMP=1", + "-DHAVE_STRDUP=1", + "-DHAVE_STRERROR_R=1", + "-DHAVE_STRINGS_H=1", + "-DHAVE_STRING_H=1", + "-DHAVE_STRNCASECMP=1", + "-DHAVE_STRSTR=1", + "-DHAVE_STRTOK_R=1", + "-DHAVE_STRTOLL=1", + "-DHAVE_STRUCT_SOCKADDR_STORAGE=1", + "-DHAVE_STRUCT_TIMEVAL=1", + "-DHAVE_SYS_IOCTL_H=1", + "-DHAVE_SYS_PARAM_H=1", + "-DHAVE_SYS_POLL_H=1", + "-DHAVE_SYS_RESOURCE_H=1", + "-DHAVE_SYS_SELECT_H=1", + "-DHAVE_SYS_SOCKET_H=1", + "-DHAVE_SYS_STAT_H=1", + "-DHAVE_SYS_TIME_H=1", + "-DHAVE_SYS_TYPES_H=1", + "-DHAVE_SYS_UIO_H=1", + "-DHAVE_SYS_UN_H=1", + "-DHAVE_SYS_WAIT_H=1", + "-DHAVE_SYS_XATTR_H=1", + "-DHAVE_TERMIOS_H=1", + "-DHAVE_TERMIO_H=1", + "-DHAVE_TIME_H=1", + "-DHAVE_UNISTD_H=1", + "-DHAVE_UTIME=1", + "-DHAVE_UTIMES=1", + "-DHAVE_UTIME_H=1", + "-DHAVE_VARIADIC_MACROS_C99=1", + "-DHAVE_VARIADIC_MACROS_GCC=1", + "-DHAVE_WRITABLE_ARGV=1", + "-DHAVE_WRITEV=1", + "-DRECV_TYPE_ARG1=int", + "-DRECV_TYPE_ARG2=void*", + "-DRECV_TYPE_ARG3=size_t", + "-DRECV_TYPE_ARG4=int", + "-DRECV_TYPE_RETV=ssize_t", + "-DRETSIGTYPE=void", + "-DSELECT_QUAL_ARG5=", + "-DSELECT_TYPE_ARG1=int", + "-DSELECT_TYPE_ARG234=fd_set*", + "-DSELECT_TYPE_RETV=int", + "-DSEND_QUAL_ARG2=const", + "-DSEND_TYPE_ARG1=int", + "-DSEND_TYPE_ARG2=void*", + "-DSEND_TYPE_ARG3=size_t", + "-DSEND_TYPE_ARG4=int", + "-DSEND_TYPE_RETV=ssize_t", + "-DSIZEOF_CURL_OFF_T=8", + "-DSIZEOF_INT=4", + "-DSIZEOF_LONG=8", + "-DSIZEOF_OFF_T=8", + "-DSIZEOF_SHORT=2", + "-DSIZEOF_SIZE_T=8", + "-DSIZEOF_TIME_T=8", + "-DSTDC_HEADERS=1", + "-DSTRERROR_R_TYPE_ARG3=size_t", + "-DTIME_WITH_SYS_TIME=1", + "-DUSE_THREADS_POSIX=1", + "-DUSE_UNIX_SOCKETS=1", + + # Extra defines needed by curl + "-DBUILDING_LIBCURL", + "-DCURL_HIDDEN_SYMBOLS", +] + +LINUX_CURL_COPTS = [ + "-DHAVE_LINUX_TCP_H=1", + "-DHAVE_MSG_NOSIGNAL=1", +] + +CURL_COPTS = select({ + "//:windows": [ + # Disable everything else except HTTP protocol. + "/DHTTP_ONLY=1", + "/DCURL_STATICLIB", + "/DWIN32", + "/DBUILDING_LIBCURL", + "/DUSE_WIN32_IDN", + "/DWANT_IDN_PROTOTYPES", + "/DUSE_IPV6", + "/DUSE_WINDOWS_SSPI", + "/DUSE_SCHANNEL", + ], + "//:osx": BASE_CURL_COPTS, + "//conditions:default": BASE_CURL_COPTS + LINUX_CURL_COPTS, +}) \ No newline at end of file diff --git a/ext/test/http/BUILD b/ext/test/http/BUILD new file mode 100644 index 0000000000..67ea7fde4c --- /dev/null +++ b/ext/test/http/BUILD @@ -0,0 +1,12 @@ +cc_test( + name = "curl_http_test", + srcs = [ + "curl_http_test.cc", + ], + deps = [ + "//ext:headers", + "//sdk/src/trace", + "@curl//:curl", + "@com_google_googletest//:gtest_main", + ], +) \ No newline at end of file diff --git a/third_party/BUILD b/third_party/BUILD new file mode 100644 index 0000000000..34ebc9f0d3 --- /dev/null +++ b/third_party/BUILD @@ -0,0 +1,3 @@ +licenses(["notice"]) # Apache 2.0 + +package(default_visibility = ["//:__subpackages__"]) \ No newline at end of file diff --git a/third_party/curl.BUILD b/third_party/curl.BUILD new file mode 100644 index 0000000000..58c71748d4 --- /dev/null +++ b/third_party/curl.BUILD @@ -0,0 +1,37 @@ +# Builds CURL from a distribution. + +load("@io_opentelemetry_cpp//bazel:curl.bzl", "CURL_COPTS") + +package(features = ["no_copts_tokenization"]) + +config_setting( + name = "windows", + values = {"cpu": "x64_windows"}, + visibility = ["//visibility:private"], +) + +config_setting( + name = "osx", + values = {"cpu": "darwin"}, + visibility = ["//visibility:private"], +) + +cc_library( + name = "curl", + srcs = glob([ + "lib/**/*.c", + ]), + hdrs = glob([ + "include/curl/*.h", + "lib/**/*.h", + ]), + copts = CURL_COPTS + [ + "-DOS=\"os\"", + "-DCURL_EXTERN_SYMBOL=__attribute__((__visibility__(\"default\")))", + ], + includes = [ + "include/", + "lib/", + ], + visibility = ["//visibility:public"], +) \ No newline at end of file From 766ed6a05b2c22b3209fa8500c75df7b0dda68f5 Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Tue, 24 Nov 2020 11:35:24 -0500 Subject: [PATCH 02/10] Fix up formatting. --- WORKSPACE | 4 ++-- bazel/curl.bzl | 2 +- ext/test/http/BUILD | 4 ++-- third_party/BUILD | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index a4517d2f43..ed25d511cc 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -109,6 +109,6 @@ http_archive( name = "curl", urls = ["https://curl.haxx.se/download/curl-7.73.0.tar.gz"], strip_prefix = "curl-7.73.0", - #TODO - SHA + sha256 = "ba98332752257b47b9dea6d8c0ad25ec1745c20424f1dd3ff2c99ab59e97cf91", build_file = "@//third_party:curl.BUILD", -) \ No newline at end of file +) diff --git a/bazel/curl.bzl b/bazel/curl.bzl index 21d99e4583..6a887c50c6 100644 --- a/bazel/curl.bzl +++ b/bazel/curl.bzl @@ -198,4 +198,4 @@ CURL_COPTS = select({ ], "//:osx": BASE_CURL_COPTS, "//conditions:default": BASE_CURL_COPTS + LINUX_CURL_COPTS, -}) \ No newline at end of file +}) diff --git a/ext/test/http/BUILD b/ext/test/http/BUILD index 67ea7fde4c..22f2ab122f 100644 --- a/ext/test/http/BUILD +++ b/ext/test/http/BUILD @@ -6,7 +6,7 @@ cc_test( deps = [ "//ext:headers", "//sdk/src/trace", - "@curl//:curl", "@com_google_googletest//:gtest_main", + "@curl", ], -) \ No newline at end of file +) diff --git a/third_party/BUILD b/third_party/BUILD index 34ebc9f0d3..5587e125c0 100644 --- a/third_party/BUILD +++ b/third_party/BUILD @@ -1,3 +1,3 @@ licenses(["notice"]) # Apache 2.0 -package(default_visibility = ["//:__subpackages__"]) \ No newline at end of file +package(default_visibility = ["//:__subpackages__"]) From ca667d2a26e215c700f515ff25ddcc2461b50726 Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Wed, 25 Nov 2020 00:47:43 +0530 Subject: [PATCH 03/10] fix mem leak in test case --- ext/test/http/curl_http_test.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/test/http/curl_http_test.cc b/ext/test/http/curl_http_test.cc index 1c7245ed47..0aecfa6d47 100644 --- a/ext/test/http/curl_http_test.cc +++ b/ext/test/http/curl_http_test.cc @@ -257,4 +257,5 @@ TEST_F(BasicCurlHttpTests, CurlHttpOperations) curl::HttpOperation http_operations3(http_client::Method::Get, "/get", handler, headers, body, false); http_operations3.Send(); + delete handler; } From 33f77d266bd6cb5a55357045b358b2b64444a4d1 Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Wed, 25 Nov 2020 01:43:44 +0530 Subject: [PATCH 04/10] fix race condition reported by ThreadSanitizer --- ext/include/opentelemetry/ext/http/server/socket_tools.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/include/opentelemetry/ext/http/server/socket_tools.h b/ext/include/opentelemetry/ext/http/server/socket_tools.h index e980b78940..4e381f3ce1 100644 --- a/ext/include/opentelemetry/ext/http/server/socket_tools.h +++ b/ext/include/opentelemetry/ext/http/server/socket_tools.h @@ -96,7 +96,8 @@ struct Thread { std::thread m_thread; - volatile bool m_terminate{false}; + // volatile bool m_terminate{false}; + std::atomic m_terminate{false}; /// /// Thread Constructor From 5f064f1f9d585ca1433572397b7c4f85350281c5 Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Wed, 25 Nov 2020 02:07:07 +0530 Subject: [PATCH 05/10] fix ThreadSanitizer error for curl test case ( using mutex ) --- ext/test/http/curl_http_test.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/test/http/curl_http_test.cc b/ext/test/http/curl_http_test.cc index 0aecfa6d47..39bddda18d 100644 --- a/ext/test/http/curl_http_test.cc +++ b/ext/test/http/curl_http_test.cc @@ -96,6 +96,7 @@ class BasicCurlHttpTests : public ::testing::Test, public HTTP_SERVER_NS::HttpRe { if (request.uri == "/get/") { + std::unique_lock lk(mtx_requests); received_requests_.push_back(request); response.headers["Content-Type"] = "text/plain"; @@ -114,7 +115,7 @@ class BasicCurlHttpTests : public ::testing::Test, public HTTP_SERVER_NS::HttpRe bool waitForRequests(unsigned timeOutSec, unsigned expected_count = 1) { - std::unique_lock lk(cv_m); + std::unique_lock lk(mtx_requests); if (cv_got_events.wait_for(lk, std::chrono::milliseconds(1000 * timeOutSec), [&] { return received_requests_.size() >= expected_count; })) { From 03e7562f329927eaa1d0aa460d4e17929236dc61 Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Tue, 24 Nov 2020 16:17:13 -0500 Subject: [PATCH 06/10] Delete BUILD Remove BUILD file causing issues in cmake --- BUILD | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 BUILD diff --git a/BUILD b/BUILD deleted file mode 100644 index e69de29bb2..0000000000 From 98100deabf837e2053b2d8103d9ade7a1ff73bbd Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Tue, 24 Nov 2020 19:22:31 -0500 Subject: [PATCH 07/10] Fix windows curl test build. - Need to define CURL_STATICLIB for imports - Add missing windows static libraries to link (advapi32, crypt32 and Normaliz) --- ext/test/http/BUILD | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ext/test/http/BUILD b/ext/test/http/BUILD index 22f2ab122f..d723d4e401 100644 --- a/ext/test/http/BUILD +++ b/ext/test/http/BUILD @@ -9,4 +9,17 @@ cc_test( "@com_google_googletest//:gtest_main", "@curl", ], + # TODO: Move copts/linkopts for static CURL usage into shared bzl file. + copts = [ + "-DCURL_STATICLIB", + ], + linkopts = select({ + "//:windows": [ + "-DEFAULTLIB:advapi32.lib", + "-DEFAULTLIB:crypt32.lib", + "-DEFAULTLIB:Normaliz.lib", + ], + "//conditions:default": [], + }), + ) From eb5d1da6a25c39736d377e9b74103ec43515f1f5 Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Tue, 24 Nov 2020 19:32:06 -0500 Subject: [PATCH 08/10] Fix unsubmitted build change --- ext/test/http/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/test/http/BUILD b/ext/test/http/BUILD index d723d4e401..6668645cc0 100644 --- a/ext/test/http/BUILD +++ b/ext/test/http/BUILD @@ -14,7 +14,7 @@ cc_test( "-DCURL_STATICLIB", ], linkopts = select({ - "//:windows": [ + "//bazel:windows": [ "-DEFAULTLIB:advapi32.lib", "-DEFAULTLIB:crypt32.lib", "-DEFAULTLIB:Normaliz.lib", From c611b6bacbfb512748621c7faf4639c4747e8466 Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Wed, 25 Nov 2020 21:37:23 +0530 Subject: [PATCH 09/10] fix http timeout test for Darwin --- ext/test/http/curl_http_test.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ext/test/http/curl_http_test.cc b/ext/test/http/curl_http_test.cc index 39bddda18d..70ec4b414e 100644 --- a/ext/test/http/curl_http_test.cc +++ b/ext/test/http/curl_http_test.cc @@ -143,8 +143,8 @@ TEST_F(BasicCurlHttpTests, HttpRequest) req.ReplaceHeader("name1", "value3"); ASSERT_EQ(req.headers_.find("name1")->second, "value3"); - req.SetTimeoutMs(std::chrono::duration(5000)); - ASSERT_EQ(req.timeout_ms_, std::chrono::duration(5000)); + req.SetTimeoutMs(std::chrono::duration(2000)); + ASSERT_EQ(req.timeout_ms_, std::chrono::duration(2000)); } TEST_F(BasicCurlHttpTests, HttpResponse) @@ -227,13 +227,14 @@ TEST_F(BasicCurlHttpTests, RequestTimeout) received_requests_.clear(); curl::SessionManager session_manager; - auto session = session_manager.CreateSession("127.0.0.10", HTTP_PORT); // Non Existing address + auto session = + session_manager.CreateSession("222.222.222.200", HTTP_PORT); // Non Existing address auto request = session->CreateRequest(); request->SetUri("get/"); GetEventHandler *handler = new GetEventHandler(); session->SendRequest(*handler); session->FinishSession(); - ASSERT_TRUE(handler->is_called_); + ASSERT_FALSE(handler->is_called_); delete handler; } From f4103139b6cb4a75a94b58cec88edba92e2fd4b5 Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Thu, 26 Nov 2020 19:23:43 +0530 Subject: [PATCH 10/10] fix format --- WORKSPACE | 11 +++++------ ext/test/http/BUILD | 25 ++++++++++++------------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index ed25d511cc..f75d069d3c 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -103,12 +103,11 @@ load("@com_github_jupp0r_prometheus_cpp//bazel:repositories.bzl", "prometheus_cp prometheus_cpp_repositories() - # libcurl - An optional dependency we pull in for tests. http_archive( - name = "curl", - urls = ["https://curl.haxx.se/download/curl-7.73.0.tar.gz"], - strip_prefix = "curl-7.73.0", - sha256 = "ba98332752257b47b9dea6d8c0ad25ec1745c20424f1dd3ff2c99ab59e97cf91", - build_file = "@//third_party:curl.BUILD", + name = "curl", + build_file = "@//third_party:curl.BUILD", + sha256 = "ba98332752257b47b9dea6d8c0ad25ec1745c20424f1dd3ff2c99ab59e97cf91", + strip_prefix = "curl-7.73.0", + urls = ["https://curl.haxx.se/download/curl-7.73.0.tar.gz"], ) diff --git a/ext/test/http/BUILD b/ext/test/http/BUILD index 6668645cc0..678b2e5da7 100644 --- a/ext/test/http/BUILD +++ b/ext/test/http/BUILD @@ -3,23 +3,22 @@ cc_test( srcs = [ "curl_http_test.cc", ], - deps = [ - "//ext:headers", - "//sdk/src/trace", - "@com_google_googletest//:gtest_main", - "@curl", - ], # TODO: Move copts/linkopts for static CURL usage into shared bzl file. copts = [ "-DCURL_STATICLIB", ], linkopts = select({ - "//bazel:windows": [ - "-DEFAULTLIB:advapi32.lib", - "-DEFAULTLIB:crypt32.lib", - "-DEFAULTLIB:Normaliz.lib", - ], - "//conditions:default": [], + "//bazel:windows": [ + "-DEFAULTLIB:advapi32.lib", + "-DEFAULTLIB:crypt32.lib", + "-DEFAULTLIB:Normaliz.lib", + ], + "//conditions:default": [], }), - + deps = [ + "//ext:headers", + "//sdk/src/trace", + "@com_google_googletest//:gtest_main", + "@curl", + ], )