From 7ed0c486f9a69890eeead83d55855e699aa62e61 Mon Sep 17 00:00:00 2001 From: Gong Su Date: Tue, 12 Nov 2024 08:46:05 -0500 Subject: [PATCH 1/2] Building python binding with bazel on s390x Signed-off-by: Gong Su --- python/dist/BUILD.bazel | 22 ++++++++++++++++++++++ python/dist/dist.bzl | 1 + 2 files changed, 23 insertions(+) diff --git a/python/dist/BUILD.bazel b/python/dist/BUILD.bazel index 6b335f105b3cf..a452d0111155c 100644 --- a/python/dist/BUILD.bazel +++ b/python/dist/BUILD.bazel @@ -84,6 +84,25 @@ config_setting( }, ) +config_setting( + name = "linux_s390x_release", + flag_values = { + "//toolchain:release": "True", + }, + values = {"cpu": "linux-s390x"}, +) + +config_setting( + name = "linux_s390x_local", + constraint_values = [ + "@platforms//os:linux", + "@platforms//cpu:s390x", + ], + flag_values = { + "//toolchain:release": "False", + }, +) + config_setting( name = "osx_x86_64_release", flag_values = { @@ -328,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": "linux_s390x", + ":linux_s390x_release": "manylinux2014_s390x", ":osx_universal2": "macosx_10_9_universal2", ":osx_aarch64": "macosx_11_0_arm64", ":windows_x86_32": "win32", @@ -458,6 +479,7 @@ py_dist( "win64": "310", "linux-x86_64": "38", "linux-aarch_64": "38", + "linux-s390x": "38", "osx-universal2": "38", }, # LINT.ThenChange(:python_tag) diff --git a/python/dist/dist.bzl b/python/dist/dist.bzl index 061125ede6376..7c9095e2659ec 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( From cf36bb9e97aeb681eae1a640e44baf3f98e3eb9a Mon Sep 17 00:00:00 2001 From: Gong Su Date: Fri, 22 Nov 2024 08:45:13 -0500 Subject: [PATCH 2/2] remove linux-s390x from py_dist() target to allow protobuf CI to pass Signed-off-by: Gong Su --- python/dist/BUILD.bazel | 1 - 1 file changed, 1 deletion(-) diff --git a/python/dist/BUILD.bazel b/python/dist/BUILD.bazel index a452d0111155c..850ee7ae51fb4 100644 --- a/python/dist/BUILD.bazel +++ b/python/dist/BUILD.bazel @@ -479,7 +479,6 @@ py_dist( "win64": "310", "linux-x86_64": "38", "linux-aarch_64": "38", - "linux-s390x": "38", "osx-universal2": "38", }, # LINT.ThenChange(:python_tag)