diff --git a/.github/workflows/staleness_check.yml b/.github/workflows/staleness_check.yml index 5911b75a10..9364d046c6 100644 --- a/.github/workflows/staleness_check.yml +++ b/.github/workflows/staleness_check.yml @@ -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 diff --git a/.github/workflows/test_cpp.yml b/.github/workflows/test_cpp.yml index 5b0856604d..cfac011b7e 100644 --- a/.github/workflows/test_cpp.yml +++ b/.github/workflows/test_cpp.yml @@ -319,6 +319,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: ./.github/actions/bazel with: @@ -341,6 +351,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 @@ -357,6 +369,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 @@ -365,6 +379,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: @@ -374,6 +390,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: diff --git a/.github/workflows/test_csharp.yml b/.github/workflows/test_csharp.yml index 4d5770a9cc..7536f85b3d 100644 --- a/.github/workflows/test_csharp.yml +++ b/.github/workflows/test_csharp.yml @@ -37,7 +37,7 @@ jobs: - name: Setup dotnet uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a # v3.0.3 with: - dotnet-version: '6.0.x' + dotnet-version: '3.1.x' - name: Build run: dotnet build csharp/src/Google.Protobuf.sln diff --git a/.github/workflows/test_python.yml b/.github/workflows/test_python.yml index 3547635277..18767bff5c 100644 --- a/.github/workflows/test_python.yml +++ b/.github/workflows/test_python.yml @@ -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 diff --git a/WORKSPACE b/WORKSPACE index 4c403ac43b..31acd315bf 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -99,18 +99,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() diff --git a/pkg/cc_dist_library.bzl b/pkg/cc_dist_library.bzl index 42553ca3f8..9fc2c414e6 100644 --- a/pkg/cc_dist_library.bzl +++ b/pkg/cc_dist_library.bzl @@ -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, ), diff --git a/python/BUILD.bazel b/python/BUILD.bazel index f6fe071152..0197282399 100644 --- a/python/BUILD.bazel +++ b/python/BUILD.bazel @@ -8,7 +8,8 @@ load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") 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("//build_defs:arch_tests.bzl", "aarch64_test", "x86_64_test") load("//build_defs:cpp_opts.bzl", "COPTS") @@ -325,13 +326,13 @@ internal_py_test( data = ["//src/google/protobuf:testdata"], ) -internal_py_test( - name = "numpy_test", - srcs = ["google/protobuf/internal/numpy_test.py"], - deps = [ - requirement("numpy"), - ], -) +#internal_py_test( +# name = "numpy_test", +# srcs = ["google/protobuf/internal/numpy_test.py"], +# deps = [ +# requirement("numpy"), +# ], +#) internal_py_test( name = "proto_builder_test",