Skip to content

Commit 666689e

Browse files
Merge pull request #14620 from protocolbuffers/win2019-25.x
Backport CI fixes to 25.x
2 parents cfd4223 + 1577c30 commit 666689e

File tree

5 files changed

+47
-23
lines changed

5 files changed

+47
-23
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
echo "Please run ./regenerate_stale_files.sh to regenerate stale files"

.github/workflows/test_cpp.yml

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,8 @@ jobs:
324324
# for Apple Silicon to detect issues there.
325325
bazel: build --cpu=darwin_arm64 //src/...
326326
- name: Windows
327-
os: windows-2019
328-
cache_key: windows-2019
327+
os: windows-2022
328+
cache_key: windows-2022
329329
bazel: test //src/... @com_google_protobuf_examples//... --test_tag_filters=-conformance --build_tag_filters=-conformance
330330
name: ${{ matrix.name }} Bazel
331331
runs-on: ${{ matrix.os }}
@@ -351,44 +351,46 @@ jobs:
351351
flags: -DCMAKE_CXX_STANDARD=14
352352
cache-prefix: macos-cmake
353353
- name: Windows CMake
354-
os: windows-2019
355-
flags: >-
356-
-G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
357-
-Dprotobuf_BUILD_SHARED_LIBS=OFF
358-
-Dprotobuf_BUILD_EXAMPLES=ON
359-
vsversion: '2019'
360-
cache-prefix: windows-2019-cmake
361-
- name: Windows CMake 2022
362354
os: windows-2022
363355
flags: >-
364356
-G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
365357
-Dprotobuf_BUILD_SHARED_LIBS=OFF
366358
-Dprotobuf_BUILD_EXAMPLES=ON
367359
vsversion: '2022'
368360
cache-prefix: windows-2022-cmake
369-
- name: Windows CMake 32-bit
361+
- name: Windows CMake 2019
370362
os: windows-2019
371363
flags: >-
372364
-G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
365+
-Dprotobuf_BUILD_SHARED_LIBS=OFF
366+
-Dprotobuf_BUILD_EXAMPLES=ON
373367
vsversion: '2019'
368+
cache-prefix: windows-2019-cmake
369+
# windows-2019 has python3.7 installed, which is incompatible with the latest gcloud
370+
python-version: '3.8'
371+
- name: Windows CMake 32-bit
372+
os: windows-2022
373+
flags: >-
374+
-G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
375+
vsversion: '2022'
374376
windows-arch: 'win32'
375-
cache-prefix: windows-2019-win32-cmake
377+
cache-prefix: windows-2022-win32-cmake
376378
- name: Windows CMake Shared
377-
os: windows-2019
379+
os: windows-2022
378380
flags: >-
379381
-G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
380382
-Dprotobuf_BUILD_SHARED_LIBS=ON
381-
vsversion: '2019'
382-
cache-prefix: windows-2019-cmake
383+
vsversion: '2022'
384+
cache-prefix: windows-2022-cmake
383385
- name: Windows CMake Install
384-
os: windows-2019
386+
os: windows-2022
385387
install-flags: -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF -Dprotobuf_BUILD_TESTS=OFF
386388
flags: >-
387389
-G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
388390
-Dprotobuf_REMOVE_INSTALLED_HEADERS=ON
389391
-Dprotobuf_BUILD_PROTOBUF_BINARIES=OFF
390-
vsversion: '2019'
391-
cache-prefix: windows-2019-cmake
392+
vsversion: '2022'
393+
cache-prefix: windows-2022-cmake
392394
name: ${{ matrix.name }}
393395
runs-on: ${{ matrix.os }}
394396
steps:
@@ -405,6 +407,17 @@ jobs:
405407
arch: ${{ matrix.windows-arch || 'x64' }}
406408
vsversion: ${{ matrix.vsversion }}
407409

410+
# Workaround for incompatibility between gcloud and windows-2019 runners.
411+
- name: Install Python
412+
if: ${{ matrix.python-version }}
413+
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
414+
with:
415+
python-version: ${{ matrix.python-version }}
416+
- name: Use custom python for gcloud
417+
if: ${{ matrix.python-version }}
418+
run: echo "CLOUDSDK_PYTHON=${Python3_ROOT_DIR}\\python3" >> $GITHUB_ENV
419+
shell: bash
420+
408421
- name: Setup sccache
409422
uses: protocolbuffers/protobuf-ci/sccache@v2
410423
with:

.github/workflows/test_python.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ jobs:
7676
with:
7777
python-version: ${{ matrix.version }}
7878
cache: pip
79+
cache-dependency-path: 'python/requirements.txt'
7980

8081
- name: Validate version
8182
run: python3 --version | grep ${{ matrix.version }} || (echo "Invalid Python version - $(python3 --version)" && exit 1)

.github/workflows/test_upb.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,16 @@ jobs:
6464
strategy:
6565
fail-fast: false # Don't cancel all jobs if one fails.
6666
name: Windows
67-
runs-on: windows-2019
67+
runs-on: windows-2022
6868
steps:
6969
- name: Checkout pending changes
7070
uses: protocolbuffers/protobuf-ci/checkout@v2
7171
with:
7272
ref: ${{ inputs.safe-checkout }}
73+
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
74+
with:
75+
cache: pip
76+
cache-dependency-path: 'python/requirements.txt'
7377
- name: Run tests
7478
uses: protocolbuffers/protobuf-ci/bazel@v2
7579
with:
@@ -92,6 +96,11 @@ jobs:
9296
uses: protocolbuffers/protobuf-ci/checkout@v2
9397
with:
9498
ref: ${{ inputs.safe-checkout }}
99+
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
100+
with:
101+
cache: pip
102+
cache-dependency-path: 'python/requirements.txt'
103+
python-version: '3.11' # 3.12 doesn't have setuptools
95104
- name: Run tests
96105
uses: protocolbuffers/protobuf-ci/bazel@v2
97106
with:
@@ -195,7 +204,7 @@ jobs:
195204
with:
196205
name: requirements
197206
path: requirements
198-
- uses: actions/setup-python@v2
207+
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
199208
with:
200209
python-version: ${{ matrix.python-version }}
201210
architecture: ${{ matrix.architecture }}
@@ -250,7 +259,7 @@ jobs:
250259
path: wheels
251260
- name: Delete Binary Wheels
252261
run: find wheels -type f | grep -v none-any | xargs rm
253-
- uses: actions/setup-python@v2
262+
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
254263
with:
255264
python-version: ${{ matrix.python-version }}
256265
- name: Setup Python venv

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)