Skip to content

Commit

Permalink
Building python binding with bazel on s390x (#19232)
Browse files Browse the repository at this point in the history
Changes needed for building python binding with bazel on s390x.

Closes #19232

COPYBARA_INTEGRATE_REVIEW=#19232 from gongsu832:python_bazel_s390x 7ed0c48
FUTURE_COPYBARA_INTEGRATE_REVIEW=#19232 from gongsu832:python_bazel_s390x 7ed0c48
PiperOrigin-RevId: 698146211
  • Loading branch information
gongsu832 authored and copybara-github committed Nov 21, 2024
1 parent 0325132 commit c48ec5c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
24 changes: 24 additions & 0 deletions python/dist/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
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 = {
Expand Down Expand Up @@ -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": "linux_s390x",
":linux_s390x_release": "manylinux2014_s390x",
":osx_universal2": "macosx_10_9_universal2",
":osx_aarch64": "macosx_11_0_arm64",
":windows_x86_32": "win32",
Expand Down Expand Up @@ -453,6 +476,7 @@ py_dist(
"win64": "310",
"linux-x86_64": "39",
"linux-aarch_64": "39",
"linux-s390x": "39",
"osx-universal2": "39",
},
# LINT.ThenChange(:python_tag)
Expand Down
1 change: 1 addition & 0 deletions python/dist/dist.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit c48ec5c

Please sign in to comment.