Commit 0da01d4
authored
fix(build): bpf generation improvements (#2688)
# Description
This PR hardens BPF object generation during Retina image builds,
particularly for ARM64 builds running through QEMU.
The BPF generation stage could fail while compiling its temporary Go
generator, leave an empty architecture-specific object file, and still
allow the image build to continue. The resulting image then failed at
runtime while loading the embedded BPF object.
## What changed
- Make the BPF generation stage fail immediately when a command fails.
- Verify that the generated architecture-specific conntrack object
exists and is non-empty before packaging the generated plugin artifacts.
- Stop the `retina-image` target if either the init or agent image build
fails, preventing a later loop iteration from masking an earlier
failure.
- Disable CGO only in the temporary BPF generator stage and enable
Microsoft' no-CGO OpenSSL system-crypto backend. This avoids
QEMU-emulated GCC failures during ARM64 generation while preserving
system-crypto compliance.
These changes affect build-time generators only. CGO and system-crypto
behavior for the Retina runtime binaries is unchanged.
## Related Issue
No linked issue.
## Checklist
- [x] I have read the [contributing
documentation](https://retina.sh/docs/Contributing/overview).
- [x] I signed and signed-off the commits (`git commit -S -s ...`). See
[this
documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification)
on signing commits.
- [x] I have correctly attributed the author(s) of the code.
- [x] I have tested the changes locally.
- [x] I have followed the project's style guidelines.
- [x] I have updated the documentation, if necessary.
- [x] I have added tests, if applicable.
## Screenshots (if applicable) or Testing Completed
- Built the exact `bpf-gen` stage for Linux AMD64.
- Built the exact `bpf-gen` stage for Linux ARM64 through QEMU.
- Confirmed both builds produce a non-empty architecture-specific
conntrack BPF object.
## Additional Notes
The no-CGO configuration is intentionally scoped to the temporary
generator stage in `controller/Dockerfile`; it is not a repository-wide
or runtime build setting.
---------
Signed-off-by: Alex Castilio dos Santos <alexsantos@microsoft.com>1 parent 8cd9b37 commit 0da01d4
2 files changed
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
| 264 | + | |
264 | 265 | | |
265 | 266 | | |
266 | 267 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
33 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
34 | 38 | | |
35 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
36 | 45 | | |
37 | 46 | | |
38 | 47 | | |
| |||
0 commit comments