From f396506571fa1837704588b38cfb099f36c84fe3 Mon Sep 17 00:00:00 2001 From: zhangskz Date: Wed, 22 May 2024 10:00:09 -0700 Subject: [PATCH] MODULE.bazel fixes for protobuf BCR release. (#16927) - Specifies bazel version for presubmits - Set C++14 version (default is c++11 otherwise, which is unsupported) - Update MODULE.bazel version + updater since publish-to-bcr can't handle constants and adds a duplicate version number PiperOrigin-RevId: 633729225 --- .bcr/presubmit.yml | 10 ++++++++++ MODULE.bazel | 6 ++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.bcr/presubmit.yml b/.bcr/presubmit.yml index a8ed8706568c2..4e1cdff44dc69 100644 --- a/.bcr/presubmit.yml +++ b/.bcr/presubmit.yml @@ -1,10 +1,15 @@ matrix: platform: ["debian10", "macos", "ubuntu2004", "windows"] + bazel: [6.x, 7.x] tasks: verify_targets: name: "Verify build targets" platform: ${{ platform }} + bazel: ${{ bazel }} + build_flags: + - '--host_cxxopt=-std=c++14' + - '--cxxopt=-std=c++14' build_targets: - '@protobuf//:protobuf' - '@protobuf//:protobuf_lite' @@ -17,9 +22,14 @@ bcr_test_module: matrix: platform: ["debian10", "macos", "ubuntu2004", "windows"] + bazel: [6.x, 7.x] tasks: run_test_module: name: "Run test module" platform: ${{ platform }} + bazel: ${{ bazel }} + build_flags: + - '--host_cxxopt=-std=c++14' + - '--cxxopt=-std=c++14' build_targets: - "//..." diff --git a/MODULE.bazel b/MODULE.bazel index a26dafa19895e..be9cf917ad323 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,10 +1,8 @@ # TODO: migrate all dependencies from WORKSPACE to MODULE.bazel # https://github.com/protocolbuffers/protobuf/issues/14313 -PROTOBUF_VERSION = "27.0-dev" - module( name = "protobuf", - version = PROTOBUF_VERSION, + version = "27.0-dev", # Automatically updated on release compatibility_level = 1, repo_name = "com_google_protobuf", ) @@ -25,4 +23,4 @@ bazel_dep(name = "platforms", version = "0.0.8") bazel_dep(name = "zlib", version = "1.2.11") # TODO: remove after toolchain types are moved to protobuf -bazel_dep(name = "rules_proto", version = "4.0.0") \ No newline at end of file +bazel_dep(name = "rules_proto", version = "4.0.0")