Merge pull request #14622 from protocolbuffers/win2019-23.x

Backport CI fixes to 23.x
23.x
Mike Kruskal 1 year ago committed by GitHub
commit 81d38885c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      .github/workflows/staleness_check.yml
  2. 27
      .github/workflows/test_cpp.yml
  3. 4
      .github/workflows/test_python.yml
  4. 12
      WORKSPACE
  5. 4
      pkg/cc_dist_library.bzl
  6. 25
      python/google/protobuf/internal/numpy/BUILD.bazel

@ -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
else

@ -326,6 +326,16 @@ jobs:
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
ref: ${{ inputs.safe-checkout }}
# Workaround for incompatibility between gcloud and windows-2019 runners.
- name: Install Python
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
if: runner.os == 'Windows'
with:
python-version: '3.8'
- name: Use custom python for gcloud
run: echo "CLOUDSDK_PYTHON=${Python3_ROOT_DIR}\\python3" >> $GITHUB_ENV
if: runner.os == 'Windows'
shell: bash
- name: Run tests
uses: protocolbuffers/protobuf-ci/bazel@v1
with:
@ -348,6 +358,8 @@ jobs:
-Dprotobuf_BUILD_SHARED_LIBS=OFF
-Dprotobuf_BUILD_EXAMPLES=ON
vsversion: '2019'
# windows-2019 has python3.7 installed, which is incompatible with the latest gcloud
python-version: '3.8'
# TODO(b/285566773) Re-enable this test.
# This is broken due to a github runner update.
# See https://github.com/actions/runner-images/issues/7662 for more details
@ -364,6 +376,8 @@ jobs:
-G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
-Dprotobuf_BUILD_SHARED_LIBS=ON
vsversion: '2019'
# windows-2019 has python3.7 installed, which is incompatible with the latest gcloud
python-version: '3.8'
- name: Windows CMake Install
os: windows-2019
install-flags: -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF -Dprotobuf_BUILD_TESTS=OFF
@ -372,6 +386,8 @@ jobs:
-Dprotobuf_REMOVE_INSTALLED_HEADERS=ON
-Dprotobuf_BUILD_PROTOBUF_BINARIES=OFF
vsversion: '2019'
# windows-2019 has python3.7 installed, which is incompatible with the latest gcloud
python-version: '3.8'
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
steps:
@ -381,6 +397,17 @@ jobs:
ref: ${{ inputs.safe-checkout }}
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
uses: protocolbuffers/protobuf-ci/ccache@v1
with:

@ -17,7 +17,7 @@ jobs:
version: [ "3.7", "3.8", "3.9", "3.10" ]
include:
- type: Pure
targets: //python/... @upb//python/... //python:python_version
targets: //python/... //python:python_version
flags: --define=use_fast_cpp_protos=false
- type: C++
targets: //python/... //python:python_version
@ -54,7 +54,7 @@ jobs:
version: [ "3.10" ]
include:
- type: Pure
targets: //python/... @upb//python/... //python:python_version
targets: //python/... //python:python_version
- type: C++
targets: //python/... //python:python_version
flags: --define=use_fast_cpp_protos=true

@ -95,18 +95,6 @@ system_python(
minimum_python_version = "3.7",
)
load("@system_python//:pip.bzl", "pip_parse")
pip_parse(
name="pip_deps",
requirements = "@upb//python:requirements.txt",
requirements_overrides = {
"3.11": "@upb//python:requirements_311.txt",
},
)
load("@pip_deps//:requirements.bzl", "install_deps")
install_deps()
load("@utf8_range//:workspace_deps.bzl", "utf8_range_deps")
utf8_range_deps()

@ -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,
),

@ -1,7 +1,8 @@
# Protobuf python numpy Tests
# This is removed from other tests to keep numpy (and @pip_deps) as a test-only dependency
load("@pip_deps//:requirements.bzl", "requirement")
# It's no longer feasible to test this in our CI, and python is out of it's support window.
#load("@pip_deps//:requirements.bzl", "requirement")
load("//python:internal.bzl", "internal_py_test")
# TODO: b/278896688 - Remove this target and replace with py_library
@ -10,14 +11,14 @@ exports_files([
"numpy_test.py",
])
internal_py_test(
name = "numpy_test",
srcs = ["numpy_test.py"],
deps = [
requirement("numpy"),
],
visibility = [
"//python:__pkg__",
"@upb//python/pb_unit_tests:__pkg__",
]
)
#internal_py_test(
# name = "numpy_test",
# srcs = ["numpy_test.py"],
# deps = [
# requirement("numpy"),
# ],
# visibility = [
# "//python:__pkg__",
# "@upb//python/pb_unit_tests:__pkg__",
# ]
#)

Loading…
Cancel
Save