-
Notifications
You must be signed in to change notification settings - Fork 652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reproducible builds for examples #417
Conversation
d019b4a
to
c6eb4f7
Compare
c6eb4f7
to
bee246e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is starting to look a bit like make
spaghetti, but not sure what the alternative would be.
Maybe instead of having to control -cc
explicitly, pick up BPF_CLANG
using os.Getenv()
in bpf2go directly (and document it as part of its UI) to reduce the plumbing required?
I made that choice deliberately, because it means you can easily grep BPF_CLANG and see all occurences. If you feel strongly we can change it, but then the examples become harder for users to adapt since they need to understand that env thing, and nobody reads documentation. |
Use golang:buster as the container base so that we can invoke go generate.
Makefile
Outdated
@@ -36,7 +43,8 @@ TARGETS := \ | |||
docker-all: | |||
docker run --rm --user "${UIDGID}" \ | |||
-v "${REPODIR}":/ebpf -w /ebpf --env MAKEFLAGS \ | |||
--env CFLAGS="-fdebug-prefix-map=/ebpf=." \ | |||
--env BPF_CFLAGS="-fdebug-prefix-map=/ebpf=." \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still needed if we're considering stripping debug info in bpf2go?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure!
Build examples via the same container we use for testdata.
The "pushd; command; popd" pipeline doesn't fail if command exits non-zero. This has obfuscated that generating the examples has failed due to missing clang-11 on CI. Also merge the Build and Lint job, since the set up time for each job is non-trivial.
bee246e
to
a351cc2
Compare
Use the existing container to make build of examples reproducible. This requires adding a go toolchain, so unfortunately the image gets quite a bit bigger.