From 3401b5898b61401a5999d86ef829ee7cb49af224 Mon Sep 17 00:00:00 2001 From: Gorm Galster Date: Fri, 24 Sep 2021 13:38:16 +0200 Subject: [PATCH] Bump version of stout-eventuals, fix local build Update stout-eventuals in light of recent changes, in particular the inclusion of Post and Get that relies on curl. The inclusion of curl introduces two new repo dependencies included in this commit. As outlined in issue #17, building `:grpc` locally using `gcc` is currently broken by `.bazelrc`. This commit works around it by removing the offending compiler flags, allowing the library to be built locally. This fixes local compilation but it does not fix the issue: we want those compiler flags in there where possible, i.e., for `clang`. --- .bazelrc | 2 +- 3rdparty/bazel-rules-curl/BUILD.bazel | 0 3rdparty/bazel-rules-curl/repos.bzl | 39 ++++++++++++++++++++++++ 3rdparty/bazel-rules-openssl/BUILD.bazel | 0 3rdparty/bazel-rules-openssl/repos.bzl | 34 +++++++++++++++++++++ 3rdparty/stout-eventuals/repos.bzl | 15 ++++++--- 6 files changed, 85 insertions(+), 5 deletions(-) create mode 100644 3rdparty/bazel-rules-curl/BUILD.bazel create mode 100644 3rdparty/bazel-rules-curl/repos.bzl create mode 100644 3rdparty/bazel-rules-openssl/BUILD.bazel create mode 100644 3rdparty/bazel-rules-openssl/repos.bzl diff --git a/.bazelrc b/.bazelrc index 5ae494e..2ff5b17 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,5 +1,5 @@ # Specific Bazel build/test options. +#build --cxxopt='-Werror=thread-safety-analysis' --cxxopt='-Werror=thread-safety-reference' build --cxxopt='-std=c++17' -build --cxxopt='-Werror=thread-safety-analysis' --cxxopt='-Werror=thread-safety-reference' test --cxxopt='-fstandalone-debug' -c dbg --strip='never' diff --git a/3rdparty/bazel-rules-curl/BUILD.bazel b/3rdparty/bazel-rules-curl/BUILD.bazel new file mode 100644 index 0000000..e69de29 diff --git a/3rdparty/bazel-rules-curl/repos.bzl b/3rdparty/bazel-rules-curl/repos.bzl new file mode 100644 index 0000000..b3fb786 --- /dev/null +++ b/3rdparty/bazel-rules-curl/repos.bzl @@ -0,0 +1,39 @@ +"""Adds repostories/archives.""" + +######################################################################## +# DO NOT EDIT THIS FILE unless you are inside the +# https://github.com/3rdparty/bazel-rules-curl repository. If you +# encounter it anywhere else it is because it has been copied there in +# order to simplify adding transitive dependencies. If you want a +# different version of bazel-rules-curl follow the Bazel build +# instructions at https://github.com/3rdparty/bazel-rules-curl. +######################################################################## + +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") +load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") +load("//3rdparty/bazel-rules-openssl:repos.bzl", openssl_repos="repos") + +def repos(external = True, repo_mapping = {}): + maybe( + http_archive, + name = "rules_foreign_cc", + url = "https://github.com/bazelbuild/rules_foreign_cc/archive/0.5.1.tar.gz", + sha256 = "33a5690733c5cc2ede39cb62ebf89e751f2448e27f20c8b2fbbc7d136b166804", + strip_prefix = "rules_foreign_cc-0.5.1", + repo_mapping = repo_mapping, + ) + + openssl_repos( + repo_mapping = repo_mapping, + ) + + if external: + maybe( + git_repository, + name = "com_github_3rdparty_bazel_rules_curl", + remote = "https://github.com/3rdparty/bazel-rules-curl", + commit = "589c72943a70eb7a0ee123969015f1a6deacf316", + shallow_since = "1632331010 +0300", + repo_mapping = repo_mapping, + ) \ No newline at end of file diff --git a/3rdparty/bazel-rules-openssl/BUILD.bazel b/3rdparty/bazel-rules-openssl/BUILD.bazel new file mode 100644 index 0000000..e69de29 diff --git a/3rdparty/bazel-rules-openssl/repos.bzl b/3rdparty/bazel-rules-openssl/repos.bzl new file mode 100644 index 0000000..9e488e2 --- /dev/null +++ b/3rdparty/bazel-rules-openssl/repos.bzl @@ -0,0 +1,34 @@ +"""Adds repostories/archives.""" + +######################################################################## +# DO NOT EDIT THIS FILE unless you are inside the +# https://github.com/3rdparty/bazel-rules-openssl repository. If you +# encounter it anywhere else it is because it has been copied there in +# order to simplify adding transitive dependencies. If you want a +# different version of bazel-rules-openssl follow the Bazel build +# instructions at https://github.com/3rdparty/bazel-rules-openssl. +######################################################################## + +load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") + +def repos(external = True, repo_mapping = {}): + maybe( + http_archive, + name = "rules_foreign_cc", + url = "https://github.com/bazelbuild/rules_foreign_cc/archive/0.5.1.tar.gz", + sha256 = "33a5690733c5cc2ede39cb62ebf89e751f2448e27f20c8b2fbbc7d136b166804", + strip_prefix = "rules_foreign_cc-0.5.1", + repo_mapping = repo_mapping, + ) + + if external: + maybe( + git_repository, + name = "com_github_3rdparty_bazel_rules_openssl", + remote = "https://github.com/3rdparty/bazel-rules-openssl", + commit = "fd41d1a19c75dd82979c76fc0b2aadd6c4393e89", + shallow_since = "1632212203 +0000", + repo_mapping = repo_mapping, + ) \ No newline at end of file diff --git a/3rdparty/stout-eventuals/repos.bzl b/3rdparty/stout-eventuals/repos.bzl index dba0f22..73d9c48 100644 --- a/3rdparty/stout-eventuals/repos.bzl +++ b/3rdparty/stout-eventuals/repos.bzl @@ -10,7 +10,9 @@ ######################################################################## load("//3rdparty/bazel-rules-libuv:repos.bzl", libuv_repos="repos") +load("//3rdparty/bazel-rules-curl:repos.bzl", curl_repos="repos") +load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") def repos(external = True, repo_mapping = {}): @@ -18,11 +20,16 @@ def repos(external = True, repo_mapping = {}): repo_mapping = repo_mapping ) - if external and "com_github_3rdparty_stout_eventuals" not in native.existing_rules(): - git_repository( + curl_repos( + repo_mapping = repo_mapping + ) + + if external: + maybe( + git_repository, name = "com_github_3rdparty_stout_eventuals", remote = "https://github.com/3rdparty/stout-eventuals", - commit = "b94a9ddd99f6775916a779ad36a2331f8eb11868", - shallow_since = "1629460595 +0200", + commit = "fbfb1a8061b198b6393cae284d6930cf92518168", + shallow_since = "1632389695 +0300", repo_mapping = repo_mapping, )