Skip to content

Commit 5fd703d

Browse files
authored
Merge branch 'protocolbuffers:main' into improve-performance-repeated-packed-fixed-field
2 parents 2ca82c0 + 3001614 commit 5fd703d

File tree

712 files changed

+35906
-25178
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

712 files changed

+35906
-25178
lines changed

.bazeliskrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
USE_BAZEL_VERSION=7.1.2

.bazelrc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,13 @@ build:ubsan --copt=-fno-sanitize=function --copt=-fno-sanitize=vptr
3131
# Abseil passes nullptr to memcmp with 0 size
3232
build:ubsan --copt=-fno-sanitize=nonnull-attribute
3333

34-
# TODO: migrate all dependencies from WORKSPACE to MODULE.bazel
35-
# https://github.com/protocolbuffers/protobuf/issues/14313
36-
common --noenable_bzlmod
37-
3834
# Important: this flag ensures that we remain compliant with the C++ layering
3935
# check.
4036
build --features=layering_check
4137

4238
common --repo_env=BAZEL_NO_APPLE_CPP_TOOLCHAIN=1
39+
40+
common --enable_platform_specific_config
41+
42+
# Use clang-cl by default on Windows (see https://github.com/protocolbuffers/protobuf/issues/20085).
43+
build:windows --extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows-clang-cl --extra_execution_platforms=//build_defs:x64_windows-clang-cl --host_platform=//build_defs:x64_windows-clang-cl

.bcr/presubmit.yml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
matrix:
2-
platform: ["debian10", "macos", "ubuntu2004", "windows"]
2+
platform: ["debian10", "macos", "ubuntu2004"]
33
bazel: [7.x]
44

55
tasks:
@@ -18,11 +18,31 @@ tasks:
1818
- '@protobuf//:protoc'
1919
- '@protobuf//:test_messages_proto2_cc_proto'
2020
- '@protobuf//:test_messages_proto3_cc_proto'
21+
# Separate windows for different c++ build flags.
22+
verify_targets_windows:
23+
name: "Verify windows build targets"
24+
platform: windows
25+
bazel: ${{ bazel }}
26+
build_flags:
27+
- '--cxxopt=/std:c++17'
28+
- '--host_cxxopt=/std:c++17'
29+
# Run using clang-cl
30+
- '--extra_execution_platforms=@protobuf//build_defs:x64_windows-clang-cl'
31+
- '--host_platform=@protobuf//build_defs:x64_windows-clang-cl'
32+
- '--extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows-clang-cl'
33+
build_targets:
34+
- '@protobuf//:protobuf'
35+
- '@protobuf//:protobuf_lite'
36+
- '@protobuf//:protobuf_python'
37+
- '@protobuf//:protobuf_java'
38+
- '@protobuf//:protoc'
39+
- '@protobuf//:test_messages_proto2_cc_proto'
40+
- '@protobuf//:test_messages_proto3_cc_proto'
2141

2242
bcr_test_module:
2343
module_path: "examples"
2444
matrix:
25-
platform: ["debian10", "macos", "ubuntu2004", "windows"]
45+
platform: ["debian10", "macos", "ubuntu2004"]
2646
bazel: [7.x]
2747
tasks:
2848
run_test_module:
@@ -34,3 +54,13 @@ bcr_test_module:
3454
- '--cxxopt=-std=c++17'
3555
build_targets:
3656
- "//..."
57+
# Separate windows for different c++ build flags.
58+
run_test_module_windows:
59+
name: "Run windows test module"
60+
platform: windows
61+
bazel: ${{ bazel }}
62+
build_flags:
63+
- '--cxxopt=/std:c++17'
64+
- '--host_cxxopt=/std:c++17'
65+
build_targets:
66+
- "//..."

.github/workflows/clear_caches.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
actions: write # permission is required to delete caches
2424
contents: read
2525
steps:
26-
- uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4
26+
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
2727
with:
2828
path: ${{ github.workspace }}/${{ steps.output.outputs.repository-cache }}
2929
key: repository-cache-${{ github.ref_name }}-${{ runner.os }}-reset-${{ github.sha }}

.github/workflows/staleness_check.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
if: ${{ github.event.repository.full_name == 'protocolbuffers/protobuf' }}
2626
steps:
2727
- name: Checkout
28-
uses: protocolbuffers/protobuf-ci/checkout@v3
28+
uses: protocolbuffers/protobuf-ci/checkout@v4
2929
with:
3030
ref: ${{ inputs.safe-checkout || github.head_ref || github.ref }}
3131

@@ -48,16 +48,17 @@ jobs:
4848
# In branches where automatic updates work as post-submits, we don't want to run staleness
4949
# tests along with user changes. Any stale files will be automatically fixed in a follow-up
5050
# commit.
51-
uses: protocolbuffers/protobuf-ci/bazel@v3
51+
uses: protocolbuffers/protobuf-ci/bazel@v4
5252
with:
5353
version: 7.1.2 # Bazel version
5454
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
5555
bazel-cache: staleness
56+
# TODO: Enable bzlmod once //python/dist is buildable.
5657
bash: >
5758
set -ex;
5859
echo "Please run ./regenerate_stale_files.sh to regenerate stale files";
5960
if [[ -z $COMMIT_TRIGGERED_RUN || -z $MAIN_RUN ]]; then
60-
bazel query 'attr(tags, "staleness_test", //...)' | xargs bazel test $BAZEL_FLAGS;
61+
bazel query 'attr(tags, "staleness_test", //...)' --noenable_bzlmod | xargs bazel test $BAZEL_FLAGS;
6162
else
62-
bazel query 'attr(tags, "staleness_test", //...)';
63+
bazel query 'attr(tags, "staleness_test", //...)' --noenable_bzlmod;
6364
fi

.github/workflows/test_bazel.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ jobs:
2727
fail-fast: false
2828
matrix:
2929
runner: [ ubuntu, windows, macos ]
30-
bazelversion: [ '7.1.2' ]
30+
bazelversion: [ '7.1.2', '8.0.0' ]
3131
bzlmod: [ true, false ]
3232
toolchain_resolution: [ "", "--incompatible_enable_proto_toolchain_resolution=true" ]
3333
runs-on: ${{ matrix.runner }}-latest
3434
name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} Examples ${{ matrix.runner }} ${{ matrix.bazelversion }}${{ matrix.bzlmod && ' (bzlmod)' || '' }} ${{ matrix.toolchain_resolution && ' (toolchain resolution)' || '' }}
3535
steps:
3636
- name: Checkout pending changes
3737
if: ${{ !matrix.continuous-only || inputs.continuous-run }}
38-
uses: protocolbuffers/protobuf-ci/checkout@v3
38+
uses: protocolbuffers/protobuf-ci/checkout@v4
3939
with:
4040
ref: ${{ inputs.safe-checkout }}
4141

@@ -53,9 +53,9 @@ jobs:
5353

5454
- name: Run tests
5555
if: ${{ !matrix.continuous-only || inputs.continuous-run }}
56-
uses: protocolbuffers/protobuf-ci/bazel@v3
56+
uses: protocolbuffers/protobuf-ci/bazel@v4
5757
with:
5858
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
5959
bazel-cache: examples
6060
version: ${{ matrix.bazelversion }}
61-
bash: cd examples && bazel build //... $BAZEL_FLAGS --enable_bzlmod=${{ matrix.bzlmod }} ${{ matrix.toolchain_resolution }}
61+
bash: cd examples && bazel build //... $BAZEL_FLAGS --enable_bzlmod=${{ matrix.bzlmod }} --enable_workspace=${{ !matrix.bzlmod }} ${{ matrix.toolchain_resolution }}

0 commit comments

Comments
 (0)