google / buzzer

Apache License 2.0
429 stars 32 forks source link

`bazel build :buzzer` fails on M1 Macs #13

Closed piotrostr closed 1 year ago

piotrostr commented 1 year ago

Traceback:

36 $ bazel build :buzzer

INFO: Analyzed target //:buzzer (12 packages loaded, 42 targets configured).
INFO: Found 1 target...
ERROR: /Users/piotrostr/buzzer/ebpf_ffi/BUILD:21:11: Compiling ebpf_ffi/ffi.cc failed: (Exit 1): cc_wrapper.sh failed: error executing command (from target //ebpf_ffi:ebpf_ffi) external/local_config_cc/cc_wrapper.sh -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics ... (remaining 41 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from ebpf_ffi/ffi.cc:15:
./ebpf_ffi/ffi.h:22:10: fatal error: 'linux/bpf.h' file not found
#include <linux/bpf.h>
         ^~~~~~~~~~~~~
1 error generated.
Target //:buzzer failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 2.488s, Critical Path: 0.97s
INFO: 14 processes: 8 internal, 6 darwin-sandbox.
FAILED: Build did NOT complete successfully

Environment:

xujiajiadexiaokeai commented 1 year ago

It looks like it should be used on Linux, and I built it successfully on a Linux virtual machine(Lima).Maybe you can give it a try.