diff options
author | Jakub Sitnicki <jakub@cloudflare.com> | 2019-10-20 14:23:44 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-10-21 04:21:21 +0300 |
commit | ab81e203bc0d4a4542bca2498535f8761a3cfd92 (patch) | |
tree | 026ff65fd5b453ef4e73a4281671ac45ae1d0da1 /scripts | |
parent | 54b8625cd940b6baace0bd9b1cf26b2de68ba307 (diff) | |
download | linux-ab81e203bc0d4a4542bca2498535f8761a3cfd92.tar.xz |
scripts/bpf: Print an error when known types list needs updating
Don't generate a broken bpf_helper_defs.h header if the helper script needs
updating because it doesn't recognize a newly added type. Instead print an
error that explains why the build is failing, clean up the partially
generated header and stop.
v1->v2:
- Switched from temporary file to .DELETE_ON_ERROR.
Fixes: 456a513bb5d4 ("scripts/bpf: Emit an #error directive known types list needs updating")
Suggested-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20191020112344.19395-1-jakub@cloudflare.com
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/bpf_helpers_doc.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/bpf_helpers_doc.py b/scripts/bpf_helpers_doc.py index 08300bc024da..7548569e8076 100755 --- a/scripts/bpf_helpers_doc.py +++ b/scripts/bpf_helpers_doc.py @@ -488,8 +488,8 @@ class PrinterHelpers(Printer): return t if t in self.mapped_types: return self.mapped_types[t] - print("") - print("#error \"Unrecognized type '%s', please add it to known types!\"" % t) + print("Unrecognized type '%s', please add it to known types!" % t, + file=sys.stderr) sys.exit(1) seen_helpers = set() |