rules_buf icon indicating copy to clipboard operation
rules_buf copied to clipboard

rules_buf fails on Linux ARM64 due to incorrect binary naming

Open jaeyeom opened this issue 8 months ago • 4 comments

Summary

rules_buf fails to download buf binaries on Linux ARM64 systems because it uses the wrong naming convention. The rules look for linux-arm64 but buf releases use Linux-aarch64 for Linux ARM64 platforms.

Environment

  • OS: Linux ARM64 (Android Termux)
  • Architecture: aarch64
  • Bazel version: 7.4.1
  • rules_buf version: 0.4.0

Error

WARNING: Download from https://github.com/bufbuild/buf/releases/download/v1.54.0/protoc-gen-buf-lint-linux-arm64 failed: class java.io.FileNotFoundException GET returned 404 Not Found

Root Cause

The buf project releases binaries with these naming conventions:

  • macOS ARM64: buf-Darwin-arm64
  • Linux ARM64: buf-Linux-aarch64
  • Linux x86_64: buf-Linux-x86_64

However, rules_buf tries to download using linux-arm64 instead of Linux-aarch64.

Actual Release Assets

From buf v1.54.0 releases:

  • buf-Darwin-arm64 (macOS ARM64)
  • buf-Linux-aarch64 (Linux ARM64)
  • protoc-gen-buf-lint-Linux-aarch64 (Linux ARM64)
  • protoc-gen-buf-breaking-Linux-aarch64 (Linux ARM64)

Suggested Fix

In the toolchain.bzl file, the platform detection logic should map:

  • Darwin + arm64 → Darwin-arm64
  • Linux + arm64 → Linux-aarch64 (not linux-arm64)

Workaround

Until fixed, users on Linux ARM64 need to manually download and configure the buf binaries.

References

  • Buf releases: https://github.com/bufbuild/buf/releases
  • toolchain.bzl source: https://github.com/bufbuild/rules_buf/blob/main/buf/internal/toolchain.bzl

jaeyeom avatar Jun 17 '25 03:06 jaeyeom