[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Cross-building with python3-numpy



Hi Dima,

On Sat, Jan 14, 2023 at 03:20:22PM -0800, Dima Kogan wrote:
> Unsurprisingly, added python3-numpy:any to the Build-Depends complains a
> LOT.

The :any annotation is only permitted for packages that happen to be
tagged Multi-Arch: allowed. python3-numpy isn't thus tagged, which makes
it fairly obvious why it complains.

> Questions:
> 
> - Assuming the numpy package was fully set up for this, is right thing
>   Build-Depends:python3-numpy:any ? The cross-building wiki page makes
>   me think this is the case

If python3-numpy were Multi-Arch: allowed, then this could be right. I
don't think we want to add it though, because it would be a significant
departure from how we've packaged Python extensions thus far. You'd have
to make a better case for why this would be needed given available
alternatives (see below).

> - One part of being set-up for cross-building is that python3-numpy
>   should be Multi-Arch:foreign. But how do I query this? "apt show
>   python3-numpy" doesn't include the Multi-Arch tags.

python3-numpy is a Python extension and certainly should not be
Multi-Arch: foreign. That tag is an assertion on the interface of the
provided package to be architecture-agnostic. Certainly, loading a
shared library depends on the architecture of the library and the
program it is loaded into to be equal. We've unsuccessfully tried
getting this into Debian policy thus far. My own attempt can be found at
https://wiki.debian.org/DependencyHell#Multi-Arch:_foreign. Does that
help get a better understanding?

Note that wrong Multi-Arch: foreign annotations tend to be very
annoying, because they tend to break lots of different things
simultaneously in a difficult to diagnose way and when you fix them, you
incur lots of breakage again as people started to depend on the
erroneous behaviour. Please be careful with adding them.

> - If somebody were to work on this, would the first step be to grab the
>   python3-numpy sources, rebuild with the Multi-Arch:foreign tag, and
>   then see if it works? I'm about to try that now. Is this the right way
>   to do it?

No. This is probably one of the cases, where :native is the way to go.
What you want to express here is that mrcal needs a runnable
python3-numpy rather than one which matches the architecture mrcal is
being built for. This is precisely, what we have :native for.

Helmut


Reply to: