On Wed, Mar 03, 2021 at 09:29:43AM +0100, Petr Pisar wrote:
V Tue, Mar 02, 2021 at 12:45:42PM +0000, Richard W.M. Jones napsal(a):
On Mon, Mar 01, 2021 at 01:31:13PM +0000, Daniel P. Berrangé wrote:
+%if %{_with_mingw}
+%package -n mingw32-libvirt-glib +Summary: MingwGW Windows libvirt-gconfig virtualization library +BuildArch: noarch +Requires: pkgconfig
Why are the packages noarch if they contain a machine code?
Dan already noted that you can run the cross-compiler on any architecture.
However it is a good question about why the final packages are "noarch". Windows these days only exists on i686, x86-64 and aarch64. I don't know what mingw-w64's support for aarch64 is like, but we only bother building i686 ("mingw32-*") and x86-64 ("mingw64-*") packages.
Normally the end result is intended to be run on Windows, so it's "noarch" as far as Fedora is concerned. The normal deployment method is to use NSIS to generate an installer (from files in the RPMs you've installed locally) which is copied over to Windows. You can do this on any arch. But you can also run the code under Wine on an x86-64 host. Probably on i686 host but I doubt anyone has done that in a long while. Wine doesn't work on non-x86 arches.
I don't think that Koji / RPM is really designed to cope with all this subtlety though. And implementing it just for mingw is way too much work.
Fullarch Linux packages are built on various architectures. Is MinGW toolchain available on all of them? E.g if my Linux package builds on s390x, is there a crosscompiler available and is thus possible to build Windows binaries there? What about runnning tests in %check phase?
Yes, any build arch can be used. We don't usually run tests in %check because running Wine under Koji is a pain. It requires a specifically configured $HOME, and X server (even for console programs).
Rich.