Merged
Conversation
This was referenced Jun 21, 2024
wdullaer
reviewed
Jun 21, 2024
cmd/bpf2go/internal/module.go
Outdated
| return "github.com/cilium/ebpf" | ||
| } | ||
|
|
||
| return bi.Main.Path |
Contributor
There was a problem hiding this comment.
This means that any outside program trying to use the code template will insert its own package instead of github.com/cilium/ebpf.
So even though the template functions are now public, it is not possible to use them outside of this repo and generate functional bindings.
Contributor
Author
There was a problem hiding this comment.
Ugh, good point. I guess removing the parameter outright it is.
Contributor
Author
There was a problem hiding this comment.
Testing this properly is a headache as well.
Contributor
Author
There was a problem hiding this comment.
Goodbye BuildInfo, it was probably a bad idea from the start.
88c83d4 to
20f267d
Compare
Contributor
Author
|
@wdullaer does this work for you now (sans the identifier stuff)? |
Contributor
|
Looks great. I appreciate the speedy follow up! |
Moves the code to generate go bindings to its own dedicated package and export the necessary functions to use it in bpf2go. This change will make it possible to reuse this code in other tools, without having to compile the C programs. The behaviour of bpf2go is unchanged. [ Lorenz: move code and backed out changes around module and identifier. These can come later, with tests. ] Co-authored-by: Lorenz Bauer <[email protected]> Signed-off-by: Wouter Dullaert <[email protected]>
Move the code necessary to compile a C to an ELF. The behaviour of bpf2go is unchanged. The code to fix up make-style depfiles remains in bpf2go since it has little tests, and is probably used only seldomly. Signed-off-by: Lorenz Bauer <[email protected]>
Move target and force users to use one of the predefined targets. Also export logic to generate build contraints from goarches. Signed-off-by: Lorenz Bauer <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bpf2go: export binding generator
bpf2go: export compilation
bpf2go: export targets