History

scripts/jobserver-exec: propagate child exit status

main() called JobserverExec().run() and discarded its return value, then the script exited with the implicit status 0. As a result, any Makefile that wired a build step through jobserver-exec saw the step silently succeed even when the wrapped command had failed. Two in-tree callers were affected: Documentation/devicetree/bindings/Makefile cmd_chk_style runs a python checker via jobserver-exec and uses "&& touch $@ || true" so failures leave the stamp file untouched and the next make rerun reports them again. The swallowed exit code made the stamp file get created even on failure, caching the failed run and hiding the reported issues until the inputs change. scripts/Makefile.vmlinux_o cmd_gen_initcalls_lds runs scripts/generate_initcall_order.pl via jobserver-exec; a perl failure was masked by the wrapper. Return the subprocess exit code from main() and pass it to sys.exit() so the wrapped command's status reaches make.

Daniel Golle committed 5 months ago

Commit 28019881 parent 1e8a9af1 file · +2 −2Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/jobserver-exec+2−2
@@ -28,8 +28,8 @@ def main(): · 27 unmodified lines
2828 sys.exit("usage: " + name +" command [args ...]\n" + __doc__)
2929
3030 with JobserverExec() as jobserver:
31− jobserver.run(sys.argv[1:])
31+ return jobserver.run(sys.argv[1:])
3232
3333
3434 if __name__ == "__main__":
35− main()
35+ sys.exit(main())

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t