Bug 166815 - Better handling of "BuildArch" tag
Better handling of "BuildArch" tag
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Paul Nasrat
: FutureFeature
Depends On:
  Show dependency treegraph
Reported: 2005-08-25 20:56 EDT by Andreas Hasenack
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-01-22 07:13:46 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

  None (edit)
Description Andreas Hasenack 2005-08-25 20:56:42 EDT
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-25 20:56:42 EDT
Created attachment 118133 [details]
Comment 2 Jeff Johnson 2005-08-26 21:56:09 EDT
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
Comment 3 Andreas Hasenack 2005-08-27 08:49:29 EDT
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 04:49:58 EST
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 07:54:22 EST
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 05:55:11 EST
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 ?

Comment 7 Andreas Hasenack 2007-01-22 07:13:46 EST
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.