On Sat, Jul 15, 2023 at 05:11:02PM +0200, Nils Philippsen wrote:
> On Fri, 2023-07-14 at 13:30 +0100, Richard W.M. Jones wrote:
> > For some virt packages we need to combine 2 or 3 of:
> > 
> >   ExclusiveArch: %{kernel_arches}
> >   ExclusiveArch: %{qemu_sysemu_host_arches}       # [1]
> >   ExclusiveArch: %{ocaml_native_compiler}
> > 
> > to mean only compile on the intersection of these arches.  If you
> > have
> > multiple ExclusiveArch lines then RPM seems to do the union of arches
> > which is the opposite of what anyone would want.
> 
> I beg to differ. When a tag in RPM can have multiple items (e.g.
> Provides, (Build)Requires), this …:
> 
> Tag: item1 item2 item3
> 
> … is consistently equivalent to this:
> 
> Tag: item1
> Tag: item2
> Tag: item3
> 
> To have ExclusiveArch behave differently would be surprising – nobody
> (😉) would read this and expect the effective list of arches the
> package would be built for to be empty:
> 
> ExclusiveArch: x86_64
> ExclusiveArch: s390x
> ExclusiveArch: aarch64
> 
> > Dan Berrange came up with a clever way to do it though ...
> > 
> >   %ifnarch %{kernel_arches}
> >   ExcludeArch: %{_arch}
> >   %endif
> >   %ifnarch %{qemu_sysemu_host_arches}
> >   ExcludeArch: %{_arch}
> >   %endif
> > 
> > But this makes my head hurt.  Is there a better way or could RPM
> > provide explicit union and intersection operators?
> 
> I think this would be a good approach.

It is certainly easier to read and understand than using a LUA script
to get to implement variable intersection for ExclusiveArch !

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to