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

cmake: libbpf: Require at least v1.0 #3212

Merged
merged 1 commit into from
Jun 2, 2024

Conversation

danobi
Copy link
Member

@danobi danobi commented May 31, 2024

bpftrace relies on libbpf 1.0 b/c the 1.0 release contained major API breaks. Going forward from 1.0, we can feature detect and expect backwards compat.

This commit makes it so the error is more apparent on older systems. Otherwise you just get confusing build failures. Now you get:

0.763 -- Found LibBpf: /usr/lib/x86_64-linux-gnu/libbpf.so
0.763 CMake Error at cmake/FindLibBpf.cmake:48 (message):
0.763   Libbpf version too old to have libbpf_version.h
0.763 Call Stack (most recent call first):
0.763   CMakeLists.txt:84 (find_package)
0.763
0.763
0.763 -- Performing Test HAVE_LIBBPF_UPROBE_MULTI
0.791 -- Performing Test HAVE_LIBBPF_UPROBE_MULTI - Failed
0.791 CMake Error at CMakeLists.txt:87 (message):
0.791   bpftrace requires libbpf 1.0 or greater

This closes #3210.

Checklist
  • Language changes are updated in man/adoc/bpftrace.adoc
  • User-visible and non-trivial changes updated in CHANGELOG.md
  • The new behaviour is covered by tests

@danobi danobi requested review from ajor, viktormalik and fbs as code owners May 31, 2024 23:55
@danobi danobi force-pushed the libbpf_requirement branch from ff07bd7 to 0a87f1e Compare May 31, 2024 23:56
@jordalgo
Copy link
Contributor

jordalgo commented Jun 1, 2024

I'm not entirely sure what this means "Libbpf version too old to have libbpf_version.h"

@danobi danobi force-pushed the libbpf_requirement branch from 0a87f1e to f141cdb Compare June 1, 2024 02:07
@danobi
Copy link
Member Author

danobi commented Jun 1, 2024

@jordalgo I added a source comment to clarify. Lemme know if you have wording suggestions.

libbpf/libbpf@8ade99a

cmake/FindLibBpf.cmake Outdated Show resolved Hide resolved
bpftrace relies on libbpf 1.0 b/c the 1.0 release contained major API
breaks. Going forward from 1.0, we can feature detect and expect
backwards compat.

This commit makes it so the error is more apparent on older systems.
Otherwise you just get confusing build failures. Now you get:

```
0.763 -- Found LibBpf: /usr/lib/x86_64-linux-gnu/libbpf.so
0.763 CMake Error at cmake/FindLibBpf.cmake:48 (message):
0.763   Libbpf version too old to have libbpf_version.h
0.763 Call Stack (most recent call first):
0.763   CMakeLists.txt:84 (find_package)
0.763
0.763
0.763 -- Performing Test HAVE_LIBBPF_UPROBE_MULTI
0.791 -- Performing Test HAVE_LIBBPF_UPROBE_MULTI - Failed
0.791 CMake Error at CMakeLists.txt:87 (message):
0.791   bpftrace requires libbpf 1.0 or greater
```

This closes bpftrace#3210.
@danobi danobi force-pushed the libbpf_requirement branch from f141cdb to bec7d54 Compare June 2, 2024 17:49
@danobi danobi merged commit 9a395e1 into bpftrace:master Jun 2, 2024
17 checks passed
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.

Clarify install & supported distros
2 participants