Merge pull request #14621 from protocolbuffers/win2019-24.x

Backport CI fixes to 24.x
24.x
Mike Kruskal 1 year ago committed by GitHub
commit 14bccc694c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      .github/workflows/staleness_check.yml
  2. 39
      .github/workflows/test_cpp.yml
  3. 4
      pkg/cc_dist_library.bzl

@ -50,6 +50,7 @@ jobs:
# tests along with user changes. Any stale files will be automatically fixed in a follow-up # tests along with user changes. Any stale files will be automatically fixed in a follow-up
# commit. # commit.
run: | run: |
set -ex
if [[ -z $COMMIT_TRIGGERED_RUN || -z $MAIN_RUN ]]; then if [[ -z $COMMIT_TRIGGERED_RUN || -z $MAIN_RUN ]]; then
bazel query 'attr(tags, "staleness_test", //...)' | xargs bazel test $BAZEL_FLAGS bazel query 'attr(tags, "staleness_test", //...)' | xargs bazel test $BAZEL_FLAGS
else else

@ -316,8 +316,8 @@ jobs:
# for Apple Silicon to detect issues there. # for Apple Silicon to detect issues there.
bazel: build --cpu=darwin_arm64 //src/... bazel: build --cpu=darwin_arm64 //src/...
- name: Windows - name: Windows
os: windows-2019 os: windows-2022
cache_key: windows-2019 cache_key: windows-2022
bazel: test //src/... @com_google_protobuf_examples//... --test_tag_filters=-conformance --build_tag_filters=-conformance bazel: test //src/... @com_google_protobuf_examples//... --test_tag_filters=-conformance --build_tag_filters=-conformance
name: ${{ matrix.name }} Bazel name: ${{ matrix.name }} Bazel
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@ -342,39 +342,41 @@ jobs:
os: macos-12 os: macos-12
flags: -DCMAKE_CXX_STANDARD=14 flags: -DCMAKE_CXX_STANDARD=14
- name: Windows CMake - name: Windows CMake
os: windows-2019 os: windows-2022
flags: >- flags: >-
-G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
-Dprotobuf_BUILD_SHARED_LIBS=OFF -Dprotobuf_BUILD_SHARED_LIBS=OFF
-Dprotobuf_BUILD_EXAMPLES=ON -Dprotobuf_BUILD_EXAMPLES=ON
vsversion: '2019' vsversion: '2022'
- name: Windows CMake 2022 - name: Windows CMake 2019
os: windows-2022 os: windows-2019
flags: >- flags: >-
-G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
-Dprotobuf_BUILD_SHARED_LIBS=OFF -Dprotobuf_BUILD_SHARED_LIBS=OFF
-Dprotobuf_BUILD_EXAMPLES=ON -Dprotobuf_BUILD_EXAMPLES=ON
vsversion: '2022' vsversion: '2019'
# windows-2019 has python3.7 installed, which is incompatible with the latest gcloud
python-version: '3.8'
- name: Windows CMake 32-bit - name: Windows CMake 32-bit
os: windows-2019 os: windows-2022
flags: >- flags: >-
-G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
vsversion: '2019' vsversion: '2022'
windows-arch: 'win32' windows-arch: 'win32'
- name: Windows CMake Shared - name: Windows CMake Shared
os: windows-2019 os: windows-2022
flags: >- flags: >-
-G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
-Dprotobuf_BUILD_SHARED_LIBS=ON -Dprotobuf_BUILD_SHARED_LIBS=ON
vsversion: '2019' vsversion: '2022'
- name: Windows CMake Install - name: Windows CMake Install
os: windows-2019 os: windows-2022
install-flags: -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF -Dprotobuf_BUILD_TESTS=OFF install-flags: -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF -Dprotobuf_BUILD_TESTS=OFF
flags: >- flags: >-
-G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
-Dprotobuf_REMOVE_INSTALLED_HEADERS=ON -Dprotobuf_REMOVE_INSTALLED_HEADERS=ON
-Dprotobuf_BUILD_PROTOBUF_BINARIES=OFF -Dprotobuf_BUILD_PROTOBUF_BINARIES=OFF
vsversion: '2019' vsversion: '2022'
name: ${{ matrix.name }} name: ${{ matrix.name }}
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
@ -384,6 +386,17 @@ jobs:
ref: ${{ inputs.safe-checkout }} ref: ${{ inputs.safe-checkout }}
submodules: recursive submodules: recursive
# Workaround for incompatibility between gcloud and windows-2019 runners.
- name: Install Python
if: ${{ matrix.python-version }}
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: ${{ matrix.python-version }}
- name: Use custom python for gcloud
if: ${{ matrix.python-version }}
run: echo "CLOUDSDK_PYTHON=${Python3_ROOT_DIR}\\python3" >> $GITHUB_ENV
shell: bash
- name: Setup ccache - name: Setup ccache
uses: protocolbuffers/protobuf-ci/ccache@v2 uses: protocolbuffers/protobuf-ci/ccache@v2
with: with:

@ -170,12 +170,12 @@ def _cc_file_list_aspect_impl(target, ctx):
return [CcFileList( return [CcFileList(
hdrs = _get_transitive_sources( hdrs = _get_transitive_sources(
_flatten_target_files(rule_attr.hdrs).to_list(), _flatten_target_files(getattr(rule_attr, "hdrs", [])).to_list(),
"hdrs", "hdrs",
rule_attr.deps, rule_attr.deps,
), ),
textual_hdrs = _get_transitive_sources( textual_hdrs = _get_transitive_sources(
_flatten_target_files(rule_attr.textual_hdrs).to_list(), _flatten_target_files(getattr(rule_attr, "textual_hdrs", [])).to_list(),
"textual_hdrs", "textual_hdrs",
rule_attr.deps, rule_attr.deps,
), ),

Loading…
Cancel
Save