Bug 166815 - Better handling of "BuildArch" tag
Summary: Better handling of "BuildArch" tag
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 4
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Paul Nasrat
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-08-26 00:56 UTC by Andreas Hasenack
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-01-22 12:13:46 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
rpm4.2.2-buildarch.patch (2.24 KB, patch)
2005-08-26 00:56 UTC, Andreas Hasenack
no flags Details | Diff

Description Andreas Hasenack 2005-08-26 00:56:42 UTC
Description of problem:
A good use for the "BuildArch" tag would be to replace --target command line.
So, if a spec file has, for example:
BuildArch: i686 pentium4

Building it with "rpm -ba foo.spec" would automatically build .i686.rpm and
.pentium4.rpm packages without having to worry about using the correct --target
command line.

I'm attaching a patch which we had for rpm-4.2.2 which does this. We have been
using it for more than a year now. I can't, however, comment on the technical
aspects of the patch since I'm not the author (Gustavo Niemeyer did it). It
applied to rpm-4.4.2 with some offsets.

Comment 1 Andreas Hasenack 2005-08-26 00:56:42 UTC
Created attachment 118133 [details]
rpm4.2.2-buildarch.patch

Comment 2 Jeff Johnson 2005-08-27 01:56:09 UTC
The intent here appears to be to have BuildArch: within a *.spec
override --target arguments. That's wrong imho, don't use --target
rather than appending BuildArch: targets to --target.

Is that the intent, changing the precedence of BA and -=-target handling so that BuildArch: overrides
--target?

Comment 3 Andreas Hasenack 2005-08-27 12:49:29 UTC
No, --target should always be obeyed regardless of BuildArch contents. The
intent is that BuildArch behaves like --target if no --target is given. It's
like a default target but with the added benefit of supporting multiple targets
and automatically rebuilding for all of them.

Comment 4 Rafael Garcia-Suarez 2006-03-16 09:49:58 UTC
I had a quick look at the patch, and I have a comment. As I understand the code,
without the patch, rpm-build will reparse the spec file for each compatible
BuildArch listed, so the %ifarch sections are processed correctly. This patch
bypasses this, leading to potentially wrongly interpreted spec files.

Comment 5 Andreas Hasenack 2006-03-16 12:54:22 UTC
As I said, we have been using this patch for many years, and I don't know of
such an issue. At one time we regularly built packages for alpha and ppc.

However, I can't comment on the code. Even if it doesn't work correctly, at
least consider it as a suggestion.

Comment 6 Christian Iseli 2007-01-22 10:55:11 UTC
This report targets the FC3 or FC4 products, which have now been EOL'd.

Could you please check that it still applies to a current Fedora release, and
either update the target product or close it ?

Thanks.

Comment 7 Andreas Hasenack 2007-01-22 12:13:46 UTC
I'm sorry, this was more than a year ago.


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