From 6a5938233b6519ba99ddb7c7314d45d3fa877969 Mon Sep 17 00:00:00 2001 From: Derek Mauro Date: Thu, 25 Jan 2024 10:27:14 -0800 Subject: Add support for Bzlmod for the next release https://bazel.build/external/overview#bzlmod Bzlmod will be the default in a future Bazel release. By default it requires projects to be registered with the Bazel Central Registry (https://registry.bazel.build/) and thus uses regular releases by default. Users that want to "live-at-head" can still do this through with overrides (https://bazel.build/external/module#overrides). This change updates GoogleTest dependencies to use released versions. CI uses Bzlmod except in the case of linux_gcc-floor, which will keep testing the old WORKSPACE-based dependency system. PiperOrigin-RevId: 601489729 Change-Id: I6be52034eba0d0e5fe12110e5e82879305cf73ff --- ci/linux-presubmit.sh | 7 +++++-- ci/macos-presubmit.sh | 1 + ci/windows-presubmit.bat | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'ci') diff --git a/ci/linux-presubmit.sh b/ci/linux-presubmit.sh index 1e05998..35e1670 100644 --- a/ci/linux-presubmit.sh +++ b/ci/linux-presubmit.sh @@ -67,6 +67,9 @@ for cc in /usr/local/bin/gcc /opt/llvm/clang/bin/clang; do done # Do one test with an older version of GCC +# TODO(googletest-team): This currently uses Bazel 5. When upgrading to a +# version of Bazel that supports Bzlmod, add --enable_bzlmod=false to keep test +# coverage for the old WORKSPACE dependency management. time docker run \ --volume="${GTEST_ROOT}:/src:ro" \ --workdir="/src" \ @@ -101,7 +104,7 @@ for std in ${STD}; do --copt="-Wuninitialized" \ --copt="-Wundef" \ --define="absl=${absl}" \ - --enable_bzlmod=false \ + --enable_bzlmod=true \ --features=external_include_paths \ --keep_going \ --show_timestamps \ @@ -126,7 +129,7 @@ for std in ${STD}; do --copt="-Wuninitialized" \ --copt="-Wundef" \ --define="absl=${absl}" \ - --enable_bzlmod=false \ + --enable_bzlmod=true \ --features=external_include_paths \ --keep_going \ --linkopt="--gcc-toolchain=/usr/local" \ diff --git a/ci/macos-presubmit.sh b/ci/macos-presubmit.sh index 1033282..70eaa74 100644 --- a/ci/macos-presubmit.sh +++ b/ci/macos-presubmit.sh @@ -69,6 +69,7 @@ for absl in 0 1; do --copt="-Wundef" \ --cxxopt="-std=c++14" \ --define="absl=${absl}" \ + --enable_bzlmod=true \ --features=external_include_paths \ --keep_going \ --show_timestamps \ diff --git a/ci/windows-presubmit.bat b/ci/windows-presubmit.bat index 38565fb..9753f9c 100644 --- a/ci/windows-presubmit.bat +++ b/ci/windows-presubmit.bat @@ -51,6 +51,7 @@ SET BAZEL_VS=C:\Program Files\Microsoft Visual Studio\2022\Community --compilation_mode=dbg ^ --copt=/std:c++14 ^ --copt=/WX ^ + --enable_bzlmod=true ^ --keep_going ^ --test_output=errors ^ --test_tag_filters=-no_test_msvc2017 -- cgit v1.1