Skip to content

Commit 6404d6f

Browse files
committed
Makefile: Print diff for BPF skeleton files
I was hitting an issue where I would run 'make' and it would just fail out like: $ make V=0 ... GEN bpf/../pkg/datapath/types GEN bpf/../pkg/datapath/config GEN bpf/../pkg/datapath/maps GEN bpf/../pkg/datapath/bpf make: Leaving directory '/go/src/github.com/cilium/cilium/bpf' c706c5a9620a7cd97409c69ee6e052b61e9094c1c8278d69834285ddd7dd1d52 please run 'make generate-bpf' and submit your changes make: *** [Makefile:510: precheck] Error 1 But if I ran make generate-bpf, it wouldn't generate a diff: $ make generate-bpf V=0 DOCKER generate-bpf 7d9a426f066e8a7effd17434d31c3818583797488e75b33ef30b42f8ea4c08a7 make: Entering directory '/go/src/github.com/cilium/cilium/bpf' GEN bpf/../pkg/datapath/types GEN bpf/../pkg/datapath/config GEN bpf/../pkg/datapath/maps GEN bpf/../pkg/datapath/bpf make: Leaving directory '/go/src/github.com/cilium/cilium/bpf' 7d9a426f066e8a7effd17434d31c3818583797488e75b33ef30b42f8ea4c08a7 $ git diff $ git diff --cached $ Improve the debuggability by always doing a check and echoing the files that may conflict. Technically this should maybe be tied into the script './contrib/scripts/check-datapathconfig.sh', but by putting it in this target we can retain the consistent quiet make output without adding extra custom logic into that script. Result: $ make generate-bpf DOCKER generate-bpf 6cad562da3cf20b0a38092a5ddb02a5f45b426a8e4f1c55658628bb580c6eac1 make: Entering directory '/go/src/github.com/cilium/cilium/bpf' GEN bpf/../pkg/datapath/types GEN bpf/../pkg/datapath/config GEN bpf/../pkg/datapath/maps GEN bpf/../pkg/datapath/bpf make: Leaving directory '/go/src/github.com/cilium/cilium/bpf' 6cad562da3cf20b0a38092a5ddb02a5f45b426a8e4f1c55658628bb580c6eac1 CHECK bpf-skel ?? pkg/my-dirty-file Signed-off-by: Joe Stringer <joe@cilium.io>
1 parent 437a6d7 commit 6404d6f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,8 @@ generate-bpf: ## Generate config structs from BPF objects using dpgen and Go ske
405405
@$(ECHO_DOCKER)
406406
contrib/scripts/builder.sh \
407407
$(MAKE_CONTAINER) -C /go/src/github.com/cilium/cilium/bpf generate V=$(V)
408+
@$(ECHO_CHECK) bpf-skel
409+
$(QUIET)git status bpf/ pkg/ --porcelain
408410

409411
check-k8s-clusterrole: ## Ensures there is no diff between preflight's clusterrole and runtime's clusterrole.
410412
./contrib/scripts/check-preflight-clusterrole.sh

0 commit comments

Comments
 (0)