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