From d379c083cb54ad3d908d7adbc46202b9e8a6f8e3 Mon Sep 17 00:00:00 2001 From: Mike Kruskal Date: Tue, 25 Apr 2023 11:10:28 -0700 Subject: [PATCH 1/2] Fix btree issue in map tests. Without any weak ordering, btree_map fails to compile on windows 2022. Closes #12289 PiperOrigin-RevId: 527019995 --- .github/workflows/test_cpp.yml | 11 +++++++++++ src/google/protobuf/map_test.inc | 2 ++ 2 files changed, 13 insertions(+) diff --git a/.github/workflows/test_cpp.yml b/.github/workflows/test_cpp.yml index c46a72326e..50aeec7828 100644 --- a/.github/workflows/test_cpp.yml +++ b/.github/workflows/test_cpp.yml @@ -232,11 +232,20 @@ jobs: -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF -Dprotobuf_BUILD_SHARED_LIBS=OFF -Dprotobuf_BUILD_EXAMPLES=ON + vsversion: '2019' + - name: Windows CMake 2022 + os: windows-2022 + flags: >- + -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF + -Dprotobuf_BUILD_SHARED_LIBS=OFF + -Dprotobuf_BUILD_EXAMPLES=ON + vsversion: '2022' - name: Windows CMake Shared os: windows-2019 flags: >- -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF -Dprotobuf_BUILD_SHARED_LIBS=ON + vsversion: '2019' - name: Windows CMake Install os: windows-2019 install-flags: -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF -Dprotobuf_BUILD_TESTS=OFF @@ -244,6 +253,7 @@ jobs: -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF -Dprotobuf_REMOVE_INSTALLED_HEADERS=ON -Dprotobuf_BUILD_PROTOBUF_BINARIES=OFF + vsversion: '2019' name: ${{ matrix.name }} runs-on: ${{ matrix.os }} steps: @@ -257,6 +267,7 @@ jobs: uses: ./.github/actions/ccache with: cache-prefix: ${{ matrix.name }} + vsversion: ${{ matrix.vsversion }} # Install phase. - name: Configure CMake for install diff --git a/src/google/protobuf/map_test.inc b/src/google/protobuf/map_test.inc index 76c5ce8648..a11cdac463 100644 --- a/src/google/protobuf/map_test.inc +++ b/src/google/protobuf/map_test.inc @@ -129,6 +129,8 @@ struct ConstructorTag { ConstructorTag(ConstructorTag&&) : invoked_constructor(ConstructorType::kMove) {} + bool operator<(const ConstructorTag&) const { return false; } + ConstructorType invoked_constructor; }; From 94c33e39af9d68a1de68944c56ee02b9d7617f1f Mon Sep 17 00:00:00 2001 From: Mike Kruskal Date: Tue, 25 Apr 2023 12:04:33 -0700 Subject: [PATCH 2/2] Switch to protobuf-ci for new test --- .github/workflows/test_cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_cpp.yml b/.github/workflows/test_cpp.yml index 50aeec7828..238d0a7193 100644 --- a/.github/workflows/test_cpp.yml +++ b/.github/workflows/test_cpp.yml @@ -264,7 +264,7 @@ jobs: ref: ${{ inputs.safe-checkout }} - name: Setup ccache - uses: ./.github/actions/ccache + uses: protocolbuffers/protobuf-ci/ccache@v1 with: cache-prefix: ${{ matrix.name }} vsversion: ${{ matrix.vsversion }}