Bug 622792 - dysfunctional target_arch-check
dysfunctional target_arch-check
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: mock (Show other bugs)
13
All Linux
low Severity high
: ---
: ---
Assigned To: David Cantrell
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-08-10 08:44 EDT by Ralf Corsepius
Modified: 2013-01-10 01:08 EST (History)
3 users (show)

See Also:
Fixed In Version: mock-1.1.10-1.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-12-28 15:56:02 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ralf Corsepius 2010-08-10 08:44:45 EDT
Description of problem:

The check inside of /usr/sbin/mock to compare target_arch against arch is bogus.

target_arch is a target configuration feature not a host feature. I.e. whether a particular target_arch is supported by a particular buildroot setup can not be hard-coded into mock itself.

Examples: 
* building ppc rpms on i386 or x86_64.
It's well possible to supply a mock configuration (/etc/mock + buildgroups) to set up a cross-building environment to build ppc-rpms on x86_86.

* building rpms for other linux distros on Fedora, e.g. openSUSE-rpms on Fedora.
(OpenSUSE's target arch is i586 - This is the case I encountered this bug with).


Version-Release number of selected component (if applicable):
mock-1.1.3-1.fc13.noarch

How reproducible:
Always.

Steps to Reproduce:
1. set up an /etc/mock/*.cfg, which uses target_arch=i586
2. run mock
  
Actual results:

# /usr/bin/mock --configdir=/etc/mock -r suse-11.2-i586 rebuild rtems-4.9-sparc-rtems4.9-gcc-4.3.2-25.suse11.2.src.rpm
Building rtems-4.9-sparc-rtems4.9-gcc-4.3.2-25.suse11.2.src.rpm for suse-11.2-i586-rtems4.9
ERROR: Cannot build target i586 on arch x86_64


Expected results:
Function. This check is dysfunctional.

Additional info:
* AFAIS, you have hard-coded the restrictions applying to fedora/redhat-distro's default configuraion into mock. This is a mistake.
* This is a regresson. Older mocks (without this check) worked perfectly.

I can imagine several work-arounds to this issue:
* Add an option to disable this check, rsp. a config_opts item to disable it from inside of *.cfgs.
* Remove it (It's working prinicple is flawed)
* combine the check with "root" or the basename of "*.cfg", such that this check will only be applied to those *.cfg being shipped with fedora.
Comment 1 Clark Williams 2010-08-10 10:53:37 EDT
it's not dysfunctional. It works perfectly for what I want it to do, which is to prevent people from trying to build 64-bit  packages on 32-bit distros (since we do not support that on Fedora or RHEL and I know of no plans to support that). 

I have added i586 as a supported arch for the next release, which should be this week. 

I'll admit that I didn't think about cross compilation and will be perfectly happy to work with you to merge patches which make cross-compilation easier (i.e. moving this logic into config file space rather than hard-coded). Feel free to send me some.
Comment 2 Ralf Corsepius 2010-08-10 11:12:17 EDT
(In reply to comment #1)
> it's not dysfunctional. It works perfectly for what I want it to do, which is
> to prevent people from trying to build 64-bit  packages on 32-bit distros
> (since we do not support that on Fedora or RHEL and I know of no plans to
> support that). 
Well, this a matter of perspective. IMO, you turned mock from a general, distro-independent tool into a fedora/redhat specific tool - That's a regression.

> I have added i586 as a supported arch for the next release, which should be
> this week. 
OK, I see how this (IMHO: cludge) would work-around my issue.

Still, I think you have fallen into the old "build"<->"host"<->"target" trap like many people before.

> I'll admit that I didn't think about cross compilation and will be perfectly
> happy to work with you to merge patches which make cross-compilation easier
> (i.e. moving this logic into config file space rather than hard-coded). Feel
> free to send me some. 
I would do so, but I don't speak python (OK, I can read it, but writing is something entirely different) :(
Comment 3 Ralf Corsepius 2010-08-10 11:56:00 EDT
Another thought:

You could add support for a config_opts['build_arch'] to denote the required "minimum arch" or a config_opts['build_archs'] to denote all "compatible host archs". Then you could process this build_arch[s] in essentially the same way as you currently do with %target_arch.

It would
a) render build_arch[s] user-configurable
b) render the restrictions user-configurable.
c) decouple target and build-host.

AFAIS, all that would basically be required to implement the "build_arch" idea would be you to replace your current target_arch in your arch-check with build_arch and to add appropriate "config_opts['build_arch'] = ..." to fedora's/RH's /etc/mock/*.cfg.
Comment 4 Ralf Corsepius 2010-08-29 10:41:13 EDT
Now things are really f***ed up, now comprising Fedora 12:

/usr/bin/mock --configdir=/home/ERshare/rtems-mock/etc/mock -r mingw32-i686-rtems4.10 --resultdir=/home/ERshare/rtems-mock/var/lib/rtems-mock/result/mingw32-i686-rtems4.10/rtems-4.10-sparc-rtems4.10-gcc-4.4.4-4/ rebuild /home/ERshare/rtems-mock/var/lib/rtems-mock/tobuild/mingw32-i686-rtems4.10/rtems-4.10-sparc-rtems4.10-gcc-4.4.4-4.mgw.src.rpm
Building rtems-4.10-sparc-rtems4.10-gcc-4.4.4-4.mgw.src.rpm for mingw32-i686-rtems4.10
ERROR: Cannot build target i686-pc-mingw32 on arch x86_64

# rpm -q mock
mock-1.0.11-1.fc12.noarch
Comment 5 Bug Zapper 2010-11-03 07:04:38 EDT
This message is a reminder that Fedora 12 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 12.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '12'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 12's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 12 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 6 Ralf Corsepius 2010-11-03 07:12:36 EDT
Bug is still present in all released versions of Fedora.
Comment 7 Ralf Corsepius 2010-11-03 18:12:13 EDT
Resetting version to 12. 

This bug is present in all released versions of Fedora (i.e. >= 12) not only rawhide.

May-be this confuses the bug-zappers's scripts nevertheless setting "version" to "rawhide" is simply plain wrong.
Comment 8 Bug Zapper 2010-12-03 07:52:32 EST
Fedora 12 changed to end-of-life (EOL) status on 2010-12-02. Fedora 12 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.
Comment 9 Ralf Corsepius 2010-12-03 23:35:08 EST
Reopening ... bug persists.
Comment 10 Bug Zapper 2010-12-04 02:23:10 EST
Fedora 12 changed to end-of-life (EOL) status on 2010-12-02. Fedora 12 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.
Comment 11 Jesse Keating 2010-12-06 13:18:54 EST
bot fail.  Re-opening.
Comment 12 Fedora Update System 2010-12-14 11:10:47 EST
mock-1.1.7-1.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/mock-1.1.7-1.fc13
Comment 13 Fedora Update System 2010-12-14 11:11:00 EST
mock-1.1.7-1.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/mock-1.1.7-1.fc14
Comment 14 Fedora Update System 2010-12-14 11:13:37 EST
mock-1.0.14-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/mock-1.0.14-1.el5
Comment 15 Fedora Update System 2010-12-15 04:02:14 EST
mock-1.1.7-1.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update mock'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/mock-1.1.7-1.fc14
Comment 16 Fedora Update System 2010-12-28 15:55:51 EST
mock-1.1.7-1.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 17 Fedora Update System 2011-01-18 14:58:18 EST
mock-1.1.8-1.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/mock-1.1.8-1.fc14
Comment 18 Fedora Update System 2011-01-18 14:58:59 EST
mock-1.1.8-1.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/mock-1.1.8-1.fc13
Comment 19 Fedora Update System 2011-01-18 15:03:53 EST
mock-1.0.15-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/mock-1.0.15-1.el5
Comment 20 Fedora Update System 2011-01-21 18:03:51 EST
mock-1.1.8-1.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 21 Fedora Update System 2011-02-19 21:26:02 EST
mock-1.1.9-1.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/mock-1.1.9-1.fc13
Comment 22 Fedora Update System 2011-02-19 21:29:14 EST
mock-1.0.16-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/mock-1.0.16-1.el5
Comment 23 Fedora Update System 2011-02-19 21:32:07 EST
mock-1.1.9-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.9-1.el6
Comment 24 Fedora Update System 2011-02-19 21:35:00 EST
mock-1.1.9-1.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/mock-1.1.9-1.fc14
Comment 25 Fedora Update System 2011-03-03 03:24:36 EST
mock-1.1.9-1.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 26 Fedora Update System 2011-03-03 03:33:35 EST
mock-1.1.9-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 27 Fedora Update System 2011-05-13 16:33:49 EDT
mock-1.1.10-1.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/mock-1.1.10-1.fc15
Comment 28 Fedora Update System 2011-05-13 16:38:32 EDT
mock-1.1.10-1.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/mock-1.1.10-1.fc14
Comment 29 Fedora Update System 2011-05-13 16:42:50 EDT
mock-1.0.17-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/mock-1.0.17-1.el5
Comment 30 Fedora Update System 2011-05-13 16:47:08 EDT
mock-1.1.10-1.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/mock-1.1.10-1.fc13
Comment 31 Fedora Update System 2011-05-13 16:51:20 EDT
mock-1.1.10-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.10-1.el6
Comment 32 Fedora Update System 2011-05-19 00:35:11 EDT
mock-1.1.10-1.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 33 Fedora Update System 2011-05-24 22:42:35 EDT
mock-1.1.10-1.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 34 Fedora Update System 2011-05-24 23:16:53 EDT
mock-1.1.10-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 35 Fedora Update System 2011-06-02 15:06:46 EDT
mock-1.0.17-1.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 36 Fedora Update System 2011-06-02 15:16:44 EDT
mock-1.1.10-1.el6 has been pushed to the Fedora EPEL 6 stable repository.  If problems still persist, please make note of it in this bug report.

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