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)
Alias: None
Product: Fedora Hosted Projects
Classification: Retired
Component: mock   
(Show other bugs)
Version: unspecified
Hardware: i386 Linux
Target Milestone: ---
Assignee: Clark Williams
QA Contact:
Depends On:
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:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-04-22 16:04:16 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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'

  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 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.