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

Re: Cross-compiling a package that build-depends on Python

On 03.02.2018 14:23, Helmut Grohne wrote:
Recently the upstream development introduced a compile step that requires
some source files to be pre-processed with a Python script (shipped with the
sources). I thus added python-all to my Build-Depends field and the native
Why do you use python-all? If python is simply used as a build tool, you
don't need all versions of python. A single version should be
sufficient. Preferably, you use python3 here.

Well, probably I took the package description too literally:

"This package is a dependency package used as a build dependency for other packages to avoid hardcoded dependencies on specific Python runtimes."

Besides, it currently implies python2.7 only, but thanks, changed to explicit version now.

BTW what is this python-all good for?

The question to think about is: What do you need python for?
Often enough the answer is "it is executed during build, but the
resulting .deb does not integrate with python in any way". That answer
translates to "you want the build architecture python".
Yes, that's what I need.

All Build-Depends are treated as host architecture by default. In this
case, it seems very likely that python is a build tool so you
(implicitly) requested python for the wrong architecture. Switching a
dependency from host architecture to build architecture happens by
annotating it with ":native" (<- only works in Build-Depends, not
This is exactly what I was looking for! I anticipated that there must a way to enforce the native build architecture, but I could not find it anywhere. Could you please point me to the respective documentation?

Practically, whenever you see python{,3}{,-all}{,-dev} in Build-Depends
you can already tell that your package won't cross build. Often times
annotating the dependency is correct, but for python-dev the fix often is
s/python3?\(-all\)?-dev/lib&, &:native/g instead.
Well, at least in my caste the annotation ":native" worked just fine! Thanks!

Best regards,

Reply to: