Bug 237142 - x86_64 mock can't build i386 SRPMs (doesn't read ~/.rpmmacros)
Summary: x86_64 mock can't build i386 SRPMs (doesn't read ~/.rpmmacros)
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora Hosted Projects
Classification: Retired
Component: mock
Version: unspecified
Hardware: i386
OS: Linux
medium
high
Target Milestone: ---
Assignee: Clark Williams
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-04-19 17:25 UTC by Carl Roth
Modified: 2013-01-10 04:16 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2007-04-22 16:04:16 UTC
Embargoed:


Attachments (Terms of Use)

Description Carl Roth 2007-04-19 17:25:33 UTC
Description of problem:

My mock builds are failing with the error

error: cannot write to %sourcedir /usr/src/redhat/SOURCES

I'm trying to build i386 SRPMS on an x86_64 platform.  That is, I'm on an x86_64
host, and I'm using one of the i386 mock configurations.

I used the mock shell feature to try to interactively query the chroot
environment, and I determined that the 'rpm' command is not reading the
mockbuild's local '.rpmmacros' file, which is necessary to override the default
RPM %_topdir.

For example:

  $ mock ... shell

  mock-chroot> rpm --eval '%_topdir'
  /usr/src/redhat

  mock-chroot> export HOME=/builddir
  mock-chroot> rpm --eval '%_topdir'
  /usr/src/redhat
  ^^^^^^^^^^^^^^^

This second example should have printed out '/builddir/build' instead.

I tried debugging the rpm command (by installing 'gdb' and 'rpm-debuginfo.i386'
into the chroot), but gdb isn't able to run for mysterious reasons:

    thread_get_info_callback: cannot get thread info: generic error

Then I tried using 'strace' to see if the .rpmmacros file is getting read.  When
I run the command under strace I see that 1) the file is getting read in, and 2)
the *correct result* is being printed.  Yikes!

This is reproducable, even after a 'mock init' that rebuilds the chroot.

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

mock-0.6.11-1.fc6

How reproducible:

Always

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Other configurations that I tested:

* an x86_64 host, running in an x86_64 chroot environment, works correctly.
* an i386 host, running in an i386 chroot environment, works correctly.

What's the story here?  Are x86_64/i386 cross-builds supported?

Comment 1 Nalin Dahyabhai 2007-04-20 20:07:21 UTC
I use mock from Raw Hide (the changelog suggests that the version skew doesn't
change this) like so:
  setarch i386 mock -r fedora-devel-i386-core src.rpm
and it works quite well.

Comment 2 Carl Roth 2007-04-22 16:04:16 UTC
Thanks for the tip.  I wasn't using 'setarch'; I was assuming that mock would do
the right thing and invoke it for me.  I guess that technically this is not a
bug as I have described it.



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