-
Notifications
You must be signed in to change notification settings - Fork 217
rpm: make_rpm.py fails with exit code = 0 when rpmbuild fails #1023
Copy link
Copy link
Closed
Description
Instead of failing "directly", make_rpm.py will exit 0 and then bazel will complain that the outputs were not created:
INFO: From MakeRpm MyRpm/MyRpm-1.0.6.x86_64.rpm:
some rpmbuild failure...
ERROR: /src/MyRpm/BUILD.bazel:77:12: output 'MyRpm/MyRpm-1.0.6.x86_64.rpm' was not created
ERROR: /src/MyRpm/BUILD.bazel:77:12: output 'MyRpm/MyRpm-lib-1.0.6.x86_64.rpm' was not created
ERROR: /src/MyRpm/BUILD.bazel:77:12: MakeRpm MyRpm/MyRpm-1.0.6.x86_64.rpm failed: not all outputs were created or validIt seems better to exit non-zero on failure so that bazel can report it directly instead of just by virtue of not finding the output files, e.g.:
INFO: Analyzed target //MyRpm:rpm (1 packages loaded, 5143 targets configured).
ERROR: /src/MyRpm/BUILD.bazel:77:12: MakeRpm MyRpm/MyRpm-1.0.6.x86_64.rpm failed: (Exit 1): make_rpm failed: error executing MakeRpm command (from target //MyRpm:rpm) bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/rules_pkg+/pkg/make_rpm\
'--name=MyRpm' '--rpmbuild=bazel-out/k8-opt-exec-ST-d57f47055a04/bin/BazAr/packaging/rpm/rpmbuild' '--debuginfo_type=centos' ... (remaining 37 arguments skipped)
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
some rpmbuild failure...
bazel: Leaving directory `/tmp/bazel_output/f8087e59fd95af1ae29e8fcb7ff1a3dc/execroot/_main/'
Target //MyRpm:rpm failed to buildThe latter output is when I hacked make_rpm.py to just fail directly, e.g.
if __name__ == '__main__':
print("some rpmbuild failure...")
sys.exit(1)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels