Hi,

On Sun, 3 Oct 2021 21:42:42 +0300 Michael Tokarev <m...@tls.msk.ru> wrote:
> On Sat, 2 Oct 2021 12:42:00 +0200 Helmut Grohne <hel...@subdivi.de> wrote:
> > qemu cannot satisfy its cross Build-Depends, because its dependencies on
> > sphinx are not satisfiable. Unfortunately, sphinx can be used in
> > architecture-dependent ways, so it cannot be annotated M-A:foreign. I
> > think that qemu uses sphinx in an architecture-independent way (as most
> > architecture-dependent use cases import python extensions and qemu uses
> > it to generate manual pages instead). As such, we can address the issue
> > by annotating the relevant dependencies with :native. Please consider
> > applying the attached patch.
> 
> Please count me confused.  I don't understand what you're talking about.
> What does this: "unfortunately, sphinx can be used in architecture-dependent
> ways" means, and why this is unfortunate?

when building packages in Debian, we talk about three different architectures:
the build architecture, the host architecture and the target architecture. The
latter is only interesting for building compilers and the build and host
architecture are the same when doing native builds. The build architecture is
the architecture the package is built on. The host architecture is the
architecture the package is built for. Without any annotation, build
dependencies require the host architecture package. So if you write:

Build-Depends: python3-sphinx

And you cross-build the package on amd64 for mipsel, then you would need to
have python3-sphinx from mipsel installed. Since python3-sphinx is an
Architecture:all package and since Architecture:all packages are always treated
as if they were of the native architecture, you can only ever install
python3-sphinx as if it were amd64 and thus you cannot satisfy your cross build
dependencies.

One way to solve this would be to mark the python3-sphinx package as
Multi-Arch:foreign. If it were marked like that, then python3-sphinx on amd64
would be able to satisfy that dependency even though you are building for
mipsel.

Unfortunately, that is out of question, because the interface of the
python3-sphinx package includes the sphinx Python module, which happens to
depend on markupsafe via jinja2. Since markupsafe is architecture-dependent,
there is no way to make python3-sphinx Multi-Arch: foreign. That would've been
the easy way but we cannot do it and that's why this is unfortunate.

> Maybe it's better to annotate it with :any, as we don't really care which
> arch it is, as long as it works?

Yes, we do care. Using our example above, if python3-sphinx was not
Architecture:all and we would install the mipsel version, then it would
probably not work because we cannot execute mipsel on an amd64 machine. So
instead we pick the architecture it works and use :native to pick the native
architecture instead. Furthermore, the :any qualifier is only allowed for
packages that are marked as Multi-Arch:allowed.

> Also, what does this :native annotation do within build-depends, to start
> with? Is there any documentation about this?

As explained above, by default, build dependencies are fulfilled by packages of
the host architecture (the architecture the package is built for). By adding
:native you state that you don't want this package for the host architecture
but instead you want it for the build architecture, which makes perfect sence
for python3-sphinx.

Documentation: https://wiki.ubuntu.com/MultiarchCross

Thanks!

cheers, josch

Attachment: signature.asc
Description: signature

Reply via email to