Skip to content

Commit

Permalink
Updates to CI to support newer versions of tools
Browse files Browse the repository at this point in the history
Linux "latest" containers updated to
GCC 14.2
CMake 3.31.2
Bazel 8.0.0

Included are various fixes to get these versions to work.

Bazel now references repositories by their canonical names from the
Bazel Central Registry. For example, Abseil is now @abseil-cpp instead
of @com_google_absl, and GoogleTest is now @googletest instead of
@com_google_googletest. Users still using the old WORKSPACE system may
need to use `repo_mapping` on repositories using the old names. See
`WORKSPACE.bazel` in this commit for an example.

PiperOrigin-RevId: 709102146
Change-Id: I02327ed4f8fb947766480bdeef2b1930a7f831eb
  • Loading branch information
derekmauro authored and copybara-github committed Dec 23, 2024
1 parent 5913446 commit 90a7ba6
Show file tree
Hide file tree
Showing 31 changed files with 554 additions and 552 deletions.
14 changes: 8 additions & 6 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,27 @@ module(
compatibility_level = 1,
)

cc_configure = use_extension("@rules_cc//cc:extensions.bzl", "cc_configure_extension", dev_dependency = True)
cc_configure = use_extension("@rules_cc//cc:extensions.bzl",
"cc_configure_extension",
dev_dependency = True)
use_repo(cc_configure, "local_config_cc")

# Only direct dependencies need to be listed below.
# Please keep the versions in sync with the versions in the WORKSPACE file.

bazel_dep(name = "rules_cc", version = "0.0.16")
bazel_dep(name = "bazel_skylib", version = "1.5.0")
bazel_dep(name = "rules_cc", version = "0.1.0")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "platforms", version = "0.0.10")

bazel_dep(
name = "google_benchmark",
version = "1.8.3",
version = "1.8.5",
dev_dependency = True,
repo_name = "com_github_google_benchmark",
)

# Note: Googletest is NOT a dev_dependency. Some Abseil test utilities
# intended to be used by Abseil users depend on GoogleTest.
bazel_dep(
name = "googletest",
version = "1.15.2",
repo_name = "com_google_googletest",
)
25 changes: 15 additions & 10 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -14,42 +14,47 @@
# limitations under the License.
#

workspace(name = "com_google_absl")
workspace(name = "abseil-cpp")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

# GoogleTest/GoogleMock framework. Used by most unit-tests.
http_archive(
name = "com_google_googletest",
name = "googletest",
sha256 = "7b42b4d6ed48810c5362c265a17faebe90dc2373c885e5216439d37927f02926",
strip_prefix = "googletest-1.15.2",
# Keep this URL in sync with the version in ci/cmake_common.sh and
# ci/windows_msvc_cmake.bat.
urls = ["https://github.com/google/googletest/releases/download/v1.15.2/googletest-1.15.2.tar.gz"],
# Now that Abseil is using the canonical names from the Bazel Central Registry, map
# GoogleTest's old names to the new canonical names.
repo_mapping = {
"@com_google_absl": "@",
"@com_googlesource_code_re2": "@re2",
},
)

# RE2 (the regular expression library used by GoogleTest)
http_archive(
name = "com_googlesource_code_re2",
name = "re2",
sha256 = "eb2df807c781601c14a260a507a5bb4509be1ee626024cb45acbd57cb9d4032b",
strip_prefix = "re2-2024-07-02",
urls = ["https://github.com/google/re2/releases/download/2024-07-02/re2-2024-07-02.tar.gz"],
repo_mapping = {"@abseil-cpp": "@com_google_absl"},
)

# Google benchmark.
http_archive(
name = "com_github_google_benchmark",
sha256 = "6bc180a57d23d4d9515519f92b0c83d61b05b5bab188961f36ac7b06b0d9e9ce",
strip_prefix = "benchmark-1.8.3",
urls = ["https://github.com/google/benchmark/archive/refs/tags/v1.8.3.tar.gz"],
name = "google_benchmark",
sha256 = "d26789a2b46d8808a48a4556ee58ccc7c497fcd4c0af9b90197674a81e04798a",
strip_prefix = "benchmark-1.8.5",
urls = ["https://github.com/google/benchmark/archive/refs/tags/v1.8.5.tar.gz"],
)

# Bazel Skylib.
http_archive(
name = "bazel_skylib",
sha256 = "cd55a062e763b9349921f0f5db8c3933288dc8ba4f76dd9416aac68acee3cb94",
urls = ["https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz"],
sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f",
urls = ["https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz"],
)

# Bazel platform rules.
Expand Down
8 changes: 4 additions & 4 deletions absl/algorithm/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ cc_test(
deps = [
":algorithm",
"//absl/base:config",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
)

Expand Down Expand Up @@ -84,7 +84,7 @@ cc_test(
"//absl/base:core_headers",
"//absl/memory",
"//absl/types:span",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
)
Loading

0 comments on commit 90a7ba6

Please sign in to comment.