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

The back ends (uBPF, eBPF, DPDK) should not be compiled or run tests if they are missing their dependencies. #4535

Open
fruffy opened this issue Mar 15, 2024 · 9 comments
Labels
enhancement This topic discusses an improvement to existing compiler code. good-first-issue An issue that could be solved by someone new to the code base.

Comments

@fruffy
Copy link
Collaborator

fruffy commented Mar 15, 2024

This is something that always throws of first-time users of the compiler. In particular when they run ctest they see a bunch of failing tests because runtime dependencies of these tests are missing.

@fruffy fruffy added enhancement This topic discusses an improvement to existing compiler code. good-first-issue An issue that could be solved by someone new to the code base. labels Mar 15, 2024
@Sanket-0510
Copy link
Contributor

Sanket-0510 commented Mar 16, 2024

Yes some tests for the backend like eBPF and uBPF fails, when I ran ctest for the first time this is output -
Screenshot from 2024-03-16 20-23-37

@fruffy
Copy link
Collaborator Author

fruffy commented Mar 16, 2024

What is the output of the failures with ctest --output-on-failure -R ebpf/?

@Sanket-0510
Copy link
Contributor

Sanket-0510 commented Mar 16, 2024

ctest --output-on-failure -R ebpf/
Test project /home/sanket-teli/gsoc/p4c/build
Start 280: ebpf/testdata/p4_16_samples/action_call_ebpf.p4
1/28 Test 280: ebpf/testdata/p4_16_samples/action_call_ebpf.p4 .........***Failed 0.55 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from :
WARNING:/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/pcap_util.h:26:10: fatal error: pcap/pcap.h: No such file or directory
WARNING: 26 | #include <pcap/pcap.h>
WARNING: | ^~~~~~~~~~~~~
WARNING:compilation terminated.
WARNING:make: *** [runtime.mk:66: /home/sanket-teli/gsoc/p4c/build/tmpgden5l9a/build/ebpf_registry.o] Error 1
ERROR:Error 2 when executing "make -f runtime.mk -C /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime TARGET=test BPFOBJ=/home/sanket-teli/gsoc/p4c/build/tmpgden5l9a/test CFLAGS+=-DCONTROL_PLANE SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_registry.c SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_map.c SOURCES+=/home/sanket-teli/gsoc/p4c/build/tmpgden5l9a/test.c INCLUDES+=-I/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/contrib/libbpf/src".
ERROR:Failed to build the filter

  Start 281: ebpf/testdata/p4_16_samples/action_call_table_ebpf.p4

2/28 Test 281: ebpf/testdata/p4_16_samples/action_call_table_ebpf.p4 ...***Failed 0.53 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from :
WARNING:/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/pcap_util.h:26:10: fatal error: pcap/pcap.h: No such file or directory
WARNING: 26 | #include <pcap/pcap.h>
WARNING: | ^~~~~~~~~~~~~
WARNING:compilation terminated.
WARNING:make: *** [runtime.mk:66: /home/sanket-teli/gsoc/p4c/build/tmplql4h4w0/build/ebpf_registry.o] Error 1
ERROR:Error 2 when executing "make -f runtime.mk -C /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime TARGET=test BPFOBJ=/home/sanket-teli/gsoc/p4c/build/tmplql4h4w0/test CFLAGS+=-DCONTROL_PLANE SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_registry.c SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_map.c SOURCES+=/home/sanket-teli/gsoc/p4c/build/tmplql4h4w0/test.c INCLUDES+=-I/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/contrib/libbpf/src".
ERROR:Failed to build the filter

  Start 282: ebpf/testdata/p4_16_samples/advance_ebpf.p4

3/28 Test 282: ebpf/testdata/p4_16_samples/advance_ebpf.p4 .............***Failed 0.55 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from :
WARNING:/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/pcap_util.h:26:10: fatal error: pcap/pcap.h: No such file or directory
WARNING: 26 | #include <pcap/pcap.h>
WARNING: | ^~~~~~~~~~~~~
WARNING:compilation terminated.
WARNING:make: *** [runtime.mk:66: /home/sanket-teli/gsoc/p4c/build/tmpcgautk1v/build/ebpf_registry.o] Error 1
ERROR:Error 2 when executing "make -f runtime.mk -C /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime TARGET=test BPFOBJ=/home/sanket-teli/gsoc/p4c/build/tmpcgautk1v/test CFLAGS+=-DCONTROL_PLANE SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_registry.c SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_map.c SOURCES+=/home/sanket-teli/gsoc/p4c/build/tmpcgautk1v/test.c INCLUDES+=-I/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/contrib/libbpf/src".
ERROR:Failed to build the filter

  Start 283: ebpf/testdata/p4_16_samples/bool_ebpf.p4

4/28 Test 283: ebpf/testdata/p4_16_samples/bool_ebpf.p4 ................***Failed 0.52 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from :
WARNING:/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/pcap_util.h:26:10: fatal error: pcap/pcap.h: No such file or directory
WARNING: 26 | #include <pcap/pcap.h>
WARNING: | ^~~~~~~~~~~~~
WARNING:compilation terminated.
WARNING:make: *** [runtime.mk:66: /home/sanket-teli/gsoc/p4c/build/tmpdyctnom6/build/ebpf_registry.o] Error 1
ERROR:Error 2 when executing "make -f runtime.mk -C /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime TARGET=test BPFOBJ=/home/sanket-teli/gsoc/p4c/build/tmpdyctnom6/test CFLAGS+=-DCONTROL_PLANE SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_registry.c SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_map.c SOURCES+=/home/sanket-teli/gsoc/p4c/build/tmpdyctnom6/test.c INCLUDES+=-I/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/contrib/libbpf/src".
ERROR:Failed to build the filter

  Start 284: ebpf/testdata/p4_16_samples/count_add_ebpf.p4

5/28 Test 284: ebpf/testdata/p4_16_samples/count_add_ebpf.p4 ...........***Failed 0.50 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from :
WARNING:/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/pcap_util.h:26:10: fatal error: pcap/pcap.h: No such file or directory
WARNING: 26 | #include <pcap/pcap.h>
WARNING: | ^~~~~~~~~~~~~
WARNING:compilation terminated.
WARNING:make: *** [runtime.mk:66: /home/sanket-teli/gsoc/p4c/build/tmpk7hfqsoj/build/ebpf_registry.o] Error 1
ERROR:Error 2 when executing "make -f runtime.mk -C /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime TARGET=test BPFOBJ=/home/sanket-teli/gsoc/p4c/build/tmpk7hfqsoj/test CFLAGS+=-DCONTROL_PLANE SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_registry.c SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_map.c SOURCES+=/home/sanket-teli/gsoc/p4c/build/tmpk7hfqsoj/test.c INCLUDES+=-I/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/contrib/libbpf/src".
ERROR:Failed to build the filter

  Start 285: ebpf/testdata/p4_16_samples/count_ebpf.p4

6/28 Test 285: ebpf/testdata/p4_16_samples/count_ebpf.p4 ...............***Failed 0.54 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from :
WARNING:/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/pcap_util.h:26:10: fatal error: pcap/pcap.h: No such file or directory
WARNING: 26 | #include <pcap/pcap.h>
WARNING: | ^~~~~~~~~~~~~
WARNING:compilation terminated.
WARNING:make: *** [runtime.mk:66: /home/sanket-teli/gsoc/p4c/build/tmp3q6k02ht/build/ebpf_registry.o] Error 1
ERROR:Error 2 when executing "make -f runtime.mk -C /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime TARGET=test BPFOBJ=/home/sanket-teli/gsoc/p4c/build/tmp3q6k02ht/test CFLAGS+=-DCONTROL_PLANE SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_registry.c SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_map.c SOURCES+=/home/sanket-teli/gsoc/p4c/build/tmp3q6k02ht/test.c INCLUDES+=-I/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/contrib/libbpf/src".
ERROR:Failed to build the filter

  Start 286: ebpf/testdata/p4_16_samples/hit_ebpf.p4

7/28 Test 286: ebpf/testdata/p4_16_samples/hit_ebpf.p4 .................***Failed 0.52 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from :
WARNING:/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/pcap_util.h:26:10: fatal error: pcap/pcap.h: No such file or directory
WARNING: 26 | #include <pcap/pcap.h>
WARNING: | ^~~~~~~~~~~~~
WARNING:compilation terminated.
WARNING:make: *** [runtime.mk:66: /home/sanket-teli/gsoc/p4c/build/tmp50oirr0d/build/ebpf_registry.o] Error 1
ERROR:Error 2 when executing "make -f runtime.mk -C /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime TARGET=test BPFOBJ=/home/sanket-teli/gsoc/p4c/build/tmp50oirr0d/test CFLAGS+=-DCONTROL_PLANE SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_registry.c SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_map.c SOURCES+=/home/sanket-teli/gsoc/p4c/build/tmp50oirr0d/test.c INCLUDES+=-I/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/contrib/libbpf/src".
ERROR:Failed to build the filter

  Start 287: ebpf/testdata/p4_16_samples/init_ebpf.p4

8/28 Test 287: ebpf/testdata/p4_16_samples/init_ebpf.p4 ................***Failed 0.51 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from :
WARNING:/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/pcap_util.h:26:10: fatal error: pcap/pcap.h: No such file or directory
WARNING: 26 | #include <pcap/pcap.h>
WARNING: | ^~~~~~~~~~~~~
WARNING:compilation terminated.
WARNING:make: *** [runtime.mk:66: /home/sanket-teli/gsoc/p4c/build/tmp07212o3g/build/ebpf_registry.o] Error 1
ERROR:Error 2 when executing "make -f runtime.mk -C /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime TARGET=test BPFOBJ=/home/sanket-teli/gsoc/p4c/build/tmp07212o3g/test CFLAGS+=-DCONTROL_PLANE SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_registry.c SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_map.c SOURCES+=/home/sanket-teli/gsoc/p4c/build/tmp07212o3g/test.c INCLUDES+=-I/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/contrib/libbpf/src".
ERROR:Failed to build the filter

  Start 288: ebpf/testdata/p4_16_samples/issue2791_ebpf.p4

9/28 Test 288: ebpf/testdata/p4_16_samples/issue2791_ebpf.p4 ...........***Failed 0.49 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from :
WARNING:/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/pcap_util.h:26:10: fatal error: pcap/pcap.h: No such file or directory
WARNING: 26 | #include <pcap/pcap.h>
WARNING: | ^~~~~~~~~~~~~
WARNING:compilation terminated.
WARNING:make: *** [runtime.mk:66: /home/sanket-teli/gsoc/p4c/build/tmpto_hoi49/build/ebpf_registry.o] Error 1
ERROR:Error 2 when executing "make -f runtime.mk -C /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime TARGET=test BPFOBJ=/home/sanket-teli/gsoc/p4c/build/tmpto_hoi49/test CFLAGS+=-DCONTROL_PLANE SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_registry.c SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_map.c SOURCES+=/home/sanket-teli/gsoc/p4c/build/tmpto_hoi49/test.c INCLUDES+=-I/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/contrib/libbpf/src".
ERROR:Failed to build the filter

  Start 289: ebpf/testdata/p4_16_samples/issue2793_ebpf.p4

10/28 Test 289: ebpf/testdata/p4_16_samples/issue2793_ebpf.p4 ...........***Failed 0.53 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from :
WARNING:/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/pcap_util.h:26:10: fatal error: pcap/pcap.h: No such file or directory
WARNING: 26 | #include <pcap/pcap.h>
WARNING: | ^~~~~~~~~~~~~
WARNING:compilation terminated.
WARNING:make: *** [runtime.mk:66: /home/sanket-teli/gsoc/p4c/build/tmplbqeyqmr/build/ebpf_registry.o] Error 1
ERROR:Error 2 when executing "make -f runtime.mk -C /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime TARGET=test BPFOBJ=/home/sanket-teli/gsoc/p4c/build/tmplbqeyqmr/test CFLAGS+=-DCONTROL_PLANE SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_registry.c SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_map.c SOURCES+=/home/sanket-teli/gsoc/p4c/build/tmplbqeyqmr/test.c INCLUDES+=-I/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/contrib/libbpf/src".
ERROR:Failed to build the filter

  Start 290: ebpf/testdata/p4_16_samples/issue2797_ebpf.p4

11/28 Test 290: ebpf/testdata/p4_16_samples/issue2797_ebpf.p4 ...........***Failed 0.50 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from :
WARNING:/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/pcap_util.h:26:10: fatal error: pcap/pcap.h: No such file or directory
WARNING: 26 | #include <pcap/pcap.h>
WARNING: | ^~~~~~~~~~~~~
WARNING:compilation terminated.
WARNING:make: *** [runtime.mk:66: /home/sanket-teli/gsoc/p4c/build/tmphgaqz5w3/build/ebpf_registry.o] Error 1
ERROR:Error 2 when executing "make -f runtime.mk -C /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime TARGET=test BPFOBJ=/home/sanket-teli/gsoc/p4c/build/tmphgaqz5w3/test CFLAGS+=-DCONTROL_PLANE SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_registry.c SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_map.c SOURCES+=/home/sanket-teli/gsoc/p4c/build/tmphgaqz5w3/test.c INCLUDES+=-I/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/contrib/libbpf/src".
ERROR:Failed to build the filter

  Start 291: ebpf/testdata/p4_16_samples/issue2816-1_ebpf.p4

12/28 Test 291: ebpf/testdata/p4_16_samples/issue2816-1_ebpf.p4 .........***Failed 0.55 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from :
WARNING:/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/pcap_util.h:26:10: fatal error: pcap/pcap.h: No such file or directory
WARNING: 26 | #include <pcap/pcap.h>
WARNING: | ^~~~~~~~~~~~~
WARNING:compilation terminated.
WARNING:make: *** [runtime.mk:66: /home/sanket-teli/gsoc/p4c/build/tmpjcv73216/build/ebpf_registry.o] Error 1
ERROR:Error 2 when executing "make -f runtime.mk -C /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime TARGET=test BPFOBJ=/home/sanket-teli/gsoc/p4c/build/tmpjcv73216/test CFLAGS+=-DCONTROL_PLANE SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_registry.c SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_map.c SOURCES+=/home/sanket-teli/gsoc/p4c/build/tmpjcv73216/test.c INCLUDES+=-I/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/contrib/libbpf/src".
ERROR:Failed to build the filter

  Start 292: ebpf/testdata/p4_16_samples/issue2816_ebpf.p4

13/28 Test 292: ebpf/testdata/p4_16_samples/issue2816_ebpf.p4 ...........***Failed 0.55 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from :
WARNING:/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/pcap_util.h:26:10: fatal error: pcap/pcap.h: No such file or directory
WARNING: 26 | #include <pcap/pcap.h>
WARNING: | ^~~~~~~~~~~~~
WARNING:compilation terminated.
WARNING:make: *** [runtime.mk:66: /home/sanket-teli/gsoc/p4c/build/tmpvyrc5yrv/build/ebpf_registry.o] Error 1
ERROR:Error 2 when executing "make -f runtime.mk -C /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime TARGET=test BPFOBJ=/home/sanket-teli/gsoc/p4c/build/tmpvyrc5yrv/test CFLAGS+=-DCONTROL_PLANE SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_registry.c SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_map.c SOURCES+=/home/sanket-teli/gsoc/p4c/build/tmpvyrc5yrv/test.c INCLUDES+=-I/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/contrib/libbpf/src".
ERROR:Failed to build the filter

  Start 293: ebpf/testdata/p4_16_samples/issue870_ebpf.p4

14/28 Test 293: ebpf/testdata/p4_16_samples/issue870_ebpf.p4 ............***Failed 0.63 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from :
WARNING:/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/pcap_util.h:26:10: fatal error: pcap/pcap.h: No such file or directory
WARNING: 26 | #include <pcap/pcap.h>
WARNING: | ^~~~~~~~~~~~~
WARNING:compilation terminated.
WARNING:make: *** [runtime.mk:66: /home/sanket-teli/gsoc/p4c/build/tmpe8thxwzm/build/ebpf_registry.o] Error 1
ERROR:Error 2 when executing "make -f runtime.mk -C /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime TARGET=test BPFOBJ=/home/sanket-teli/gsoc/p4c/build/tmpe8thxwzm/test CFLAGS+=-DCONTROL_PLANE SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_registry.c SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_map.c SOURCES+=/home/sanket-teli/gsoc/p4c/build/tmpe8thxwzm/test.c INCLUDES+=-I/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/contrib/libbpf/src".
ERROR:Failed to build the filter

  Start 294: ebpf/testdata/p4_16_samples/key-issue-1020_ebpf.p4

15/28 Test 294: ebpf/testdata/p4_16_samples/key-issue-1020_ebpf.p4 ......***Failed 0.61 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from :
WARNING:/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/pcap_util.h:26:10: fatal error: pcap/pcap.h: No such file or directory
WARNING: 26 | #include <pcap/pcap.h>
WARNING: | ^~~~~~~~~~~~~
WARNING:compilation terminated.
WARNING:make: *** [runtime.mk:66: /home/sanket-teli/gsoc/p4c/build/tmpkymgk88g/build/ebpf_registry.o] Error 1
ERROR:Error 2 when executing "make -f runtime.mk -C /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime TARGET=test BPFOBJ=/home/sanket-teli/gsoc/p4c/build/tmpkymgk88g/test CFLAGS+=-DCONTROL_PLANE SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_registry.c SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_map.c SOURCES+=/home/sanket-teli/gsoc/p4c/build/tmpkymgk88g/test.c INCLUDES+=-I/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/contrib/libbpf/src".
ERROR:Failed to build the filter

  Start 295: ebpf/testdata/p4_16_samples/key_ebpf.p4

16/28 Test 295: ebpf/testdata/p4_16_samples/key_ebpf.p4 .................***Failed 0.53 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from :
WARNING:/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/pcap_util.h:26:10: fatal error: pcap/pcap.h: No such file or directory
WARNING: 26 | #include <pcap/pcap.h>
WARNING: | ^~~~~~~~~~~~~
WARNING:compilation terminated.
WARNING:make: *** [runtime.mk:66: /home/sanket-teli/gsoc/p4c/build/tmpmcg6v9wz/build/ebpf_registry.o] Error 1
ERROR:Error 2 when executing "make -f runtime.mk -C /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime TARGET=test BPFOBJ=/home/sanket-teli/gsoc/p4c/build/tmpmcg6v9wz/test CFLAGS+=-DCONTROL_PLANE SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_registry.c SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_map.c SOURCES+=/home/sanket-teli/gsoc/p4c/build/tmpmcg6v9wz/test.c INCLUDES+=-I/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/contrib/libbpf/src".
ERROR:Failed to build the filter

  Start 296: ebpf/testdata/p4_16_samples/length_ebpf.p4

17/28 Test 296: ebpf/testdata/p4_16_samples/length_ebpf.p4 ..............***Failed 0.53 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from :
WARNING:/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/pcap_util.h:26:10: fatal error: pcap/pcap.h: No such file or directory
WARNING: 26 | #include <pcap/pcap.h>
WARNING: | ^~~~~~~~~~~~~
WARNING:compilation terminated.
WARNING:make: *** [runtime.mk:66: /home/sanket-teli/gsoc/p4c/build/tmpztgytoz8/build/ebpf_registry.o] Error 1
ERROR:Error 2 when executing "make -f runtime.mk -C /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime TARGET=test BPFOBJ=/home/sanket-teli/gsoc/p4c/build/tmpztgytoz8/test CFLAGS+=-DCONTROL_PLANE SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_registry.c SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_map.c SOURCES+=/home/sanket-teli/gsoc/p4c/build/tmpztgytoz8/test.c INCLUDES+=-I/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/contrib/libbpf/src".
ERROR:Failed to build the filter

  Start 297: ebpf/testdata/p4_16_samples/lpm_ebpf.p4

18/28 Test 297: ebpf/testdata/p4_16_samples/lpm_ebpf.p4 ................. Passed 0.57 sec
Start 298: ebpf/testdata/p4_16_samples/stack_ebpf.p4
19/28 Test 298: ebpf/testdata/p4_16_samples/stack_ebpf.p4 ...............***Failed 0.55 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from :
WARNING:/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/pcap_util.h:26:10: fatal error: pcap/pcap.h: No such file or directory
WARNING: 26 | #include <pcap/pcap.h>
WARNING: | ^~~~~~~~~~~~~
WARNING:compilation terminated.
WARNING:make: *** [runtime.mk:66: /home/sanket-teli/gsoc/p4c/build/tmp7atxb4fx/build/ebpf_registry.o] Error 1
ERROR:Error 2 when executing "make -f runtime.mk -C /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime TARGET=test BPFOBJ=/home/sanket-teli/gsoc/p4c/build/tmp7atxb4fx/test CFLAGS+=-DCONTROL_PLANE SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_registry.c SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_map.c SOURCES+=/home/sanket-teli/gsoc/p4c/build/tmp7atxb4fx/test.c INCLUDES+=-I/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/contrib/libbpf/src".
ERROR:Failed to build the filter

  Start 299: ebpf/testdata/p4_16_samples/switch_ebpf.p4

20/28 Test 299: ebpf/testdata/p4_16_samples/switch_ebpf.p4 ..............***Failed 0.53 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from :
WARNING:/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/pcap_util.h:26:10: fatal error: pcap/pcap.h: No such file or directory
WARNING: 26 | #include <pcap/pcap.h>
WARNING: | ^~~~~~~~~~~~~
WARNING:compilation terminated.
WARNING:make: *** [runtime.mk:66: /home/sanket-teli/gsoc/p4c/build/tmp4djr9x3f/build/ebpf_registry.o] Error 1
ERROR:Error 2 when executing "make -f runtime.mk -C /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime TARGET=test BPFOBJ=/home/sanket-teli/gsoc/p4c/build/tmp4djr9x3f/test CFLAGS+=-DCONTROL_PLANE SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_registry.c SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_map.c SOURCES+=/home/sanket-teli/gsoc/p4c/build/tmp4djr9x3f/test.c INCLUDES+=-I/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/contrib/libbpf/src".
ERROR:Failed to build the filter

  Start 300: ebpf/testdata/p4_16_samples/ternary_ebpf.p4

21/28 Test 300: ebpf/testdata/p4_16_samples/ternary_ebpf.p4 ............. Passed 0.52 sec
Start 301: ebpf/testdata/p4_16_samples/test_ebpf.p4
22/28 Test 301: ebpf/testdata/p4_16_samples/test_ebpf.p4 ................***Failed 0.60 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from :
WARNING:/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/pcap_util.h:26:10: fatal error: pcap/pcap.h: No such file or directory
WARNING: 26 | #include <pcap/pcap.h>
WARNING: | ^~~~~~~~~~~~~
WARNING:compilation terminated.
WARNING:make: *** [runtime.mk:66: /home/sanket-teli/gsoc/p4c/build/tmpre2l1jee/build/ebpf_registry.o] Error 1
ERROR:Error 2 when executing "make -f runtime.mk -C /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime TARGET=test BPFOBJ=/home/sanket-teli/gsoc/p4c/build/tmpre2l1jee/test CFLAGS+=-DCONTROL_PLANE SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_registry.c SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_map.c SOURCES+=/home/sanket-teli/gsoc/p4c/build/tmpre2l1jee/test.c INCLUDES+=-I/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/contrib/libbpf/src".
ERROR:Failed to build the filter

  Start 302: ebpf/testdata/p4_16_samples/two_ebpf.p4

23/28 Test 302: ebpf/testdata/p4_16_samples/two_ebpf.p4 .................***Failed 0.57 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from :
WARNING:/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/pcap_util.h:26:10: fatal error: pcap/pcap.h: No such file or directory
WARNING: 26 | #include <pcap/pcap.h>
WARNING: | ^~~~~~~~~~~~~
WARNING:compilation terminated.
WARNING:make: *** [runtime.mk:66: /home/sanket-teli/gsoc/p4c/build/tmplfy4ydyp/build/ebpf_registry.o] Error 1
ERROR:Error 2 when executing "make -f runtime.mk -C /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime TARGET=test BPFOBJ=/home/sanket-teli/gsoc/p4c/build/tmplfy4ydyp/test CFLAGS+=-DCONTROL_PLANE SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_registry.c SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_map.c SOURCES+=/home/sanket-teli/gsoc/p4c/build/tmplfy4ydyp/test.c INCLUDES+=-I/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/contrib/libbpf/src".
ERROR:Failed to build the filter

  Start 303: ebpf/testdata/p4_16_samples/valid_ebpf.p4

24/28 Test 303: ebpf/testdata/p4_16_samples/valid_ebpf.p4 ...............***Failed 0.57 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from :
WARNING:/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/pcap_util.h:26:10: fatal error: pcap/pcap.h: No such file or directory
WARNING: 26 | #include <pcap/pcap.h>
WARNING: | ^~~~~~~~~~~~~
WARNING:compilation terminated.
WARNING:make: *** [runtime.mk:66: /home/sanket-teli/gsoc/p4c/build/tmpzl5l76bq/build/ebpf_registry.o] Error 1
ERROR:Error 2 when executing "make -f runtime.mk -C /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime TARGET=test BPFOBJ=/home/sanket-teli/gsoc/p4c/build/tmpzl5l76bq/test CFLAGS+=-DCONTROL_PLANE SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_registry.c SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_map.c SOURCES+=/home/sanket-teli/gsoc/p4c/build/tmpzl5l76bq/test.c INCLUDES+=-I/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/contrib/libbpf/src".
ERROR:Failed to build the filter

  Start 304: ebpf/testdata/p4_16_samples/value_set_ebpf.p4

25/28 Test 304: ebpf/testdata/p4_16_samples/value_set_ebpf.p4 ...........***Failed 0.54 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from :
WARNING:/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/pcap_util.h:26:10: fatal error: pcap/pcap.h: No such file or directory
WARNING: 26 | #include <pcap/pcap.h>
WARNING: | ^~~~~~~~~~~~~
WARNING:compilation terminated.
WARNING:make: *** [runtime.mk:66: /home/sanket-teli/gsoc/p4c/build/tmpxuq093nq/build/ebpf_registry.o] Error 1
ERROR:Error 2 when executing "make -f runtime.mk -C /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime TARGET=test BPFOBJ=/home/sanket-teli/gsoc/p4c/build/tmpxuq093nq/test CFLAGS+=-DCONTROL_PLANE SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_registry.c SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_map.c SOURCES+=/home/sanket-teli/gsoc/p4c/build/tmpxuq093nq/test.c INCLUDES+=-I/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/contrib/libbpf/src".
ERROR:Failed to build the filter

  Start 305: ebpf/testdata/p4_16_samples/verify_ebpf.p4

26/28 Test 305: ebpf/testdata/p4_16_samples/verify_ebpf.p4 ..............***Failed 0.47 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from :
WARNING:/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/pcap_util.h:26:10: fatal error: pcap/pcap.h: No such file or directory
WARNING: 26 | #include <pcap/pcap.h>
WARNING: | ^~~~~~~~~~~~~
WARNING:compilation terminated.
WARNING:make: *** [runtime.mk:66: /home/sanket-teli/gsoc/p4c/build/tmpptdshtiu/build/ebpf_registry.o] Error 1
ERROR:Error 2 when executing "make -f runtime.mk -C /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime TARGET=test BPFOBJ=/home/sanket-teli/gsoc/p4c/build/tmpptdshtiu/test CFLAGS+=-DCONTROL_PLANE SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_registry.c SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_map.c SOURCES+=/home/sanket-teli/gsoc/p4c/build/tmpptdshtiu/test.c INCLUDES+=-I/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/contrib/libbpf/src".
ERROR:Failed to build the filter

  Start 307: ebpf/testdata/p4_16_samples/ebpf_checksum_extern.p4

27/28 Test 307: ebpf/testdata/p4_16_samples/ebpf_checksum_extern.p4 .....***Failed 0.60 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from :
WARNING:/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/pcap_util.h:26:10: fatal error: pcap/pcap.h: No such file or directory
WARNING: 26 | #include <pcap/pcap.h>
WARNING: | ^~~~~~~~~~~~~
WARNING:compilation terminated.
WARNING:make: *** [runtime.mk:66: /home/sanket-teli/gsoc/p4c/build/tmp2xy7p5c6/build/ebpf_registry.o] Error 1
ERROR:Error 2 when executing "make -f runtime.mk -C /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime TARGET=test BPFOBJ=/home/sanket-teli/gsoc/p4c/build/tmp2xy7p5c6/test CFLAGS+=-DCONTROL_PLANE SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_registry.c SOURCES+=/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_map.c SOURCES+=/home/sanket-teli/gsoc/p4c/build/tmp2xy7p5c6/test.c INCLUDES+=-I/home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/contrib/libbpf/src INCLUDES+=-include/home/sanket-teli/gsoc/p4c/testdata/extern_modules/extern-checksum-ebpf.c INCLUDES+=-I/home/sanket-teli/gsoc/p4c/build/tmp2xy7p5c6".
ERROR:Failed to build the filter

  Start 308: ebpf/testdata/p4_16_samples/ebpf_conntrack_extern.p4

28/28 Test 308: ebpf/testdata/p4_16_samples/ebpf_conntrack_extern.p4 .... Passed 0.69 sec

11% tests passed, 25 tests failed out of 28

Label Time Summary:
XFAIL = 1.78 secproc (3 tests)
ebpf = 15.36 sec
proc (28 tests)

Total Test time (real) = 15.49 sec

The following tests FAILED:
280 - ebpf/testdata/p4_16_samples/action_call_ebpf.p4 (Failed)
281 - ebpf/testdata/p4_16_samples/action_call_table_ebpf.p4 (Failed)
282 - ebpf/testdata/p4_16_samples/advance_ebpf.p4 (Failed)
283 - ebpf/testdata/p4_16_samples/bool_ebpf.p4 (Failed)
284 - ebpf/testdata/p4_16_samples/count_add_ebpf.p4 (Failed)
285 - ebpf/testdata/p4_16_samples/count_ebpf.p4 (Failed)
286 - ebpf/testdata/p4_16_samples/hit_ebpf.p4 (Failed)
287 - ebpf/testdata/p4_16_samples/init_ebpf.p4 (Failed)
288 - ebpf/testdata/p4_16_samples/issue2791_ebpf.p4 (Failed)
289 - ebpf/testdata/p4_16_samples/issue2793_ebpf.p4 (Failed)
290 - ebpf/testdata/p4_16_samples/issue2797_ebpf.p4 (Failed)
291 - ebpf/testdata/p4_16_samples/issue2816-1_ebpf.p4 (Failed)
292 - ebpf/testdata/p4_16_samples/issue2816_ebpf.p4 (Failed)
293 - ebpf/testdata/p4_16_samples/issue870_ebpf.p4 (Failed)
294 - ebpf/testdata/p4_16_samples/key-issue-1020_ebpf.p4 (Failed)
295 - ebpf/testdata/p4_16_samples/key_ebpf.p4 (Failed)
296 - ebpf/testdata/p4_16_samples/length_ebpf.p4 (Failed)
298 - ebpf/testdata/p4_16_samples/stack_ebpf.p4 (Failed)
299 - ebpf/testdata/p4_16_samples/switch_ebpf.p4 (Failed)
301 - ebpf/testdata/p4_16_samples/test_ebpf.p4 (Failed)
302 - ebpf/testdata/p4_16_samples/two_ebpf.p4 (Failed)
303 - ebpf/testdata/p4_16_samples/valid_ebpf.p4 (Failed)
304 - ebpf/testdata/p4_16_samples/value_set_ebpf.p4 (Failed)
305 - ebpf/testdata/p4_16_samples/verify_ebpf.p4 (Failed)
307 - ebpf/testdata/p4_16_samples/ebpf_checksum_extern.p4 (Failed)
Errors while running CTest

@fruffy
Copy link
Collaborator Author

fruffy commented Mar 16, 2024

Please format the comment so it does not accidentally reference other issues.

But it looks like the failures are coming from pcap not being installed, so they are directly related to the problem in this issue. The eBPF back end tests should not be run if these dependencies are missing.

@Sanket-0510
Copy link
Contributor

I think I understood what needs to be done here, I would like to work on this issue.

@ParthShitole
Copy link

Can I work on this?

@fruffy
Copy link
Collaborator Author

fruffy commented Oct 18, 2024

Sure! The context of this issue is #4132. The packages should be part of the eBPF CMake instead.

@ParthShitole
Copy link

ParthShitole commented Oct 19, 2024

@fruffy I am planning to modify CMakeLists.txt for each backend and check for the dependencies, if any of the dependency is not present, we skip the test and give out a warning message

check_dependency(Pcap)  

if (NOT Pcap_FOUND)
    message(WARNING "eBPF backend tests skipped due to missing pcap dependency.")
    return()  
endif()

I will make a module to check dependencies in the root CMakeLists.txt file and reuse it for general context.

Should I go forward with this approach

@fruffy
Copy link
Collaborator Author

fruffy commented Oct 19, 2024

Yes, that sounds good! Make sure the return() works as intended.

There is probably a couple more dependencies like that:

tcpdump libpcap-dev gcc-multilib for example. Where tcpdump is actually a binary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This topic discusses an improvement to existing compiler code. good-first-issue An issue that could be solved by someone new to the code base.
Projects
None yet
Development

No branches or pull requests

3 participants