[Fedora-packaging] Re: Call rpm during rpmbuild

Tom "spot" Callaway tcallawa at redhat.com
Tue Jun 5 15:14:20 UTC 2007


On Tue, 2007-06-05 at 10:14 -0500, Rex Dieter wrote:
> Axel Thimm wrote:
> > On Tue, Jun 05, 2007 at 08:35:00AM -0500, Rex Dieter wrote:
> >> Richard W.M. Jones wrote:
> >>> I'm right in thinking that it's bad to call rpm from rpmbuild?
> >> Yes.
> > 
> > But weren't recursive rpm calls fixed many, many years ago, so that
> > this is fine to use since ??? (hopefully including RHEL3)?
> 
> Stop the heresy, you'll raise spot's blood-pressure... :)
> 
> In practice, it may or may not work (not more often than not, in 
> chroot'd buildroots), but it's best to simply say "just don't do it".

FWIW, I asked Panu about this, and this was his reply:

For the casual "rpmbuild -ba foo.spec" usage, querying from within a
build is what I consider "mostly harmless". However in the Fedora
context, where packages will be built within a chroot with no guarantees
about the rpm version outside vs inside the chroot, it WILL break sooner
or later due to db environment mismatch. Eg if RHEL 4 was used as the
build host, in FC[567] (or thereabouts) chroot the query would fail.

Mock *could* of course clear the environment (the infamous 'rm -f 
/var/lib/rpm/__*') before entering the chroot and after exiting it to 
avoid the issue. Or one could configure them to use DB_PRIVATE locking, 
but lets not go there... :)

*****

So, basically, don't do it. We can't be sure it is safe, or predictable,
and we know there are at least some failure cases.

~spot, breathing calmly, slowly




More information about the Fedora-packaging mailing list