From 15e7d71eacd7df66531aae2bb7c9b8b8a1a81483 Mon Sep 17 00:00:00 2001 From: gongsu832 Date: Fri, 22 Nov 2024 10:09:31 -0800 Subject: [PATCH] Building python binding with bazel on s390x (#19232) Changes needed for building python binding with bazel on s390x. Closes #19232 COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/19232 from gongsu832:python_bazel_s390x 7ed0c486f9a69890eeead83d55855e699aa62e61 PiperOrigin-RevId: 699209740 --- python/dist/BUILD.bazel | 23 +++++++++++++++++++++++ python/dist/dist.bzl | 1 + 2 files changed, 24 insertions(+) diff --git a/python/dist/BUILD.bazel b/python/dist/BUILD.bazel index cb913fc8cf71..2dc9d1267edf 100644 --- a/python/dist/BUILD.bazel +++ b/python/dist/BUILD.bazel @@ -84,6 +84,27 @@ config_setting( }, ) +# s390x support is community-maintained and not officially supported. We do not +# publish s390x wheels. +config_setting( + name = "linux_s390x_release_unused", + flag_values = { + "//toolchain:release": "True", + }, + values = {"cpu": "linux-s390x"}, +) + +config_setting( + name = "linux_s390x_local_unused", + constraint_values = [ + "@platforms//os:linux", + "@platforms//cpu:s390x", + ], + flag_values = { + "//toolchain:release": "False", + }, +) + config_setting( name = "osx_x86_64_release", flag_values = { @@ -326,6 +347,8 @@ py_wheel( ":linux_x86_64_release": "manylinux2014_x86_64", ":linux_aarch64_local": "linux_aarch64", ":linux_aarch64_release": "manylinux2014_aarch64", + ":linux_s390x_local_unused": "linux_s390x", + ":linux_s390x_release_unused": "manylinux2014_s390x", ":osx_universal2": "macosx_10_9_universal2", ":osx_aarch64": "macosx_11_0_arm64", ":windows_x86_32": "win32", diff --git a/python/dist/dist.bzl b/python/dist/dist.bzl index 061125ede637..7c9095e2659e 100644 --- a/python/dist/dist.bzl +++ b/python/dist/dist.bzl @@ -29,6 +29,7 @@ def _get_suffix(limited_api, python_version, cpu): "linux-aarch_64": "aarch64-linux-gnu", "linux-x86_64": "x86_64-linux-gnu", "k8": "x86_64-linux-gnu", + "s390x": "s390x-linux-gnu", } return ".cpython-{}-{}.{}".format(