p4lang / p4c

P4_16 reference compiler
https://p4.org/
Apache License 2.0
681 stars 445 forks source link

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

Open fruffy opened 8 months ago

fruffy commented 8 months ago

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.

Sanket-0510 commented 8 months ago

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 commented 8 months ago

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

Sanket-0510 commented 8 months ago

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 secproc (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 commented 8 months ago

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 commented 8 months ago

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

ParthShitole commented 1 month ago

Can I work on this?

fruffy commented 1 month ago

Sure! The context of this issue is https://github.com/p4lang/p4c/pull/4132. The packages should be part of the eBPF CMake instead.

ParthShitole commented 1 month ago

@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 commented 1 month ago

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.