Skip to content

Commit 085737f

Browse files
authored
Add ppc64le to list of supported cpu architecutres (#110)
As of v1.54.0, buf supports releases for the ppc64le architecture. Add ppc64le to the list of supported cpu architectures in the buf bazel toolchain.
1 parent 24edf64 commit 085737f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

buf/internal/toolchain.bzl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,18 @@ def _buf_download_releases_impl(ctx):
111111
version_data = ctx.read("version.json")
112112
version = json.decode(version_data)["name"]
113113

114+
version_number = version.removeprefix("v").split(".")
115+
major_version = int(version_number[0])
116+
minor_version = int(version_number[1])
114117
os, cpu = _detect_host_platform(ctx)
115-
if os not in ["linux", "darwin", "windows"] or cpu not in ["arm64", "amd64"]:
118+
if os not in ["linux", "darwin", "windows"] or cpu not in ["arm64", "amd64", "ppc64le"]:
116119
fail("Unsupported operating system or cpu architecture ")
117120
if os == "linux" and cpu == "arm64":
118121
cpu = "aarch64"
119122
if cpu == "amd64":
120123
cpu = "x86_64"
124+
if cpu == "ppc64le" and (major_version < 1 or (major_version == 1 and minor_version < 54)):
125+
fail("Unsupported operating system or cpu architecture ")
121126

122127
ctx.report_progress("Downloading buf release hash")
123128
url = "{}/{}/sha256.txt".format(repository_url, version)

0 commit comments

Comments
 (0)