Skip to content

Commit 1bd87e7

Browse files
committed
fix(pypi): correctly translate ppc64le to bazel platforms
See bazelbuild/platforms#105
1 parent f219112 commit 1bd87e7

File tree

5 files changed

+11
-6
lines changed

5 files changed

+11
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ Unreleased changes template.
5959
* (gazelle) Providing multiple input requirements files to `gazelle_python_manifest` now works correctly.
6060
* (pypi) Handle trailing slashes in pip index URLs in environment variables,
6161
fixes [#2554](https://github.com/bazelbuild/rules_python/issues/2554).
62+
* (pypi) The `ppc64le` is now pointing to the right target in the `platforms` package.
6263

6364
{#v0-0-0-added}
6465
### Added

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module(
77
bazel_dep(name = "bazel_features", version = "1.21.0")
88
bazel_dep(name = "bazel_skylib", version = "1.7.1")
99
bazel_dep(name = "rules_cc", version = "0.0.16")
10-
bazel_dep(name = "platforms", version = "0.0.4")
10+
bazel_dep(name = "platforms", version = "0.0.11")
1111

1212
# Those are loaded only when using py_proto_library
1313
bazel_dep(name = "rules_proto", version = "7.0.2")

python/private/pypi/whl_installer/platform.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ class Arch(Enum):
4242
x86_32 = 2
4343
aarch64 = 3
4444
ppc = 4
45-
s390x = 5
46-
arm = 6
45+
ppc64le = 5
46+
s390x = 6
47+
arm = 7
4748
amd64 = x86_64
4849
arm64 = aarch64
4950
i386 = x86_32
5051
i686 = x86_32
5152
x86 = x86_32
52-
ppc64le = ppc
5353

5454
@classmethod
5555
def interpreter(cls) -> "Arch":
@@ -271,6 +271,8 @@ def platform_machine(self) -> str:
271271
return "arm64"
272272
elif self.os != OS.linux:
273273
return ""
274+
elif self.arch == Arch.ppc:
275+
return "ppc"
274276
elif self.arch == Arch.ppc64le:
275277
return "ppc64le"
276278
elif self.arch == Arch.s390x:

python/private/pypi/whl_target_platforms.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ _CPU_ALIASES = {
3131
"arm64": "aarch64",
3232
"ppc": "ppc",
3333
"ppc64": "ppc",
34-
"ppc64le": "ppc",
34+
"ppc64le": "ppc64le",
3535
"s390x": "s390x",
3636
"arm": "arm",
3737
"armv6l": "arm",

python/private/repo_utils.bzl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,10 @@ def _get_platforms_cpu_name(mrctx):
391391
return "x86_32"
392392
if arch in ["amd64", "x86_64", "x64"]:
393393
return "x86_64"
394-
if arch in ["ppc", "ppc64", "ppc64le"]:
394+
if arch in ["ppc", "ppc64"]:
395395
return "ppc"
396+
if arch in ["ppc64le"]:
397+
return "ppc64le"
396398
if arch in ["arm", "armv7l"]:
397399
return "arm"
398400
if arch in ["aarch64"]:

0 commit comments

Comments
 (0)