From 680f2ff4e9c270eb4d40a4a226bced53d777f077 Mon Sep 17 00:00:00 2001 From: James Jenkins Date: Wed, 21 May 2025 15:11:02 -0400 Subject: [PATCH 1/4] Add ppc64le to list of supported cpu architecutres --- buf/internal/toolchain.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buf/internal/toolchain.bzl b/buf/internal/toolchain.bzl index 26c1ed9..b3d81a5 100644 --- a/buf/internal/toolchain.bzl +++ b/buf/internal/toolchain.bzl @@ -112,7 +112,7 @@ def _buf_download_releases_impl(ctx): version = json.decode(version_data)["name"] os, cpu = _detect_host_platform(ctx) - if os not in ["linux", "darwin", "windows"] or cpu not in ["arm64", "amd64"]: + if os not in ["linux", "darwin", "windows"] or cpu not in ["arm64", "amd64", "ppc64le"]: fail("Unsupported operating system or cpu architecture ") if os == "linux" and cpu == "arm64": cpu = "aarch64" From 9e248f8002037f55d5c8dcb4ed82d1c3e5121369 Mon Sep 17 00:00:00 2001 From: James Jenkins Date: Thu, 22 May 2025 16:50:52 -0400 Subject: [PATCH 2/4] Check minimum buf version for ppc64le toolchain --- buf/internal/toolchain.bzl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/buf/internal/toolchain.bzl b/buf/internal/toolchain.bzl index b3d81a5..b2c911f 100644 --- a/buf/internal/toolchain.bzl +++ b/buf/internal/toolchain.bzl @@ -111,6 +111,9 @@ def _buf_download_releases_impl(ctx): version_data = ctx.read("version.json") version = json.decode(version_data)["name"] + version_number = version.removeprefix("v").split(".") + major_version = int(version_number[0]) + minor_version = int(version_number[1]) os, cpu = _detect_host_platform(ctx) if os not in ["linux", "darwin", "windows"] or cpu not in ["arm64", "amd64", "ppc64le"]: fail("Unsupported operating system or cpu architecture ") @@ -118,6 +121,8 @@ def _buf_download_releases_impl(ctx): cpu = "aarch64" if cpu == "amd64": cpu = "x86_64" + if cpu == "ppc64le" && (major_version < 1 || (major_version == 1 && minor_version < 54)): + fail("Unsupported operating system or cpu architecture ") ctx.report_progress("Downloading buf release hash") url = "{}/{}/sha256.txt".format(repository_url, version) From a01194a742e7a1b075cc5be327330b5c028b58b6 Mon Sep 17 00:00:00 2001 From: James Jenkins Date: Thu, 10 Jul 2025 10:36:42 -0400 Subject: [PATCH 3/4] Change incorrect && operator to 'and' --- buf/internal/toolchain.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buf/internal/toolchain.bzl b/buf/internal/toolchain.bzl index b2c911f..c639992 100644 --- a/buf/internal/toolchain.bzl +++ b/buf/internal/toolchain.bzl @@ -121,7 +121,7 @@ def _buf_download_releases_impl(ctx): cpu = "aarch64" if cpu == "amd64": cpu = "x86_64" - if cpu == "ppc64le" && (major_version < 1 || (major_version == 1 && minor_version < 54)): + if cpu == "ppc64le" and (major_version < 1 || (major_version == 1 and minor_version < 54)): fail("Unsupported operating system or cpu architecture ") ctx.report_progress("Downloading buf release hash") From 917ed17a1b0f79706ad471d3c274fd60a4ae2ff6 Mon Sep 17 00:00:00 2001 From: James Jenkins Date: Fri, 11 Jul 2025 09:15:21 -0400 Subject: [PATCH 4/4] Change || operator to 'or' --- buf/internal/toolchain.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buf/internal/toolchain.bzl b/buf/internal/toolchain.bzl index c639992..b98c9e4 100644 --- a/buf/internal/toolchain.bzl +++ b/buf/internal/toolchain.bzl @@ -121,7 +121,7 @@ def _buf_download_releases_impl(ctx): cpu = "aarch64" if cpu == "amd64": cpu = "x86_64" - if cpu == "ppc64le" and (major_version < 1 || (major_version == 1 and minor_version < 54)): + if cpu == "ppc64le" and (major_version < 1 or (major_version == 1 and minor_version < 54)): fail("Unsupported operating system or cpu architecture ") ctx.report_progress("Downloading buf release hash")