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

Re: General tips for improving cross-satisfiability when interpreted languages are involved



Hi John,

On Tue, Aug 10, 2021 at 02:27:11PM +0000, John Scott wrote:
> My latest example is trying to get zbar to be able to have its cross
> dependencies resolved, then trying to get it to cross build. In
> addition to C and C++ libs, it builds Perl and Python modules.

Thank you for contacting us instead of giving up. If you prefer
interactive help, reach out on irc.oftc.net to #debian-bootstrap.

> * zbar explicitly build-depends on perl, which is a Multi-Arch: allowed
> package. This dependency seems possibly superfluous to me (perl is in
> Build-Essential), so I delete it.

perl is not build-essential. It just happens to be a dependency of
debhelper.

The perl dependency is there for a reason (as you explained): It builds
a perl extension.

> * zbar explicitly build-depends on python3-dev, which is cross-
> unfriendly since it cannot be installed for multiple architectures at
> the same time and provides the arch-ambiguous python3-config binary.
> I switch it out for libpython3-dev and hope that the build system is
> robust enough to use pkg-config or otherwise find the Python libraries
> (it seems this is the case).

Traditionally, python extensions required a dependency on
"python$something-dev". With cross building, this becomes
"libpython$something-dev, python$something-dev:any". It's an annoying
change as it needs to be performed archive wide. Likely, this should be
documented as general advice. Adding it as a lintian tag wouldn't be the
worst of ideas. Which documents did you consult for solving this? A wiki
page can easily be updated.

> * When building the Perl module failed, Debhelper gave me a hint that I
> probably needed a build-dep on perl-xs-dev (what's xs mean anyway?). I
> added this.

In the Perl world, "xs" is an interface between C and Perl. It is used
to write extensions that require non-Perl as opposed to pure Perl
modules. The perl-xs-dev dependency is a relatively new thing (less than
two years I think) and the general rule of thumb is: Whenever your
package builds a Perl extension, it should "Build-Depends: perl-xs-dev".
A lot of packages have been converted by the Debian Perl Group already,
but zbar is notably missing. A lintian tag would be a good idea as well
here, but it is more difficult to figure out, because not every perl
dependency hints an extension module. Perhaps the combination of
"Build-Depends: perl" and the presence of a lib$something-perl package
that is not "Architecture: all" could trigger a tag? Again, where would
you look for this documentation?

> After making these changes, the package now seems to cross build. The
> problem is I can't explain why and am in no good position to propose
> this to the package maintainer. Could someone direct me to a detailed
> discussion of these issues, or otherwise help me understand how and why
> these interpreter packages have been split up, and what I should be
> looking for when?

I hope your questions are sufficiently answered. Good documentation is
missing. A major reason is that things are still evolving. Most of the
documentation we have is outdated. Keeping it up to date just doesn't
seem to work. And until recently, very few people were consuming it.
That might be changing now. Would you be interested in improving and/or
creating documentation?

Please submit your zbar patch. Whenever in doubt (such as in this case),
you may add this list to X-Debbugs-Cc to attract more eyeballs to your
patch.

Helmut


Reply to: