Bug 237142 - x86_64 mock can't build i386 SRPMs (doesn't read ~/.rpmmacros)
x86_64 mock can't build i386 SRPMs (doesn't read ~/.rpmmacros)
Product: Fedora Hosted Projects
Classification: Retired
Component: mock (Show other bugs)
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Clark Williams
Depends On:
  Show dependency treegraph
Reported: 2007-04-19 13:25 EDT by Carl Roth
Modified: 2013-01-09 23:16 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-04-22 12:04:16 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Carl Roth 2007-04-19 13:25:33 EDT
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'

  mock-chroot> export HOME=/builddir
  mock-chroot> rpm --eval '%_topdir'

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):


How reproducible:


Steps to Reproduce:
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 16:07:21 EDT
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 12:04:16 EDT
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.