Skip to content
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

Merged
merged 3 commits into from
Oct 13, 2021
Merged

reproducible builds for examples #417

merged 3 commits into from
Oct 13, 2021

Conversation

lmb
Copy link
Collaborator

@lmb lmb commented Sep 14, 2021

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.

@lmb lmb requested a review from ti-mo September 14, 2021 12:57
@lmb lmb force-pushed the lmb/examples-make branch 3 times, most recently from d019b4a to c6eb4f7 Compare September 16, 2021 19:16
@lmb lmb marked this pull request as draft September 21, 2021 09:25
@lmb lmb marked this pull request as ready for review September 21, 2021 13:17
Copy link
Collaborator

@ti-mo ti-mo left a 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?

Makefile Show resolved Hide resolved
@lmb
Copy link
Collaborator Author

lmb commented Sep 23, 2021

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.
.semaphore/semaphore.yml Outdated Show resolved Hide resolved
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=." \
Copy link
Collaborator

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure!

Makefile Show resolved Hide resolved
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.
@lmb lmb merged commit 93a81a8 into master Oct 13, 2021
@lmb lmb deleted the lmb/examples-make branch October 13, 2021 14:20
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.

None yet

2 participants