Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1442015 - rpmbuild: a way to request that /var/rpm/rpm-tmp* files are not removed
Summary: rpmbuild: a way to request that /var/rpm/rpm-tmp* files are not removed
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 27
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-04-13 10:23 UTC by Pavel Raiskup
Modified: 2017-09-30 06:20 UTC (History)
6 users (show)

Fixed In Version: rpm-4.14.0-0.rc1.1.fc27
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-09-30 06:20:07 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1443038 0 unspecified CLOSED always eat the whole stdin by /usr/lib/rpm/scldeps.sh 2022-05-16 11:32:56 UTC

Internal Links: 1443038

Description Pavel Raiskup 2017-04-13 10:23:46 UTC
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?

Comment 1 Panu Matilainen 2017-05-23 10:15:15 UTC
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.

Comment 2 Jan Kurik 2017-08-15 08:41:01 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle.
Changing version to '27'.

Comment 4 Fedora Update System 2017-09-07 07:31:27 UTC
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

Comment 5 Fedora Update System 2017-09-07 14:33:35 UTC
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

Comment 6 Fedora Update System 2017-09-30 06:20:07 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.