Commit 6404d6f
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
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
| 408 | + | |
| 409 | + | |
408 | 410 | | |
409 | 411 | | |
410 | 412 | | |
| |||
0 commit comments