From 7416f4aecf895996b14bee34a167688c463d3ddd Mon Sep 17 00:00:00 2001 From: Neil Conway Date: Sat, 21 Dec 2024 18:59:35 +0000 Subject: [PATCH 01/13] Enable building with Bazel 8 Recent versions of abseil strongly encourage using Bazel modules. Therefore, switch some dependencies over to using modules as well, but leave a few using the old WORKSPACE syntax for now. To enable this, we rename WORKSPACE to WORKSPACE.bzlmod (Bazel calls this "hybrid mode"). This also involves upgrading the versions of several of our dependencies, notably protobuf and abseil. It would be nice to defer doing this for now, but some initial investigation suggested that this would be quite difficult due to the web of dependencies. --- .bazeliskrc | 2 +- .bazelrc | 7 ++++--- BUILD.bazel | 5 +++-- MODULE.bazel | 19 +++++++++++++++++++ WORKSPACE.bazel => WORKSPACE.bzlmod | 0 bazel/deps.bzl | 6 ------ bazel/repos.bzl | 29 ----------------------------- include/stout/flags/v1/BUILD.bazel | 4 ++-- tests/flags/BUILD.bazel | 6 ++++-- 9 files changed, 33 insertions(+), 45 deletions(-) create mode 100644 MODULE.bazel rename WORKSPACE.bazel => WORKSPACE.bzlmod (100%) diff --git a/.bazeliskrc b/.bazeliskrc index bd4a535..e0d5ba7 100644 --- a/.bazeliskrc +++ b/.bazeliskrc @@ -1 +1 @@ -USE_BAZEL_VERSION=5.4.1 +USE_BAZEL_VERSION=8.0.0 diff --git a/.bazelrc b/.bazelrc index a0ddfd7..0415e82 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,9 +1,10 @@ -# Specific Bazel build/test options. +# Enable both `MODULE.bazel` and `WORKSPACE.bzlmod`, not `WORKSPACE`. +common --enable_bzlmod +common --enable_workspace +# Specific Bazel build/test options. build:macos --cxxopt='-std=c++17' - build:linux --cxxopt='-std=c++17' - build:windows --cxxopt="/std:c++17" build --enable_platform_specific_config diff --git a/BUILD.bazel b/BUILD.bazel index 2e84638..ba613a2 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -46,9 +46,10 @@ cc_library( visibility = ["//visibility:public"], deps = [ "//include/stout/flags/v1:flag", + "@abseil-cpp//absl/strings", + "@abseil-cpp//absl/time", "@com_github_google_glog//:glog", - "@com_google_absl//absl/strings", - "@com_google_absl//absl/time", + "@com_google_protobuf//:duration_cc_proto", ], ) diff --git a/MODULE.bazel b/MODULE.bazel new file mode 100644 index 0000000..5a423e4 --- /dev/null +++ b/MODULE.bazel @@ -0,0 +1,19 @@ +bazel_dep(name = "abseil-cpp", version = "20240722.0.bcr.2") +bazel_dep(name = "rules_cc", version = "0.0.17") +bazel_dep(name = "protobuf", version = "29.2", repo_name = "com_google_protobuf") + +bazel_dep(name = "rules_boost", repo_name = "com_github_nelhage_rules_boost") +archive_override( + module_name = "rules_boost", + urls = [ + "https://github.com/nelhage/rules_boost/archive/e3adfd8d6733c914d2b91a65fb7175af09602281.tar.gz", + ], + strip_prefix = "rules_boost-e3adfd8d6733c914d2b91a65fb7175af09602281", + integrity = "sha256-ZLcmvYKc2FqgLvR96ApPXxp8+sXKqhBlCK66PY/uFIo=", +) + +non_module_boost_repositories = use_extension("@com_github_nelhage_rules_boost//:boost/repositories.bzl", "non_module_dependencies") +use_repo( + non_module_boost_repositories, + "boost", +) diff --git a/WORKSPACE.bazel b/WORKSPACE.bzlmod similarity index 100% rename from WORKSPACE.bazel rename to WORKSPACE.bzlmod diff --git a/bazel/deps.bzl b/bazel/deps.bzl index c1f1680..795e1a5 100644 --- a/bazel/deps.bzl +++ b/bazel/deps.bzl @@ -2,8 +2,6 @@ load("@com_github_3rdparty_bazel_rules_picojson//bazel:deps.bzl", picojson_deps = "deps") load("@com_github_3rdparty_bazel_rules_rapidjson//bazel:deps.bzl", rapidjson_deps = "deps") -load("@com_github_nelhage_rules_boost//:boost/boost.bzl", "boost_deps") -load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") def deps(repo_mapping = {}): """Propagate all dependencies. @@ -11,8 +9,6 @@ def deps(repo_mapping = {}): Args: repo_mapping (str): {}. """ - boost_deps() - picojson_deps( repo_mapping = repo_mapping, ) @@ -20,5 +16,3 @@ def deps(repo_mapping = {}): rapidjson_deps( repo_mapping = repo_mapping, ) - - protobuf_deps() diff --git a/bazel/repos.bzl b/bazel/repos.bzl index cee9262..fc96c08 100644 --- a/bazel/repos.bzl +++ b/bazel/repos.bzl @@ -32,23 +32,6 @@ def repos(external = True, repo_mapping = {}): repo_mapping = repo_mapping, ) - maybe( - http_archive, - name = "com_google_absl", - urls = ["https://github.com/abseil/abseil-cpp/archive/refs/tags/20211102.0.tar.gz"], - strip_prefix = "abseil-cpp-20211102.0", - sha256 = "dcf71b9cba8dc0ca9940c4b316a0c796be8fab42b070bb6b7cab62b48f0e66c4", - repo_mapping = repo_mapping, - ) - - maybe( - git_repository, - name = "com_github_nelhage_rules_boost", - commit = "494ddf5db56580eb019479965fa2908ce6548385", - remote = "https://github.com/nelhage/rules_boost", - shallow_since = "1675669198 -0800", - ) - maybe( http_archive, name = "com_github_gflags_gflags", @@ -73,18 +56,6 @@ def repos(external = True, repo_mapping = {}): strip_prefix = "glog-0.5.0", ) - maybe( - http_archive, - name = "com_google_protobuf", - strip_prefix = "protobuf-3.19.1", - urls = [ - "https://mirror.bazel.build/github.com/protocolbuffers/protobuf/archive/v3.19.1.tar.gz", - "https://github.com/protocolbuffers/protobuf/archive/v3.19.1.tar.gz", - ], - sha256 = "87407cd28e7a9c95d9f61a098a53cf031109d451a7763e7dd1253abf8b4df422", - repo_mapping = repo_mapping, - ) - # Copied and then modified to use the latest 'commit' and 'shallow_since' # rather than tracking the 'master' branch from: # https://github.com/fmtlib/fmt/tree/master/support/bazel diff --git a/include/stout/flags/v1/BUILD.bazel b/include/stout/flags/v1/BUILD.bazel index 527dcd2..5fd61d9 100644 --- a/include/stout/flags/v1/BUILD.bazel +++ b/include/stout/flags/v1/BUILD.bazel @@ -1,5 +1,5 @@ -load("@rules_cc//cc:defs.bzl", "cc_proto_library") -load("@rules_proto//proto:defs.bzl", "proto_library") +load("@com_google_protobuf//bazel:cc_proto_library.bzl", "cc_proto_library") +load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library") proto_library( name = "flag_proto", diff --git a/tests/flags/BUILD.bazel b/tests/flags/BUILD.bazel index 71a100e..05ee412 100644 --- a/tests/flags/BUILD.bazel +++ b/tests/flags/BUILD.bazel @@ -1,5 +1,6 @@ -load("@rules_cc//cc:defs.bzl", "cc_proto_library", "cc_test") -load("@rules_proto//proto:defs.bzl", "proto_library") +load("@rules_cc//cc:defs.bzl", "cc_test") +load("@com_google_protobuf//bazel:cc_proto_library.bzl", "cc_proto_library") +load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library") proto_library( name = "test_proto", @@ -44,6 +45,7 @@ cc_test( deps = [ ":test_proto_library", "//:flags", + "@com_google_protobuf//:time_util", "@gtest//:gtest_main", ], ) From fb743505abbbab20268e0f693ef501e67071e8f1 Mon Sep 17 00:00:00 2001 From: Neil Conway Date: Sun, 22 Dec 2024 02:13:54 +0000 Subject: [PATCH 02/13] Ensure compatibility with recent Protobuf --- include/stout/flags/flags.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/stout/flags/flags.cc b/include/stout/flags/flags.cc index 843dba9..4ac28dc 100644 --- a/include/stout/flags/flags.cc +++ b/include/stout/flags/flags.cc @@ -678,19 +678,19 @@ void Parser::SetFieldMessageOrAggregateErrors( // error for us to print out later. struct ErrorCollector : public google::protobuf::io::ErrorCollector { // TODO(artur): include also 'line' and 'column' for easier debugging. - void AddError( + void RecordError( int /* line */, - int /* column */, - const std::string& message) override { + google::protobuf::io::ColumnNumber /* column */, + absl::string_view message) override { error += message; } - void AddWarning( + void RecordWarning( int line, - int column, - const std::string& message) override { + google::protobuf::io::ColumnNumber column, + absl::string_view message) override { // For now we treat all warnings as errors. - AddError(line, column, message); + RecordError(line, column, message); } std::string error; From 8051bd7ba43879920f8a46dd0e657f26a18a5df5 Mon Sep 17 00:00:00 2001 From: Neil Conway Date: Sun, 22 Dec 2024 10:47:33 -0500 Subject: [PATCH 03/13] Fix the build on macOS `std::filesystem::path` is only available on macOS >= 10.15. --- .bazelrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bazelrc b/.bazelrc index 0415e82..7d76b03 100644 --- a/.bazelrc +++ b/.bazelrc @@ -3,7 +3,7 @@ common --enable_bzlmod common --enable_workspace # Specific Bazel build/test options. -build:macos --cxxopt='-std=c++17' +build:macos --cxxopt='-std=c++17' --macos_minimum_os=10.15 build:linux --cxxopt='-std=c++17' build:windows --cxxopt="/std:c++17" From 40af1d296a665447495b9a471d0c586c2155700a Mon Sep 17 00:00:00 2001 From: Neil Conway Date: Sun, 22 Dec 2024 15:58:38 +0000 Subject: [PATCH 04/13] Update example Bazel commands --- include/stout/flags/v1/BUILD.bazel | 2 +- tests/flags/BUILD.bazel | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/stout/flags/v1/BUILD.bazel b/include/stout/flags/v1/BUILD.bazel index 5fd61d9..9cbff04 100644 --- a/include/stout/flags/v1/BUILD.bazel +++ b/include/stout/flags/v1/BUILD.bazel @@ -14,7 +14,7 @@ proto_library( # proto_library rules of the source files importing them. # A list of all @com_google_protobuf well known protos can # seen with: - # `bazel query 'kind(proto_library, @com_google_protobuf//:all)'` + # `bazel query 'kind(.*, @com_google_protobuf//:all)'` "@com_google_protobuf//:descriptor_proto", ], ) diff --git a/tests/flags/BUILD.bazel b/tests/flags/BUILD.bazel index 05ee412..1fca25f 100644 --- a/tests/flags/BUILD.bazel +++ b/tests/flags/BUILD.bazel @@ -16,7 +16,7 @@ proto_library( # proto_library rules of the source files importing them. # A list of all @com_google_protobuf well known protos can # seen with: - # `bazel query 'kind(proto_library, @com_google_protobuf//:all)'` + # `bazel query 'kind(.*, @com_google_protobuf//:all)'` "@com_google_protobuf//:duration_proto", "//include/stout/flags/v1:flag_proto", ], From cdcdbb72428c846aa0e0158afbb7cd7d9cae244d Mon Sep 17 00:00:00 2001 From: Neil Conway Date: Sun, 22 Dec 2024 17:41:21 +0000 Subject: [PATCH 05/13] Use module-style declaration of module name --- MODULE.bazel | 2 ++ WORKSPACE.bzlmod | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index 5a423e4..0a5a538 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,3 +1,5 @@ +module(name = "stout", version = "0.1") + bazel_dep(name = "abseil-cpp", version = "20240722.0.bcr.2") bazel_dep(name = "rules_cc", version = "0.0.17") bazel_dep(name = "protobuf", version = "29.2", repo_name = "com_google_protobuf") diff --git a/WORKSPACE.bzlmod b/WORKSPACE.bzlmod index a14d0a6..7cbe729 100644 --- a/WORKSPACE.bzlmod +++ b/WORKSPACE.bzlmod @@ -1,5 +1,3 @@ -workspace(name = "stout") - load("//bazel:repos.bzl", "repos") repos(external = False) From 271adb8e5a9702aa1d2377961ab5c6b14f335dcc Mon Sep 17 00:00:00 2001 From: Neil Conway Date: Sun, 22 Dec 2024 18:13:51 +0000 Subject: [PATCH 06/13] Move to BCR for boost dependency Not every Boost library we need is available on BCR yet (e.g., ICL), but this seems to be good enough for now. --- BUILD.bazel | 9 ++++----- MODULE.bazel | 25 +++++++++---------------- 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index ba613a2..3b60939 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -90,11 +90,10 @@ cc_library( "//:flags", "//:notification", "//:stateful-tally", - "@boost//:functional", - "@boost//:get_pointer", - "@boost//:lexical_cast", - "@boost//:uuid", - "@boost//:variant", + "@boost.functional//:boost.functional", + "@boost.lexical_cast//:boost.lexical_cast", + "@boost.uuid//:boost.uuid", + "@boost.variant//:boost.variant", "@com_github_fmtlib_fmt//:fmt", "@com_github_google_glog//:glog", "@com_github_kazuho_picojson//:picojson", diff --git a/MODULE.bazel b/MODULE.bazel index 0a5a538..b67c564 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,21 +1,14 @@ module(name = "stout", version = "0.1") bazel_dep(name = "abseil-cpp", version = "20240722.0.bcr.2") -bazel_dep(name = "rules_cc", version = "0.0.17") bazel_dep(name = "protobuf", version = "29.2", repo_name = "com_google_protobuf") +bazel_dep(name = "rules_cc", version = "0.0.17") -bazel_dep(name = "rules_boost", repo_name = "com_github_nelhage_rules_boost") -archive_override( - module_name = "rules_boost", - urls = [ - "https://github.com/nelhage/rules_boost/archive/e3adfd8d6733c914d2b91a65fb7175af09602281.tar.gz", - ], - strip_prefix = "rules_boost-e3adfd8d6733c914d2b91a65fb7175af09602281", - integrity = "sha256-ZLcmvYKc2FqgLvR96ApPXxp8+sXKqhBlCK66PY/uFIo=", -) - -non_module_boost_repositories = use_extension("@com_github_nelhage_rules_boost//:boost/repositories.bzl", "non_module_dependencies") -use_repo( - non_module_boost_repositories, - "boost", -) +# TODO: We also depend on Boost ICL but that is not packaged for BCR yet. +bazel_dep(name = "boost.circular_buffer", version = "1.83.0.bcr.1") +bazel_dep(name = "boost.functional", version = "1.83.0.bcr.1") +bazel_dep(name = "boost.lexical_cast", version = "1.83.0.bcr.1") +bazel_dep(name = "boost.ptr_container", version = "1.83.0.bcr.1") +bazel_dep(name = "boost.range", version = "1.83.0.bcr.1") +bazel_dep(name = "boost.uuid", version = "1.83.0.bcr.1") +bazel_dep(name = "boost.variant", version = "1.83.0.bcr.1") From 13b244bc5838604fce62af186a91681aa6ca5f48 Mon Sep 17 00:00:00 2001 From: Neil Conway Date: Sun, 22 Dec 2024 23:16:11 +0000 Subject: [PATCH 07/13] Move to Bazel 7.4.1 --- .bazeliskrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bazeliskrc b/.bazeliskrc index e0d5ba7..cc6e62a 100644 --- a/.bazeliskrc +++ b/.bazeliskrc @@ -1 +1 @@ -USE_BAZEL_VERSION=8.0.0 +USE_BAZEL_VERSION=7.4.1 From e3314fe22884a28bf3ce7d14e4fd0ebb7c046a9e Mon Sep 17 00:00:00 2001 From: Neil Conway Date: Mon, 23 Dec 2024 15:15:10 +0000 Subject: [PATCH 08/13] Revert "Move to Bazel 7.4.1" This reverts commit 13b244bc5838604fce62af186a91681aa6ca5f48. --- .bazeliskrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bazeliskrc b/.bazeliskrc index cc6e62a..e0d5ba7 100644 --- a/.bazeliskrc +++ b/.bazeliskrc @@ -1 +1 @@ -USE_BAZEL_VERSION=7.4.1 +USE_BAZEL_VERSION=8.0.0 From ba0fb22a98f10d0ecb8741b7f207be94f7bdc688 Mon Sep 17 00:00:00 2001 From: Neil Conway Date: Mon, 23 Dec 2024 15:43:48 +0000 Subject: [PATCH 09/13] Upgrade rules_cc dependency --- MODULE.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MODULE.bazel b/MODULE.bazel index b67c564..74da336 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -2,7 +2,7 @@ module(name = "stout", version = "0.1") bazel_dep(name = "abseil-cpp", version = "20240722.0.bcr.2") bazel_dep(name = "protobuf", version = "29.2", repo_name = "com_google_protobuf") -bazel_dep(name = "rules_cc", version = "0.0.17") +bazel_dep(name = "rules_cc", version = "0.1.0") # TODO: We also depend on Boost ICL but that is not packaged for BCR yet. bazel_dep(name = "boost.circular_buffer", version = "1.83.0.bcr.1") From f79d7a98807bcf05789ad827e3bfd4343e278c8b Mon Sep 17 00:00:00 2001 From: Neil Conway Date: Mon, 23 Dec 2024 15:47:23 +0000 Subject: [PATCH 10/13] Ignore MODULE.bazel.lock files There seems to be some debate about whether to add these files to git or ignore them (e.g., [1]). For now, let's ignore them. [1] https://github.com/bazel-contrib/rules_cuda/issues/223 --- .bazeliskrc | 2 +- .gitignore | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.bazeliskrc b/.bazeliskrc index e0d5ba7..cc6e62a 100644 --- a/.bazeliskrc +++ b/.bazeliskrc @@ -1 +1 @@ -USE_BAZEL_VERSION=8.0.0 +USE_BAZEL_VERSION=7.4.1 diff --git a/.gitignore b/.gitignore index 47760a1..831d332 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .vs .vscode bazel-* +MODULE.bazel.lock From 83b81bb635b2a2b47b7933463a9b792d3b6ccb81 Mon Sep 17 00:00:00 2001 From: Neil Conway Date: Tue, 24 Dec 2024 20:15:27 +0000 Subject: [PATCH 11/13] Add an empty WORKSPACE file This appears to be necessary to workaround a bug or odd behavior in recent versions of Bazel: in eventuals, submodules/stout was considered to be part of the eventuals repo (despite being declared as a local_repository) because of the renaming of WORKSPACE.bazel to WORKSPACE.bzlmod. For the time being, re-add an empty WORKSPACE file. --- .bazeliskrc | 2 +- WORKSPACE | 0 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 WORKSPACE diff --git a/.bazeliskrc b/.bazeliskrc index cc6e62a..e0d5ba7 100644 --- a/.bazeliskrc +++ b/.bazeliskrc @@ -1 +1 @@ -USE_BAZEL_VERSION=7.4.1 +USE_BAZEL_VERSION=8.0.0 diff --git a/WORKSPACE b/WORKSPACE new file mode 100644 index 0000000..e69de29 From 62d20b2acfed70e1461c9cbcd5a2c87e1bb9821c Mon Sep 17 00:00:00 2001 From: Neil Conway Date: Tue, 24 Dec 2024 20:39:25 +0000 Subject: [PATCH 12/13] Revert "Move to BCR for boost dependency" This reverts commit 271adb8e5a9702aa1d2377961ab5c6b14f335dcc. --- BUILD.bazel | 9 +++++---- MODULE.bazel | 23 +++++++++++++++-------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index 3b60939..ba613a2 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -90,10 +90,11 @@ cc_library( "//:flags", "//:notification", "//:stateful-tally", - "@boost.functional//:boost.functional", - "@boost.lexical_cast//:boost.lexical_cast", - "@boost.uuid//:boost.uuid", - "@boost.variant//:boost.variant", + "@boost//:functional", + "@boost//:get_pointer", + "@boost//:lexical_cast", + "@boost//:uuid", + "@boost//:variant", "@com_github_fmtlib_fmt//:fmt", "@com_github_google_glog//:glog", "@com_github_kazuho_picojson//:picojson", diff --git a/MODULE.bazel b/MODULE.bazel index 74da336..bee5541 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -4,11 +4,18 @@ bazel_dep(name = "abseil-cpp", version = "20240722.0.bcr.2") bazel_dep(name = "protobuf", version = "29.2", repo_name = "com_google_protobuf") bazel_dep(name = "rules_cc", version = "0.1.0") -# TODO: We also depend on Boost ICL but that is not packaged for BCR yet. -bazel_dep(name = "boost.circular_buffer", version = "1.83.0.bcr.1") -bazel_dep(name = "boost.functional", version = "1.83.0.bcr.1") -bazel_dep(name = "boost.lexical_cast", version = "1.83.0.bcr.1") -bazel_dep(name = "boost.ptr_container", version = "1.83.0.bcr.1") -bazel_dep(name = "boost.range", version = "1.83.0.bcr.1") -bazel_dep(name = "boost.uuid", version = "1.83.0.bcr.1") -bazel_dep(name = "boost.variant", version = "1.83.0.bcr.1") +bazel_dep(name = "rules_boost", repo_name = "com_github_nelhage_rules_boost") +archive_override( + module_name = "rules_boost", + urls = [ + "https://github.com/nelhage/rules_boost/archive/e3adfd8d6733c914d2b91a65fb7175af09602281.tar.gz", + ], + strip_prefix = "rules_boost-e3adfd8d6733c914d2b91a65fb7175af09602281", + integrity = "sha256-ZLcmvYKc2FqgLvR96ApPXxp8+sXKqhBlCK66PY/uFIo=", +) + +non_module_boost_repositories = use_extension("@com_github_nelhage_rules_boost//:boost/repositories.bzl", "non_module_dependencies") +use_repo( + non_module_boost_repositories, + "boost", +) From 05f9c21333551dca7327a9d5d61c853cb40c0d25 Mon Sep 17 00:00:00 2001 From: Neil Conway Date: Tue, 24 Dec 2024 21:41:30 +0000 Subject: [PATCH 13/13] Revert "Revert "Move to BCR for boost dependency"" This reverts commit 62d20b2acfed70e1461c9cbcd5a2c87e1bb9821c. --- BUILD.bazel | 9 ++++----- MODULE.bazel | 23 ++++++++--------------- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index ba613a2..3b60939 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -90,11 +90,10 @@ cc_library( "//:flags", "//:notification", "//:stateful-tally", - "@boost//:functional", - "@boost//:get_pointer", - "@boost//:lexical_cast", - "@boost//:uuid", - "@boost//:variant", + "@boost.functional//:boost.functional", + "@boost.lexical_cast//:boost.lexical_cast", + "@boost.uuid//:boost.uuid", + "@boost.variant//:boost.variant", "@com_github_fmtlib_fmt//:fmt", "@com_github_google_glog//:glog", "@com_github_kazuho_picojson//:picojson", diff --git a/MODULE.bazel b/MODULE.bazel index bee5541..74da336 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -4,18 +4,11 @@ bazel_dep(name = "abseil-cpp", version = "20240722.0.bcr.2") bazel_dep(name = "protobuf", version = "29.2", repo_name = "com_google_protobuf") bazel_dep(name = "rules_cc", version = "0.1.0") -bazel_dep(name = "rules_boost", repo_name = "com_github_nelhage_rules_boost") -archive_override( - module_name = "rules_boost", - urls = [ - "https://github.com/nelhage/rules_boost/archive/e3adfd8d6733c914d2b91a65fb7175af09602281.tar.gz", - ], - strip_prefix = "rules_boost-e3adfd8d6733c914d2b91a65fb7175af09602281", - integrity = "sha256-ZLcmvYKc2FqgLvR96ApPXxp8+sXKqhBlCK66PY/uFIo=", -) - -non_module_boost_repositories = use_extension("@com_github_nelhage_rules_boost//:boost/repositories.bzl", "non_module_dependencies") -use_repo( - non_module_boost_repositories, - "boost", -) +# TODO: We also depend on Boost ICL but that is not packaged for BCR yet. +bazel_dep(name = "boost.circular_buffer", version = "1.83.0.bcr.1") +bazel_dep(name = "boost.functional", version = "1.83.0.bcr.1") +bazel_dep(name = "boost.lexical_cast", version = "1.83.0.bcr.1") +bazel_dep(name = "boost.ptr_container", version = "1.83.0.bcr.1") +bazel_dep(name = "boost.range", version = "1.83.0.bcr.1") +bazel_dep(name = "boost.uuid", version = "1.83.0.bcr.1") +bazel_dep(name = "boost.variant", version = "1.83.0.bcr.1")