From a22f6e34b38286f912fa6d4b35ce4021f2057542 Mon Sep 17 00:00:00 2001 From: Henner Zeller Date: Tue, 28 Jan 2025 14:45:23 -0800 Subject: [PATCH] Update to protobuf 28.3 (last compatible with bazel 6) Previously, there was an issue linking it on Windows after 24.x, but seems that problem fixed itself. This now allows to use the bazel rules provided by protobuf itself. --- .bazelrc | 2 ++ .github/bin/build-and-test.sh | 8 ++++---- MODULE.bazel | 16 +++------------- third_party/proto/kythe/BUILD | 5 +---- 4 files changed, 10 insertions(+), 21 deletions(-) diff --git a/.bazelrc b/.bazelrc index fb78ca5f6..eced6fcfe 100644 --- a/.bazelrc +++ b/.bazelrc @@ -30,6 +30,8 @@ build --cxxopt="-Wno-unknown-warning-option" --host_cxxopt="-Wno-unknown-warning build --cxxopt="-Wno-dangling-reference" --host_cxxopt="-Wno-dangling-reference" # Newer bisons create an unused label. build --cxxopt="-Wno-unused-label" --host_cxxopt="-Wno-unused-label" +# c++20 warning on protobuf 28.1 +build --cxxopt="-Wno-missing-requires" --host_cxxopt="-Wno-missing-requires" # For 3rd party code: Disable warnings entirely. # They are not actionable and just create noise. diff --git a/.github/bin/build-and-test.sh b/.github/bin/build-and-test.sh index 657350ffb..d06ed6176 100755 --- a/.github/bin/build-and-test.sh +++ b/.github/bin/build-and-test.sh @@ -128,8 +128,8 @@ case "$MODE" in test-c++20|test-c++20-clang) # Compile with C++ 20 to make sure to be compatible with the next version. if [[ ${MODE} == "test-c++20" ]]; then - # Assignment of 1-char strings: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105329 - BAZEL_OPTS="${BAZEL_OPTS} --cxxopt=-Wno-restrict" + # Assignment of 1-char strings: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105329 + BAZEL_OPTS="${BAZEL_OPTS} --cxxopt=-Wno-restrict --cxxopt=-Wno-missing-requires" fi bazel test --keep_going --test_output=errors ${BAZEL_OPTS} --cxxopt=-std=c++20 -- ${CHOSEN_TARGETS} ;; @@ -137,8 +137,8 @@ case "$MODE" in test-c++23|test-c++23-clang) # Same; c++23 if [[ ${MODE} == "test-c++23" ]]; then - # Assignment of 1-char strings: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105329 - BAZEL_OPTS="${BAZEL_OPTS} --cxxopt=-Wno-restrict" + # Assignment of 1-char strings: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105329 + BAZEL_OPTS="${BAZEL_OPTS} --cxxopt=-Wno-restrict --cxxopt=-Wno-missing-requires" fi bazel test --keep_going --test_output=errors ${BAZEL_OPTS} --cxxopt=-std=c++2b -- ${CHOSEN_TARGETS} ;; diff --git a/MODULE.bazel b/MODULE.bazel index cf0fb38c9..adb123b66 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -15,21 +15,11 @@ bazel_dep(name = "rules_m4", version = "0.2.3") bazel_dep(name = "rules_flex", version = "0.3") bazel_dep(name = "rules_bison", version = "0.3") -# abseil-cpp and googletest can not be updated beyond the following currently, -# as newer googletest is not compatible with bazel 6 anymore, and abseil-cpp -# depends on it :( -- to support all active bazel's, we're stuck till EOL bazel6 -# See https://github.com/chipsalliance/verible/issues/2336 -bazel_dep(name = "googletest", version = "1.14.0.bcr.1", dev_dependency = True) - +# Last versions compatible w/ bazel6 https://github.com/chipsalliance/verible/issues/2336 bazel_dep(name = "abseil-cpp", version = "20240116.2") +bazel_dep(name = "protobuf", version = "28.3") -# Last protobuf version working with windows without strange linking errors. -# This also means that we unfortunately can't use the @protobuf//bazel rules -# but have to use rules_cc and rules_proto. -# TODO: figure out how we can make proto compile beyond 24.4 on Windows. -bazel_dep(name = "protobuf", version = "24.4") -bazel_dep(name = "rules_cc", version = "0.0.9") -bazel_dep(name = "rules_proto", version = "6.0.0-rc2") +bazel_dep(name = "googletest", version = "1.14.0.bcr.1", dev_dependency = True) # To build compilation DB and run build-cleaning bazel_dep(name = "bant", version = "0.1.13", dev_dependency = True) diff --git a/third_party/proto/kythe/BUILD b/third_party/proto/kythe/BUILD index a98c185c6..0b93b8816 100644 --- a/third_party/proto/kythe/BUILD +++ b/third_party/proto/kythe/BUILD @@ -1,7 +1,4 @@ -# Unfortunately, can't use @protobuf//bazel:cc_proto_library.bzl -# here, as this does not seem to work with windows. -load("@rules_cc//cc:defs.bzl", "cc_proto_library") -load("@rules_proto//proto:defs.bzl", "proto_library") +load("@protobuf//bazel:cc_proto_library.bzl", "cc_proto_library") package( default_visibility = ["//visibility:public"],