I try to debug build failure of one SCL package, and I keep hearing this error output: Processing files: sclo-postgresql96-runtime-3.0-2.fc27.x86_64 Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.6wkbfE + umask 022 + cd /builddir/build/BUILD + cd sclo-postgresql96-3.0 + DOCDIR=/builddir/build/BUILDROOT/sclo-postgresql96-3.0-2.fc27.x86_64/opt/rh/sclo-postgresql96/root/usr/share/doc/sclo-postgresql96-runtime + export DOCDIR + /usr/bin/mkdir -p /builddir/build/BUILDROOT/sclo-postgresql96-3.0-2.fc27.x86_64/opt/rh/sclo-postgresql96/root/usr/share/doc/sclo-postgresql96-runtime + cp -pr README /builddir/build/BUILDROOT/sclo-postgresql96-3.0-2.fc27.x86_64/opt/rh/sclo-postgresql96/root/usr/share/doc/sclo-postgresql96-runtime + cp -pr LICENSE /builddir/build/BUILDROOT/sclo-postgresql96-3.0-2.fc27.x86_64/opt/rh/sclo-postgresql96/root/usr/share/doc/sclo-postgresql96-runtime + exit 0 ERROR: Exception(intermediate-srpm/sclo-postgresql96-3.0-2.fc27.src.rpm) Config(praiskup-sclo-postgresql96_fedora-rawhide-x86_64) 1 minutes 28 seconds INFO: Results and/or logs in: /var/lib/copr-builder/results INFO: Cleaning up build root ('cleanup_on_failure=True') Start: clean chroot It is not clear to me where the "Exception" comes from ... more on that, this is not reproducible on my box in fedora-rawhide mock chroot, but on only in cloud disposable VM. It might help or it might not, I'd like to see the contents of /var/tmp/rpm-tmp.6wkbfE file, but that file is immediately removed after build failure (perhaps because there's exit 0 after all).. having a look at rpm code, there's: https://github.com/rpm-software-management/rpm/blob/054f3ce53ce71dfdcae5559aa4a7f9cbb1df9bae/lib/rpmscript.c#L402 But perhaps there's no way to 'rpmSetVerbosity(RPMLOG_DEBUG)' in rpmbulid.c. Can we add some option for it (so I don't have to rebulid and re-install rpm?
https://github.com/rpm-software-management/rpm/blob/054f3ce53ce71dfdcae5559aa4a7f9cbb1df9bae/build/build.c#L53 is what runs the build-side scripts, not rpmscript.c. The build-side only cleans up scripts which exited succesfully, see https://github.com/rpm-software-management/rpm/blob/054f3ce53ce71dfdcae5559aa4a7f9cbb1df9bae/build/build.c#L188: if (scriptName) { if (rc == RPMRC_OK) (void) unlink(scriptName); free(scriptName); } So technically there is a way: exit non-zero from scriptlet.
This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle. Changing version to '27'.
Implemented upstream: https://github.com/rpm-software-management/rpm/commit/ee33773218d5bda08a32c3775101b8aa211f2b13
rpm-4.14.0-0.rc1.1.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-b46d2f3c29
rpm-4.14.0-0.rc1.1.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-b46d2f3c29
rpm-4.14.0-0.rc1.1.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.