Bug 1028980 - libguestfs rpmbuild --rebuild fails with: Only one of PREFIX or INSTALL_BASE can be given. Not both.
libguestfs rpmbuild --rebuild fails with: Only one of PREFIX or INSTALL_BASE ...
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs (Show other bugs)
7.0
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Richard W.M. Jones
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-11 07:11 EST by Richard W.M. Jones
Modified: 2013-11-20 04:12 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-11-20 04:12:36 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
configure.log (54.94 KB, text/plain)
2013-11-11 07:12 EST, Richard W.M. Jones
no flags Details
make.log (83.21 KB, text/plain)
2013-11-11 07:13 EST, Richard W.M. Jones
no flags Details
rebuild.log (386.82 KB, text/plain)
2013-11-11 07:13 EST, Richard W.M. Jones
no flags Details
build log (18.50 KB, text/plain)
2013-11-12 08:57 EST, bfan
no flags Details
the whole logs (1.10 MB, text/plain)
2013-11-12 10:23 EST, bfan
no flags Details

  None (edit)
Description Richard W.M. Jones 2013-11-11 07:11:23 EST
Description of problem:

Bo Fan could not rebuild libguestfs and got the error:

> perl /home/mockbuild/rpmbuild/BUILD/libguestfs-1.22.6/perl/Makefile.PL \
>       INSTALLDIRS=vendor PREFIX=/usr
> ! test -f ../generator/Makefile || \
>   make -C ../generator stamp-generator
> make[3]: Entering directory `/home/mockbuild/rpmbuild/BUILD/libguestfs-1.22.6\
/generator'
> make[3]: `stamp-generator' is up to date.
> make[3]: Leaving directory `/home/mockbuild/rpmbuild/BUILD/libguestfs-1.22.6/\
generator'
> Only one of PREFIX or INSTALL_BASE can be given.  Not both.

This error makes no sense because INSTALL_BASE is not specified.
Also I could not reproduce this.

Version-Release number of selected component (if applicable):

1.22.6-15.el7
Comment 1 Richard W.M. Jones 2013-11-11 07:12:45 EST
Created attachment 822377 [details]
configure.log
Comment 2 Richard W.M. Jones 2013-11-11 07:13:17 EST
Created attachment 822378 [details]
make.log
Comment 3 Richard W.M. Jones 2013-11-11 07:13:50 EST
Created attachment 822379 [details]
rebuild.log
Comment 5 bfan 2013-11-12 08:57:21 EST
Thanks for your help via email,

I find a weird environment value 'PERL_MM_OPT=INSTALL_BASE=/home/mockbuild/perl5' in my host, so I set it to PERL_MM_OPT=/home/mockbuild/perl5

build process can continue, but finally failed due to
"RPM build errors:
    File not found by glob: /home/mockbuild/rpmbuild/BUILDROOT/libguestfs-1.22.6-15.el7.x86_64/usr/lib/python2.7/site-packages/*.pyc
    File not found by glob: /home/mockbuild/rpmbuild/BUILDROOT/libguestfs-1.22.6-15.el7.x86_64/usr/lib/python2.7/site-packages/*.pyo
"

I cut the end of build log and attached
Comment 6 bfan 2013-11-12 08:57:53 EST
Created attachment 822991 [details]
build log
Comment 7 Richard W.M. Jones 2013-11-12 09:14:54 EST
(In reply to bfan from comment #5)
> Thanks for your help via email,
> 
> I find a weird environment value
> 'PERL_MM_OPT=INSTALL_BASE=/home/mockbuild/perl5' in my host, so I set it to
> PERL_MM_OPT=/home/mockbuild/perl5
> 
> build process can continue, but finally failed due to
> "RPM build errors:
>     File not found by glob:
> /home/mockbuild/rpmbuild/BUILDROOT/libguestfs-1.22.6-15.el7.x86_64/usr/lib/
> python2.7/site-packages/*.pyc
>     File not found by glob:
> /home/mockbuild/rpmbuild/BUILDROOT/libguestfs-1.22.6-15.el7.x86_64/usr/lib/
> python2.7/site-packages/*.pyo
> "

These files (compiled Python bytecode) are generated by RPM.  If
you look at a typical successful build log upstream, eg:

http://kojipkgs.fedoraproject.org//packages/libguestfs/1.25.7/1.fc21/data/logs/x86_64/build.log

then you will see:

+ /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1
Bytecompiling .py files below /builddir/build/BUILDROOT/libguestfs-1.25.7-1.fc21.x86_64/usr/lib/python2.7/ using /usr/bin/python2.7
Bytecompiling .py files below /builddir/build/BUILDROOT/libguestfs-1.25.7-1.fc21.x86_64/usr/lib64/python2.7/ using /usr/bin/python2.7

The brp-python-bytecompile program is what generates these
files.  If brp-python-bytecompile is missing/broken then
these files don't get generated and the build would fail.

> I cut the end of build log and attached

As usual, I need to see the whole log, not parts of it.
In this case I cannot see any reference to brp-python-bytecompile
but I'm not sure if that occurred earlier, or if it's just
not installed.

My suggestion:

# yum install /usr/lib/rpm/brp-python-bytecompile
Comment 8 bfan 2013-11-12 10:23:31 EST
brp-python-bytecompile is installed

$ ls /usr/lib/rpm/brp-
brp-compress              brp-python-bytecompile    brp-strip                 brp-strip-shared
brp-java-gcjcompile       brp-python-hardlink       brp-strip-comment-note    brp-strip-static-archive

How can I tell it works but not broken, I run /usr/lib/rpm/brp-python-bytecompile , nothing returned without error 

I compare the upstream logs to mine, I just find in my logs
+ /usr/lib/rpm/brp-compress
+ /usr/lib/rpm/brp-strip /usr/bin/strip
+ /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump

attach the whole logs
Comment 9 bfan 2013-11-12 10:23:54 EST
Created attachment 823021 [details]
the whole logs
Comment 10 Richard W.M. Jones 2013-11-12 10:47:18 EST
The way this works is:

After installation, the RPM macro __os_install_post runs.  This
macro contains a call to brp-python-bytecompile hard wired.

You can find out what your macro contains by doing:

$ rpm --eval '%{__os_install_post}'

    /usr/lib/rpm/redhat/brp-compress 
    
    /usr/lib/rpm/redhat/brp-strip /usr/bin/strip 
    /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump 
     
    /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip 
    /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1 
    /usr/lib/rpm/redhat/brp-python-hardlink 
    /usr/lib/rpm/redhat/brp-java-repack-jars 

(for me)

Now, there are two possibilities here:

(1) You don't have redhat-rpm-config package installed.  This
seems most likely.

(2) You have overridden this macro in your ~/.rpmmacros.
Comment 11 bfan 2013-11-13 08:52:27 EST
Yes, build passed after I installed redhat-rpm-config package. Thanks very much
Comment 12 Richard W.M. Jones 2013-11-20 04:12:36 EST
Closing as NOTABUG, but please see this thread:
https://lists.fedoraproject.org/pipermail/devel/2013-November/thread.html#191994

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