Skip to content

Cache BPF objects once on amd64 and reuse for multi-arch builds#12365

Draft
hjiawei wants to merge 1 commit intoprojectcalico:masterfrom
hjiawei:hjiawei/cache-bpf-objects
Draft

Cache BPF objects once on amd64 and reuse for multi-arch builds#12365
hjiawei wants to merge 1 commit intoprojectcalico:masterfrom
hjiawei:hjiawei/cache-bpf-objects

Conversation

@hjiawei
Copy link
Copy Markdown
Contributor

@hjiawei hjiawei commented Apr 7, 2026

BPF bytecode targets the BPF virtual machine, not the host CPU, making compiled .o files architecture-independent across amd64, arm64, and ppc64le. This change builds BPF objects once on amd64 and caches them via Semaphore cache for reuse by multi-arch and push-images builds.

The PRE_BUILT_BPF_OBJECTS Makefile flag skips BPF .o compilation while still building the architecture-specific libbpf (needed for CGO linking). Both Felix and Node Build jobs store the cache so multi-arch jobs always have BPF objects available regardless of which build blocks run.

Release note:

TBD

BPF bytecode targets the BPF virtual machine, not the host CPU, making
compiled .o files architecture-independent across amd64, arm64, and
ppc64le. This change builds BPF objects once on amd64 and caches them
via Semaphore cache for reuse by multi-arch and push-images builds.

The PRE_BUILT_BPF_OBJECTS Makefile flag skips BPF .o compilation while
still building the architecture-specific libbpf (needed for CGO linking).
Both Felix and Node Build jobs store the cache so multi-arch jobs always
have BPF objects available regardless of which build blocks run.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@marvin-tigera marvin-tigera added this to the Calico v3.33.0 milestone Apr 7, 2026
@marvin-tigera marvin-tigera added release-note-required Change has user-facing impact (no matter how small) docs-pr-required Change is not yet documented labels Apr 7, 2026
@hjiawei hjiawei added docs-not-required Docs not required for this change release-note-not-required Change has no user-facing impact and removed release-note-required Change has user-facing impact (no matter how small) docs-pr-required Change is not yet documented labels Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-not-required Docs not required for this change release-note-not-required Change has no user-facing impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants