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

Include bpf includes within the project #24

Closed
ocampeau opened this issue Jul 22, 2022 · 2 comments · Fixed by #25
Closed

Include bpf includes within the project #24

ocampeau opened this issue Jul 22, 2022 · 2 comments · Fixed by #25

Comments

@ocampeau
Copy link
Contributor

ocampeau commented Jul 22, 2022

Feature request

Maybe the project can come with its own include directory containing all standard bpf header files required to build the project, which would make it much easier for everybody to just build the binary locally without bothering about bpf dependencies.

Use case

After cloning the project, the make build command failed because I did not have my bpf include files in /usr/include/bpf.

Luckily, I had a personal project on my machine using libbpf, and so I just copied some of my include files to /usr/include/bpf and it worked. But for some other people less familiar with bpf who just wants to try this amazing tool (still in early stage, but looks quite promising) it might be a blocker.

Is this feature request gets accepted, I can submit a PR.

@edeNFed
Copy link
Contributor

edeNFed commented Jul 23, 2022

That sounds like a great idea. I'll be happy to accept a PR.
By the way, there is a Dockerfile that you can use to build the project inside a docker container.

@ocampeau
Copy link
Contributor Author

Great! I'll try to have a PR ready soon.

Also, I just took a look at the Dockerfile, and I was not aware of the libbpf-devel package (or libbpf-dev on Debian). That's awesome. It makes it much easier to have the header files. I was used to link libbpf from the kernel source tree.

I still see some advantages though to have an include directory within the project that would include all files from libbpf-devel package (and possibly more).

The most obvious to me is to make it possible to build the binary from within the project without any external dependencies. Another advantage I see is for versioning: to make sure anyone building the project locally are doing it against the same version of the bpf header files.

I'll submit a PR soon.

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 a pull request may close this issue.

2 participants