Skip to content

Commit 14bccc6

Browse files
Merge pull request #14621 from protocolbuffers/win2019-24.x
Backport CI fixes to 24.x
2 parents be23deb + 050b1eb commit 14bccc6

File tree

3 files changed

+29
-15
lines changed

3 files changed

+29
-15
lines changed

.github/workflows/staleness_check.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
# tests along with user changes. Any stale files will be automatically fixed in a follow-up
5151
# commit.
5252
run: |
53+
set -ex
5354
if [[ -z $COMMIT_TRIGGERED_RUN || -z $MAIN_RUN ]]; then
5455
bazel query 'attr(tags, "staleness_test", //...)' | xargs bazel test $BAZEL_FLAGS
5556
else

.github/workflows/test_cpp.yml

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,8 @@ jobs:
316316
# for Apple Silicon to detect issues there.
317317
bazel: build --cpu=darwin_arm64 //src/...
318318
- name: Windows
319-
os: windows-2019
320-
cache_key: windows-2019
319+
os: windows-2022
320+
cache_key: windows-2022
321321
bazel: test //src/... @com_google_protobuf_examples//... --test_tag_filters=-conformance --build_tag_filters=-conformance
322322
name: ${{ matrix.name }} Bazel
323323
runs-on: ${{ matrix.os }}
@@ -342,39 +342,41 @@ jobs:
342342
os: macos-12
343343
flags: -DCMAKE_CXX_STANDARD=14
344344
- name: Windows CMake
345-
os: windows-2019
345+
os: windows-2022
346346
flags: >-
347347
-G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
348348
-Dprotobuf_BUILD_SHARED_LIBS=OFF
349349
-Dprotobuf_BUILD_EXAMPLES=ON
350-
vsversion: '2019'
351-
- name: Windows CMake 2022
352-
os: windows-2022
350+
vsversion: '2022'
351+
- name: Windows CMake 2019
352+
os: windows-2019
353353
flags: >-
354354
-G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
355355
-Dprotobuf_BUILD_SHARED_LIBS=OFF
356356
-Dprotobuf_BUILD_EXAMPLES=ON
357-
vsversion: '2022'
357+
vsversion: '2019'
358+
# windows-2019 has python3.7 installed, which is incompatible with the latest gcloud
359+
python-version: '3.8'
358360
- name: Windows CMake 32-bit
359-
os: windows-2019
361+
os: windows-2022
360362
flags: >-
361363
-G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
362-
vsversion: '2019'
364+
vsversion: '2022'
363365
windows-arch: 'win32'
364366
- name: Windows CMake Shared
365-
os: windows-2019
367+
os: windows-2022
366368
flags: >-
367369
-G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
368370
-Dprotobuf_BUILD_SHARED_LIBS=ON
369-
vsversion: '2019'
371+
vsversion: '2022'
370372
- name: Windows CMake Install
371-
os: windows-2019
373+
os: windows-2022
372374
install-flags: -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF -Dprotobuf_BUILD_TESTS=OFF
373375
flags: >-
374376
-G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
375377
-Dprotobuf_REMOVE_INSTALLED_HEADERS=ON
376378
-Dprotobuf_BUILD_PROTOBUF_BINARIES=OFF
377-
vsversion: '2019'
379+
vsversion: '2022'
378380
name: ${{ matrix.name }}
379381
runs-on: ${{ matrix.os }}
380382
steps:
@@ -384,6 +386,17 @@ jobs:
384386
ref: ${{ inputs.safe-checkout }}
385387
submodules: recursive
386388

389+
# Workaround for incompatibility between gcloud and windows-2019 runners.
390+
- name: Install Python
391+
if: ${{ matrix.python-version }}
392+
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
393+
with:
394+
python-version: ${{ matrix.python-version }}
395+
- name: Use custom python for gcloud
396+
if: ${{ matrix.python-version }}
397+
run: echo "CLOUDSDK_PYTHON=${Python3_ROOT_DIR}\\python3" >> $GITHUB_ENV
398+
shell: bash
399+
387400
- name: Setup ccache
388401
uses: protocolbuffers/protobuf-ci/ccache@v2
389402
with:

pkg/cc_dist_library.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,12 @@ def _cc_file_list_aspect_impl(target, ctx):
170170

171171
return [CcFileList(
172172
hdrs = _get_transitive_sources(
173-
_flatten_target_files(rule_attr.hdrs).to_list(),
173+
_flatten_target_files(getattr(rule_attr, "hdrs", [])).to_list(),
174174
"hdrs",
175175
rule_attr.deps,
176176
),
177177
textual_hdrs = _get_transitive_sources(
178-
_flatten_target_files(rule_attr.textual_hdrs).to_list(),
178+
_flatten_target_files(getattr(rule_attr, "textual_hdrs", [])).to_list(),
179179
"textual_hdrs",
180180
rule_attr.deps,
181181
),

0 commit comments

Comments
 (0)