bpf_conformance
bpf_conformance copied to clipboard
bpf_conformance dependency on elfio is hard to use
A change made to bpf_conformance apparently breaks the verifier compilation, so I’m trying to determine the right way to fix.
Bump external/bpf_conformance from 78df87a
to ab34094
by dependabot[bot] · Pull Request #543 · vbpf/ebpf-verifier (github.com) hits:
CMake Error at external/bpf_conformance/src/CMakeLists.txt:53 (add_dependencies): The dependency target "elfio" of target "bpf_conformance" does not exist.
After the recent change, bpf_conformance\src\CMakeLists.txt
now has:
add_dependencies(bpf_conformance elfio)
In the bpf_conformance repository this is fine since bpf_conformance\CMakeLists.txt
(one level up) has:
add_subdirectory("external/elfio")
But ebpf-verifier\CMakeLists.txt
has:
add_subdirectory("external/bpf_conformance/src")
Which means it tries to use the src\CMakeLists.txt
without first invoking bpf_conformance\CMakeLists.txt
, and hence can’t find the dependency
that is added inside bpf_conformance\external\elfio\CMakeLists.txt
.
Options:
- Don’t add the dependency in
bpf_conformance\src\CMakeLists.txt
. This seems like the wrong choice. - Move
add_subdirectory("external/elfio")
down insidebpf_conformance\src\CMakeLists.txt
- Update
ebpf-verifier\CMakeLists.txt
to depend on all ofbpf_conformance\CMakeLists.txt
not justbpf_conformance\src\CMakeLists.txt
. This would slow down the build by having to compilebpf_conformance\tests
etc. when that’s not needed by the verifier. - Update
ebpf-verifier\CMakeLists.txt
toadd_subdirectory(“external/bpf_conformance/external/elfio”)
so the dependency is defined before invokingbpf_conformance\src\CMakeLists.txt
Alan stated offline: "option 2 is probably the best option as this should permit other projects to consume bpf_conformance more easily."