Skip to content

rules_buf fails on Linux ARM64 due to incorrect binary naming #112

@jaeyeom

Description

@jaeyeom

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions