]> git.baikalelectronics.ru Git - kernel.git/commit
tools, build: Propagate build failures from tools/build/Makefile.build
authorAndrii Nakryiko <andriin@fb.com>
Fri, 31 Jul 2020 02:42:44 +0000 (19:42 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 3 Aug 2020 14:15:40 +0000 (16:15 +0200)
commit77e54e2701b1c038e5697c828a00806a506385cc
tree4c5ba1ba7722c3858ad4d4c90f7a1e4e01c5a5cf
parent334c54b4d3f5165335c5d68cffdbd879b46fb219
tools, build: Propagate build failures from tools/build/Makefile.build

The '&&' command seems to have a bad effect when $(cmd_$(1)) exits with
non-zero effect: the command failure is masked (despite `set -e`) and all but
the first command of $(dep-cmd) is executed (successfully, as they are mostly
printfs), thus overall returning 0 in the end.

This means in practice that despite compilation errors, tools's build Makefile
will return success. We see this very reliably with libbpf's Makefile, which
doesn't get compilation error propagated properly. This in turns causes issues
with selftests build, as well as bpftool and other projects that rely on
building libbpf.

The fix is simple: don't use &&. Given `set -e`, we don't need to chain
commands with &&. The shell will exit on first failure, giving desired
behavior and propagating error properly.

Fixes: d7b5f6bdd765 ("tools build: Move dependency copy into function")
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Link: https://lore.kernel.org/bpf/20200731024244.872574-1-andriin@fb.com
tools/build/Build.include