Skip to content

Commit

Permalink
Update to protobuf 28.3 (last compatible with bazel 6)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hzeller committed Jan 29, 2025
1 parent 19aee2c commit a22f6e3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 21 deletions.
2 changes: 2 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions .github/bin/build-and-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,17 @@ 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}
;;

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}
;;
Expand Down
16 changes: 3 additions & 13 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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)
5 changes: 1 addition & 4 deletions third_party/proto/kythe/BUILD
Original file line number Diff line number Diff line change
@@ -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"],
Expand Down

0 comments on commit a22f6e3

Please sign in to comment.