Merge pull request #14623 from protocolbuffers/win2019-22.x

Backport CI fixes to 22.x
22.x
Mike Kruskal 1 year ago committed by GitHub
commit 184492af17
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. 2
      .github/workflows/test_csharp.yml
  4. 4
      .github/workflows/test_python.yml
  5. 12
      WORKSPACE
  6. 4
      pkg/cc_dist_library.bzl
  7. 17
      python/BUILD.bazel

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

@ -319,6 +319,16 @@ jobs:
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with: with:
ref: ${{ inputs.safe-checkout }} 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 - name: Run tests
uses: ./.github/actions/bazel uses: ./.github/actions/bazel
with: with:
@ -341,6 +351,8 @@ jobs:
-Dprotobuf_BUILD_SHARED_LIBS=OFF -Dprotobuf_BUILD_SHARED_LIBS=OFF
-Dprotobuf_BUILD_EXAMPLES=ON -Dprotobuf_BUILD_EXAMPLES=ON
vsversion: '2019' 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. # TODO(b/285566773) Re-enable this test.
# This is broken due to a github runner update. # This is broken due to a github runner update.
# See https://github.com/actions/runner-images/issues/7662 for more details # See https://github.com/actions/runner-images/issues/7662 for more details
@ -357,6 +369,8 @@ jobs:
-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: '2019'
# windows-2019 has python3.7 installed, which is incompatible with the latest gcloud
python-version: '3.8'
- name: Windows CMake Install - name: Windows CMake Install
os: windows-2019 os: windows-2019
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
@ -365,6 +379,8 @@ jobs:
-Dprotobuf_REMOVE_INSTALLED_HEADERS=ON -Dprotobuf_REMOVE_INSTALLED_HEADERS=ON
-Dprotobuf_BUILD_PROTOBUF_BINARIES=OFF -Dprotobuf_BUILD_PROTOBUF_BINARIES=OFF
vsversion: '2019' vsversion: '2019'
# windows-2019 has python3.7 installed, which is incompatible with the latest gcloud
python-version: '3.8'
name: ${{ matrix.name }} name: ${{ matrix.name }}
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
@ -374,6 +390,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@v1 uses: protocolbuffers/protobuf-ci/ccache@v1
with: with:

@ -37,7 +37,7 @@ jobs:
- name: Setup dotnet - name: Setup dotnet
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a # v3.0.3 uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a # v3.0.3
with: with:
dotnet-version: '6.0.x' dotnet-version: '3.1.x'
- name: Build - name: Build
run: dotnet build csharp/src/Google.Protobuf.sln run: dotnet build csharp/src/Google.Protobuf.sln

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

@ -99,18 +99,6 @@ system_python(
minimum_python_version = "3.7", 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") load("@utf8_range//:workspace_deps.bzl", "utf8_range_deps")
utf8_range_deps() utf8_range_deps()

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

@ -8,7 +8,8 @@
load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
load("@rules_python//python:defs.bzl", "py_library") load("@rules_python//python:defs.bzl", "py_library")
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("//:protobuf.bzl", "internal_py_proto_library") load("//:protobuf.bzl", "internal_py_proto_library")
load("//build_defs:arch_tests.bzl", "aarch64_test", "x86_64_test") load("//build_defs:arch_tests.bzl", "aarch64_test", "x86_64_test")
load("//build_defs:cpp_opts.bzl", "COPTS") load("//build_defs:cpp_opts.bzl", "COPTS")
@ -325,13 +326,13 @@ internal_py_test(
data = ["//src/google/protobuf:testdata"], data = ["//src/google/protobuf:testdata"],
) )
internal_py_test( #internal_py_test(
name = "numpy_test", # name = "numpy_test",
srcs = ["google/protobuf/internal/numpy_test.py"], # srcs = ["google/protobuf/internal/numpy_test.py"],
deps = [ # deps = [
requirement("numpy"), # requirement("numpy"),
], # ],
) #)
internal_py_test( internal_py_test(
name = "proto_builder_test", name = "proto_builder_test",

Loading…
Cancel
Save