Skip to content

Commit

Permalink
Merge pull request #14620 from protocolbuffers/win2019-25.x
Browse files Browse the repository at this point in the history
Backport CI fixes to 25.x
  • Loading branch information
mkruskal-google committed Nov 2, 2023
2 parents cfd4223 + 1577c30 commit 666689e
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 23 deletions.
1 change: 1 addition & 0 deletions .github/workflows/staleness_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
# tests along with user changes. Any stale files will be automatically fixed in a follow-up
# commit.
run: |
set -ex
if [[ -z $COMMIT_TRIGGERED_RUN || -z $MAIN_RUN ]]; then
bazel query 'attr(tags, "staleness_test", //...)' | xargs bazel test $BAZEL_FLAGS || \
echo "Please run ./regenerate_stale_files.sh to regenerate stale files"
Expand Down
49 changes: 31 additions & 18 deletions .github/workflows/test_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ jobs:
# for Apple Silicon to detect issues there.
bazel: build --cpu=darwin_arm64 //src/...
- name: Windows
os: windows-2019
cache_key: windows-2019
os: windows-2022
cache_key: windows-2022
bazel: test //src/... @com_google_protobuf_examples//... --test_tag_filters=-conformance --build_tag_filters=-conformance
name: ${{ matrix.name }} Bazel
runs-on: ${{ matrix.os }}
Expand All @@ -351,44 +351,46 @@ jobs:
flags: -DCMAKE_CXX_STANDARD=14
cache-prefix: macos-cmake
- name: Windows CMake
os: windows-2019
flags: >-
-G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
-Dprotobuf_BUILD_SHARED_LIBS=OFF
-Dprotobuf_BUILD_EXAMPLES=ON
vsversion: '2019'
cache-prefix: windows-2019-cmake
- 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'
cache-prefix: windows-2022-cmake
- name: Windows CMake 32-bit
- name: Windows CMake 2019
os: windows-2019
flags: >-
-G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
-Dprotobuf_BUILD_SHARED_LIBS=OFF
-Dprotobuf_BUILD_EXAMPLES=ON
vsversion: '2019'
cache-prefix: windows-2019-cmake
# windows-2019 has python3.7 installed, which is incompatible with the latest gcloud
python-version: '3.8'
- name: Windows CMake 32-bit
os: windows-2022
flags: >-
-G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
vsversion: '2022'
windows-arch: 'win32'
cache-prefix: windows-2019-win32-cmake
cache-prefix: windows-2022-win32-cmake
- name: Windows CMake Shared
os: windows-2019
os: windows-2022
flags: >-
-G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
-Dprotobuf_BUILD_SHARED_LIBS=ON
vsversion: '2019'
cache-prefix: windows-2019-cmake
vsversion: '2022'
cache-prefix: windows-2022-cmake
- 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
flags: >-
-G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
-Dprotobuf_REMOVE_INSTALLED_HEADERS=ON
-Dprotobuf_BUILD_PROTOBUF_BINARIES=OFF
vsversion: '2019'
cache-prefix: windows-2019-cmake
vsversion: '2022'
cache-prefix: windows-2022-cmake
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -405,6 +407,17 @@ jobs:
arch: ${{ matrix.windows-arch || 'x64' }}
vsversion: ${{ matrix.vsversion }}

# 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 sccache
uses: protocolbuffers/protobuf-ci/sccache@v2
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ jobs:
with:
python-version: ${{ matrix.version }}
cache: pip
cache-dependency-path: 'python/requirements.txt'

- name: Validate version
run: python3 --version | grep ${{ matrix.version }} || (echo "Invalid Python version - $(python3 --version)" && exit 1)
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/test_upb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,16 @@ jobs:
strategy:
fail-fast: false # Don't cancel all jobs if one fails.
name: Windows
runs-on: windows-2019
runs-on: windows-2022
steps:
- name: Checkout pending changes
uses: protocolbuffers/protobuf-ci/checkout@v2
with:
ref: ${{ inputs.safe-checkout }}
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
cache: pip
cache-dependency-path: 'python/requirements.txt'
- name: Run tests
uses: protocolbuffers/protobuf-ci/bazel@v2
with:
Expand All @@ -92,6 +96,11 @@ jobs:
uses: protocolbuffers/protobuf-ci/checkout@v2
with:
ref: ${{ inputs.safe-checkout }}
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
cache: pip
cache-dependency-path: 'python/requirements.txt'
python-version: '3.11' # 3.12 doesn't have setuptools
- name: Run tests
uses: protocolbuffers/protobuf-ci/bazel@v2
with:
Expand Down Expand Up @@ -195,7 +204,7 @@ jobs:
with:
name: requirements
path: requirements
- uses: actions/setup-python@v2
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
Expand Down Expand Up @@ -250,7 +259,7 @@ jobs:
path: wheels
- name: Delete Binary Wheels
run: find wheels -type f | grep -v none-any | xargs rm
- uses: actions/setup-python@v2
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: ${{ matrix.python-version }}
- name: Setup Python venv
Expand Down
4 changes: 2 additions & 2 deletions pkg/cc_dist_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,12 @@ def _cc_file_list_aspect_impl(target, ctx):

return [CcFileList(
hdrs = _get_transitive_sources(
_flatten_target_files(rule_attr.hdrs).to_list(),
_flatten_target_files(getattr(rule_attr, "hdrs", [])).to_list(),
"hdrs",
rule_attr.deps,
),
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",
rule_attr.deps,
),
Expand Down

0 comments on commit 666689e

Please sign in to comment.