Skip to content

build: point macOS BPF builds at a Linux VM instead of "install bpftool"#30

Open
necco-c wants to merge 1 commit into
masterfrom
macos-bpf-guard
Open

build: point macOS BPF builds at a Linux VM instead of "install bpftool"#30
necco-c wants to merge 1 commit into
masterfrom
macos-bpf-guard

Conversation

@necco-c

@necco-c necco-c commented Jul 1, 2026

Copy link
Copy Markdown

What

BPF objects only build on Linux. The vendored toolchain is Linux musl-static and there is no macOS bpftool or kernel BTF, so on a Mac make bpf fell through to PATH and died at:

error: bpftool not found — install bpftool / linux-tools

That advice can't be followed on macOS. This guards the BPF/veristat rules behind uname -s: on Darwin, make bpf (and thus the default all, which yeet run invokes) fails fast with the real fix instead:

error: BPF objects build on Linux only — macOS has no bpftool or kernel BTF.
       Build inside a Linux VM, then run there. With the yeet Lima VM:
         limactl shell yeet.debian-13
         cd <project> && make && sudo yeet run -t .

clean-bpf and clangd stay on both platforms (rm/mkdir/printf need no toolchain, and clangd editor support is useful while editing .bpf.c on a Mac).

Why it matters

yeet new clones this template from the remote, so this message is what a freshly-scaffolded project shows a macOS user on their first build. Today that's the impossible "install bpftool" hint.

Verified

  • macOS: make / make bpf fail fast with the VM instructions; make bundle and make clean-bpf still work.
  • Linux (Lima yeet.debian-13): unchanged — the object still links (bin/probe.bpf.o, 54KB) and the bundle builds.

Unmarked commit, so this releases as a minor bump per the release convention.

BPF objects only build on Linux. The vendored toolchain is Linux
musl-static and there's no macOS bpftool or kernel BTF. On a Mac the
build fell through to PATH and died at "bpftool not found, install
bpftool / linux-tools", advice that can't be followed there.

Guard the BPF/veristat rules behind uname -s. On Darwin, `make bpf`
(and thus the default `all`, which yeet run invokes) fails fast with
the real fix: build inside the Lima VM, then run there. clean-bpf and
clangd stay on both platforms (rm/mkdir/printf need no toolchain, and
clangd editor support is useful while editing .bpf.c on a Mac).

Linux builds are unchanged; verified the object still links there.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant