using a macro in ExclusiveArch

Dennis Gilmore dennis at ausil.us
Thu Jan 5 14:11:07 UTC 2012


El Thu, 5 Jan 2012 13:22:34 +0100
Michael Schwendt <mschwendt at gmail.com> escribió:
> On Thu, 5 Jan 2012 13:08:21 +0100, BP (Björn) wrote:
> 
> > I need some advice on how to fix this build failure. The GtkAda
> > package builds fine in Mock, but fails in Koji with the error "No
> > matching arches were found":
> > 
> > http://koji.fedoraproject.org/koji/taskinfo?taskID=3621310
> > 
> > Several Ada packages need an ExclusiveArch directive to prevent
> > attempts to build them on secondary architectures where GNAT isn't
> > available. I thought it would be a good idea to keep the list of
> > architectures in a macro to get closer to a single point of truth.
> > I defined the macro in /etc/rpm/macros.gnat in the package
> > fedora-gnat-project-common:
> > 
> > %GNAT_arches %{ix86} x86_64 ia64 ppc ppc64 alpha
> > 
> > GtkAda uses the macro like this:
> > 
> > BuildRequires: fedora-gnat-project-common >= 3.3
> > ExclusiveArch: %{GNAT_arches}
> > 
> > I *think* the reason why the build fails in Koji might be that Koji
> > reads the ExclusiveArch directive to figure out which build server
> > should handle the build, and it doesn't pull in buildrequired
> > packages before doing that, so GNAT_arches is undefined. Does this
> > analysis seem correct?
> 
> Yes.
> 
> $ rpm -qp GtkAda-2.18.0-2.fc17.src.rpm --qf "%{exclusivearch}\n"
> %{GNAT_arches}
>  
> > If so, what should I do about it? Should macros simply not be used
> > in the ExclusiveArch directive? I see ghc_arches, mono_arches and
> > ocaml_arches in other files in /etc/rpm. Those files all belong to
> > redhat-rpm-config. Would this work if GNAT_arches were defined in
> > redhat-rpm-config instead of fedora-gnat- project-common?
> 
> Sounds plausible, because with redhat-rpm-config in the buildroot, the
> src.rpm would be fine with a defined macro.
> 
> > Is it significant that all three filenames end in "-srpm"? Or 
> > should this be considered a bug in Koji?
> 
> I think the -srpm in there is not important.
> 
> $ ls /etc/rpm
> macros.color   macros.fjava     macros.mono-srpm   macros.systemd
> macros.dist    macros.gconf2    macros.ocaml-srpm  macros.texlive
> macros.emacs   macros.ghc-srpm  macros.perl
> macros.faldor  macros.jpackage  macros.prelink
the -srpm is there because the langugaes can provide other language
specific macros in a file without -srpm  the -srpm is to define that
the macros are needed at srpm creation time and are slightly special
because of it. the idea of them is to make it pretty easy to add a arch
to a language by modifying one place rather than hundreds.

by having the macros.ghc-srpm  a ghc-common or ghc-filesystem or some
such package can provide macros.ghc which has macros for rpm createion
and not for srpm creation


Dennis


More information about the devel mailing list