Skip to content

Commit

Permalink
MODULE.bazel fixes for protobuf BCR release. (#16927)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
zhangskz committed May 22, 2024
1 parent 4baa11f commit f396506
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 10 additions & 0 deletions .bcr/presubmit.yml
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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:
- "//..."
6 changes: 2 additions & 4 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -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",
)
Expand All @@ -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")
bazel_dep(name = "rules_proto", version = "4.0.0")

0 comments on commit f396506

Please sign in to comment.