<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>11906</bug_id>
          
          <creation_ts>2017-08-08 02:49:14 +0000</creation_ts>
          <short_desc>rpmbuild: Can not build packages on qemu target</short_desc>
          <delta_ts>2021-09-20 22:59:50 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>devtools / tool chain</component>
          <version>2.4</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>4.0 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jackie Huang">jackie.huang</reporter>
          <assigned_to name="Unassigned">unassigned</assigned_to>
          <cc>alex.kanavin</cc>
    
    <cc>ee.peng.yeoh</cc>
    
    <cc>hongxu.jia</cc>
    
    <cc>liezhi.yang</cc>
    
    <cc>mark.hatle</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>75709</commentid>
    <comment_count>0</comment_count>
    <who name="Jackie Huang">jackie.huang</who>
    <bug_when>2017-08-08 02:49:14 +0000</bug_when>
    <thetext>I tried to build a SRPM from fedora but failed with:

=============
checking for gcc... gcc
checking whether the C compiler (gcc %optflags ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.
error: Bad exit status from /var/tmp/rpm-tmp.mcuBTq (%build)

RPM build errors:
    Could not canonicalize hostname: qemux86-64
    Bad exit status from /var/tmp/rpm-tmp.mcuBTq (%build)
============

Steps to reproduce:
1) add in local.conf:
IMAGE_INSTALL_append += &quot;packagegroup-core-buildessential&quot;

2) build sato image:
bitbake core-image-sato

3) start qemu:
runqemu qemux86-64 nographic

4) get srpm from fedora and try to build:

root@qemux86-64:~# wget http://archive.fedoraproject.org/pub/archive/fedora/linux/releases/22/Everything/source/SRPMS/d/daemonize-1.7.3-7.fc22.src.rpm

root@qemux86-64:~# rpm -ivh daemonize-1.7.3-7.fc22.src.rpm
warning: daemonize-1.7.3-7.fc22.src.rpm: Header V3 RSA/SHA256 Signature, key ID 8e1431d5: NOKEY
Updating / installing...
   1:daemonize-1.7.3-7.fc22           warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
################################# [100%]

root@qemux86-64:~# rpmbuild -ba -v rpmbuild/SPECS/daemonize.spec
warning: Could not canonicalize hostname: qemux86-64
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.5GlH38
+ umask 022
+ cd /home/root/rpmbuild/BUILD
+ cd /home/root/rpmbuild/BUILD
+ rm -rf bmc-daemonize-8c9856b
+ /bin/gzip -dc /home/root/rpmbuild/SOURCES/daemonize-1.7.3.tar.gz
+ /bin/tar -xof -
+ STATUS=0
+ &apos;[&apos; 0 -ne 0 &apos;]&apos;
+ cd bmc-daemonize-8c9856b
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.mcuBTq
+ umask 022
+ cd /home/root/rpmbuild/BUILD
+ cd bmc-daemonize-8c9856b
+ CFLAGS=%optflags
+ export CFLAGS
+ CXXFLAGS=%optflags
+ export CXXFLAGS
+ FFLAGS=%optflags
+ export FFLAGS
+ ./configure --host=x86_64-poky-linux-gnu --build=x86_64-poky-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/usr/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info
creating cache ./config.cache
checking for gcc... gcc
checking whether the C compiler (gcc %optflags ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.
error: Bad exit status from /var/tmp/rpm-tmp.mcuBTq (%build)


RPM build errors:
    Could not canonicalize hostname: qemux86-64
    Bad exit status from /var/tmp/rpm-tmp.mcuBTq (%build)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75710</commentid>
    <comment_count>1</comment_count>
    <who name="Jackie Huang">jackie.huang</who>
    <bug_when>2017-08-08 02:57:26 +0000</bug_when>
    <thetext>If I change the platform as the following, it builds with some warnings:
root@qemux86-64:~# diff /etc/rpm/platform_orig /etc/rpm/platform
1c1
&lt; qemux86_64-pc-linux
---
&gt; x86_64-pc-linux

root@qemux86-64:~# rpmbuild -ba -v rpmbuild/SPECS/daemonize.spec
sh: line 1: /usr/bin/getconf: No such file or directory
sh: line 4: [: : integer expression expected
warning: Could not canonicalize hostname: qemux86-64
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.wD5ziH

(...detail logs omitted...)

+ umask 022
+ cd /home/root/rpmbuild/BUILD
+ cd bmc-daemonize-8c9856b
+ rm -rf /home/root/rpmbuild/BUILDROOT/daemonize-1.7.3-7.x86_64
+ exit 0

root@qemux86-64:~# ls rpmbuild/RPMS/x86_64/daemonize-1.7.3-7.x86_64.rpm
rpmbuild/RPMS/x86_64/daemonize-1.7.3-7.x86_64.rpm

root@qemux86-64:~# rpm -ivh rpmbuild/RPMS/x86_64/daemonize-1.7.3-7.x86_64.rpm
error: Failed dependencies:
        libc.so.6()(64bit) is needed by daemonize-1.7.3-7.x86_64
        libc.so.6(GLIBC_2.2.5)(64bit) is needed by daemonize-1.7.3-7.x86_64</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75725</commentid>
    <comment_count>2</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2017-08-08 15:08:43 +0000</bug_when>
    <thetext>I updated the title to indicate that the first problem encountered is qemu specific.

Given that we don&apos;t have the right libc to allow building a fedora22 src.rpm, I&apos;d suggest that the right solution there would be to install a fedora22 container.

Jackie, 
   Can you try building a src.rpm for a newer fedora where libc versions match?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75728</commentid>
    <comment_count>3</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2017-08-08 15:19:33 +0000</bug_when>
    <thetext>Randy, the request is the ability to use the natively provided RPM resources on the target.

In this case, the failures are due to RPM(4) setup, including:

* Hostname issue:
warning: Could not canonicalize hostname: qemux86-64

* Invalid calls:
sh: line 1: /usr/bin/getconf: No such file or directory
sh: line 4: [: : integer expression expected

* Missing/incorrect RPM macro definitions:
(optflags is not defined)
+ CFLAGS=%optflags
+ export CFLAGS
+ CXXFLAGS=%optflags
+ export CXXFLAGS
+ FFLAGS=%optflags
+ export FFLAGS

I&apos;m sure we will encounter other issues, but at this time it&apos;s not related to the compiler, libc.  Once we can get through the initial RPM configuration and rpmbuild runtime issues -- then we can focus on compilation problems.  (If we do encounter fedora or similar specific issues -- this won&apos;t be a Yocto Project bug any longer IMHO.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75739</commentid>
    <comment_count>4</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2017-08-08 18:49:46 +0000</bug_when>
    <thetext>I assumed that the libc version mismatch was coming from the src.rpm but maybe it isn&apos;t. Jackie can investigate a little but if there is a huge number of tricky dependencies to fix, it&apos;s tempting to leave this to 2.5. Keep us posted please Jackie.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75741</commentid>
    <comment_count>5</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2017-08-08 18:57:31 +0000</bug_when>
    <thetext>The libc dependencies may be a different bug.

RPM5 properly recorded the RPM dependencies during the build process.  Early on in the RPM4 work it was shown this was missing, but was supposed to have been corrected by the time Pyro (2.3) was released.

The easiest way to check:

rpm -q &lt;libc providing package&gt; --provides

You SHOULD see things like:

libc.so.6()(64bit)

if you do not, then we have a significantly more serious bug.  (Which should be opened as a new defect.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75744</commentid>
    <comment_count>6</comment_count>
    <who name="Alexander Kanavin">alex.kanavin</who>
    <bug_when>2017-08-08 19:48:32 +0000</bug_when>
    <thetext>I&apos;m not sure why not being able to build srpms from foreign linux distros is seen as a bug. We never claimed to support it, and there&apos;s far too many things that can go wrong and other mismatches in spec files and elsewhere.

I can see how getting Fedora software into a Yocto image without having to write Yocto recipes can be useful, but making it work reliably is a major task, and too big for a bugzilla ticket IMO.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75745</commentid>
    <comment_count>7</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2017-08-08 20:03:47 +0000</bug_when>
    <thetext>Being able to build SRPMs is a feature that a lot of people want.

being able to start with a Fedora (or similar) SRPM is strongly desired as it lowers the barrier for most people to add something quickly to their system.  I do not expect the pieces of software to work without any modifications.. but if the modifications are minor this certainly simplifies things.

Issues like incorrect dependencies (if that is indeed a problem) is different from &apos;Yocto Project uses a different name&apos; issues.

Similarly around path differences and such.  All of those, I would expect the person trying to make it work to have to &apos;do something&apos; to resolve.


But macro definitions, default dependency settings, etc should all be there, and did work in the past.

This bug is about being able to build -an- SRPM.  The example happens to be a Fedora SRPM, but at this point it doesn&apos;t matter if it&apos;s Fedora or something else.

The various pieces of an SRPM spec file need to function properly, including the machine/hostname identification, optflags, calls to external utilities (made by RPM, not the package), and dependencies automatically instantiated by RPM&apos;s rpmbuild.

If this basic functionality does not work, then there is a gap in the configuration of RPM4.  (Each of those did work with RPM5 before.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75758</commentid>
    <comment_count>8</comment_count>
    <who name="Alexander Kanavin">alex.kanavin</who>
    <bug_when>2017-08-09 04:59:49 +0000</bug_when>
    <thetext>Fair enough, but then you should be not be starting with a Fedora srpm. Take a srpm produced from an oe-core recipe via archiver.bbclass and make that work first.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89559</commentid>
    <comment_count>9</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2021-03-09 19:26:57 +0000</bug_when>
    <thetext>Its an enhancement so move to 3.4M1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91485</commentid>
    <comment_count>10</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2021-09-20 22:59:50 +0000</bug_when>
    <thetext>I&apos;m not aware of anyone left who wants to work on this. Closing as something we don&apos;t plan to do.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>