Debian Bug report logs - #633884
perl cross-build support

version graph

Package: perl; Maintainer for perl is Niko Tyni <ntyni@debian.org>; Source for perl is src:perl.

Reported by: Steve McIntyre <steve.mcintyre@linaro.org>

Date: Thu, 14 Jul 2011 17:54:02 UTC

Severity: wishlist

Merged with 285559

Found in versions 5.8.4-5, perl/5.12.4-1, perl/5.14.2-16, perl/5.16.2-1

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Niko Tyni <ntyni@debian.org>:
Bug#633884; Package perl. (Thu, 14 Jul 2011 17:54:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Steve McIntyre <steve.mcintyre@linaro.org>:
New Bug report received and forwarded. Copy sent to Niko Tyni <ntyni@debian.org>. (Thu, 14 Jul 2011 17:54:05 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Steve McIntyre <steve.mcintyre@linaro.org>
To: submit@bugs.debian.org
Subject: perl cross-build support
Date: Thu, 14 Jul 2011 18:48:54 +0100
[Message part 1 (text/plain, inline)]
Package: perl
Version: 5.12.4-1
Severity: wishlist
Tags: patch
User: crossbuild@debian.org
Usertags: cross

Hi folks,

I'm currently working on cross-building bits of Debian and I've got to
perl. The main issues are setting up the configuration for the built,
but the perl also uses miniperl etc. during the build and installation
phase. This is difficult in a cross-build. :-)

Also: for later support of cross-building of perl modules they will
need to pick up the right configuration to use themselves. I've got
patches coming for a few modules, starting with liblocale-gettext-perl
as an example. I've got that building using this setup now.

Debdiff attached; the patch is large, but hopefully easy to
follow. The changes are in 4 sections:

1. Minor tweaks to debian/rules etc. for package build time.
2. Generic patch for cross-building perl
3. Addition of cross config for armel
4. Addition of cross config for armhf

The bulk of the diff is in (3) and (4). I've tried to minimise the
effects on the rest of the package to make the changes as palatable as
possible - please let me know if I can do anything more to help here!

Cheers,
-- 
Steve McIntyre
steve.mcintyre@linaro.org
[perl-cross.debdiff (text/plain, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Niko Tyni <ntyni@debian.org>:
Bug#633884; Package perl. (Thu, 11 Aug 2011 21:39:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dominic Hargreaves <dom@earth.li>:
Extra info received and forwarded to list. Copy sent to Niko Tyni <ntyni@debian.org>. (Thu, 11 Aug 2011 21:39:06 GMT) Full text and rfc822 format available.

Message #10 received at 633884@bugs.debian.org (full text, mbox):

From: Dominic Hargreaves <dom@earth.li>
To: Steve McIntyre <steve.mcintyre@linaro.org>, 633884@bugs.debian.org
Subject: Re: Bug#633884: perl cross-build support
Date: Thu, 11 Aug 2011 22:14:42 +0100
On Thu, Jul 14, 2011 at 06:48:54PM +0100, Steve McIntyre wrote:
> I'm currently working on cross-building bits of Debian and I've got to
> perl. The main issues are setting up the configuration for the built,
> but the perl also uses miniperl etc. during the build and installation
> phase. This is difficult in a cross-build. :-)
> 
> Also: for later support of cross-building of perl modules they will
> need to pick up the right configuration to use themselves. I've got
> patches coming for a few modules, starting with liblocale-gettext-perl
> as an example. I've got that building using this setup now.
> 
> Debdiff attached; the patch is large, but hopefully easy to
> follow. The changes are in 4 sections:
> 
> 1. Minor tweaks to debian/rules etc. for package build time.
> 2. Generic patch for cross-building perl
> 3. Addition of cross config for armel
> 4. Addition of cross config for armhf
> 
> The bulk of the diff is in (3) and (4). I've tried to minimise the
> effects on the rest of the package to make the changes as palatable as
> possible - please let me know if I can do anything more to help here!

Hi Steve,

Thanks for forwarding the patch set for this. In fact, it seems there
was a similar effort made back in #285559 which never received much
attention.

There are a couple of reasons I suspect we won't want to apply this
just at the moment. Firstly, we're fairly close to migrating to perl 5.14
(currently being staged in experimental) so we'd probably want to
target such a large set of patches there rather than the current 5.12.

Even then, however, we much prefer to apply patches which have at least
been submitted upstream and had a chance for comment. Has there been
any attempt to do this?

I'm not familiar with the current perl cross-build infrastructure, or
indeed its history, so any additional commentary in that area would
probably be welcome.

Likewise, any commentary about how the arch-specific config files were
produced and/or modified would be useful (presuambly there is a reason
they aren't generated during the package build process).

Cheers,
Dominic.

-- 
Dominic Hargreaves | http://www.larted.org.uk/~dom/
PGP key 5178E2A5 from the.earth.li (keyserver,web,email)




Merged 285559 633884. Request was from Dominic Hargreaves <dom@earth.li> to control@bugs.debian.org. (Sat, 20 Aug 2011 14:57:03 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Niko Tyni <ntyni@debian.org>:
Bug#633884; Package perl. (Mon, 17 Dec 2012 20:39:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Neil Williams <codehelp@debian.org>:
Extra info received and forwarded to list. Copy sent to Niko Tyni <ntyni@debian.org>. (Mon, 17 Dec 2012 20:39:03 GMT) Full text and rfc822 format available.

Message #17 received at 633884@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: 633884@bugs.debian.org
Cc: control@bugs.debian.org
Subject: Makefile.SH and debian/rules update
Date: Mon, 17 Dec 2012 20:37:26 +0000
[Message part 1 (text/plain, inline)]
block 633884 by 696189
thanks

(Updating this bug to reflect the available support in perl-cross-debian
to simplify the cross-building support for perl.)

Some of the background has already discussed with the perl
maintainers during the development of perl-cross-debian and now that
perl-cross-debian is in experimental, we can continue the process in
the BTS. The process needs more testing - especially runtime testing of
the cross-built perl packages. There are steps upstream to improve perl
cross-building [0] and there appears to be some overlap between how
this upstream support can be implemented and how perl-cross-debian can
support cross-building in the meantime.

The attached patches are the parts of perl-cross-debian support which
need to be patched into perl - Makefile.SH for avoiding the execution
of cross-built binaries alongside the use of pre-configured config data
and changes to debian/rules to replace calls to perl.static with a
variable to support calling /usr/bin/perl when cross-building.

The patches themselves have evolved since #285559 was filed against
perl 5.8.4 and updated for #633884 - there are elements of the
current patches which are historical.

Nearly all of the changes to Makefile.SH are isolated within
conditionals utilising CROSS_PERL except one - the extensions target.
This could do with some more testing but it is mainly to support the
alternative extensions build target to avoid some of the work needed by
the 'all' target. It could also be useful in the generation of the cache
files themselves as the content of the generated headers are common to
some combinations of architecture. It *should* make it easier to
prevent the kind of errors which have tripped me up once already. [1]
I hope to use this target *on native* machines to only generate the
extensions data to try and debug similar problems.

debian/rules has a wider range of changes. The current set are
predicated on dpkg-cross style cross-dependency paths. It should be
possible to detect MultiArch paths simply by checking for certain
directories but that can be added later.

The changes to debian/rules move the current setting of INCLUDE and LIB
alongside the setting of ZLIB_INCLUDE and BZIP2_INCLUDE etc. With
MultiArch support, it could be worth testing if these are historical or
still necessary as the headers are arch-independent (currently).

HOST_PERL_LIBS is set to the package_upstream_version because perl has
problems trying to cross-build one version or perl using the native
perl binaries from a different version. DynaLoader was the first to
fail when I was testing this. perl-cross-debian checks that these
versions match.

perl-cross-debian is not (and isn't expected to be) a build-dependency
of perl (cross build or not) but that's expected with cross-builds.
Cross-builders are used to less-than-graceful failures - the fact that
the cross-build will fail noisily if perl-cross-debian is not installed
is actually a bonus because it will fail early. 

Installing the cross-compiler itself is a largely undocumented
process...

After perl-cross-debian is called, the cross-build calls perl directly.
This may seem inconsistent but the other uses of PERL_TO_USE are mainly
to allow for use in both native and cross builds. perl-cross-debian
itself isn't called using PERL_TO_USE and it is a perl script.

> > +       $(MAKE) perl $(test_target)  CROSS_PERL=$(HOST_PERL)
> > +       mv libperl.a libperl-static

The explanation for this is that $(test_target) is empty for a
cross-build via the DEB_BUILD_OPTIONS="nocheck" and
debian/config.debian --test-target. perl-cross-debian checks for this
variable and fails the build if it is not set.

I can attach compressed build logs of the 5.14 and 5.16 cross-build, if
that is useful.

> > -       ./perl.static -Ilib -V
> > +       $(PERL_TO_USE) -Ilib -V

This does work - running the host perl with the cross Config.pm and the
rest. It's one of the reasons why the versions of the cross perl build
and the host perl must match.

> > +ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
> >         $(MAKE) all $(test_target) || { rm -f libperl.so*; exit 1; }
> > +else
> > +       @echo "Need to use installed (host) extensions when building extensions...."
> > +       @echo "Overwrite any built so far"
> > +       cp -fr $(HOST_PERL_LIBS)/auto/* lib/auto/
> > +       @echo "Now make the extensions"
> > +       -mkdir lib/$(DEB_HOST_GNU_TYPE)
> > +       $(MAKE) extensions CROSS_PERL=$(HOST_PERL) INST_ARCHLIB=$(srcdir)/lib/$(DEB_HOST_GNU_TYPE)
> > +endif

I will try and get some more testing done on whether the overwriting is
the right thing to do or whether the extensions need to be deleted or
made unreadable with chmod -r.

> > -           debian/substvars debian/files debian/list.tmp $(tmp) $(build)
> > +           debian/substvars debian/files debian/list.tmp $(tmp) $(build) \
> > +               Configure.cross config.sh config.h xconfig.h uudmap.h bitcount.h
> 

This is a bug in perl-cross-debian - the knowledge of which files are
to be deleted lives within perl-cross-debian, so it needs to clean
these too. Same with Cross/$(DEB_HOST_GNU_TYPE)/*.new

> > +ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
> > +       @echo "Copy back all the target-independent extensions - for use and installation"
> > +       cp -fr $(HOST_PERL_LIBS)/auto/* lib/auto/
> > +       $(MAKE) install CROSS_PERL=$(HOST_PERL)

This section could do with some more testing. I'm not sure how much
testing the cross-built extensions will actually receive, other than
what is needed to use them to build perl natively.

OK, what I think I need to do is sort out a few bug fixes in
perl-cross-debian, get more people doing testing by applying (and
possibly improving) a patch from perl-cross-debian for debian/rules in
perl, then updating #633884.

I don't mind carrying patches for debian/rules during the testing but
if we can get Makefile.SH patched in 5.16, that will make things a lot
easier.

Hence, blocking this bug with the perl-cross-debian bug which will then
result in an updated patch for debian/rules.


[0]
http://news.perlfoundation.org/2012/05/grant-application-improving-cr.html
[1]
https://github.com/codehelp/perl-cross-debian/commit/fbdbdcfb3c8e900466fdfb4b36944593dd528ae9

-- 


Neil Williams
=============
http://www.linux.codehelp.co.uk/

[cross-Makefile.diff (text/x-diff, attachment)]
[rules.diff (text/x-diff, attachment)]
[Message part 4 (application/pgp-signature, inline)]

Added blocking bug(s) of 633884: 696189 Request was from Neil Williams <codehelp@debian.org> to control@bugs.debian.org. (Mon, 17 Dec 2012 20:39:05 GMT) Full text and rfc822 format available.

Marked as found in versions perl/5.14.2-16. Request was from Neil Williams <codehelp@debian.org> to control@bugs.debian.org. (Mon, 17 Dec 2012 20:45:03 GMT) Full text and rfc822 format available.

Marked as found in versions perl/5.16.2-1. Request was from Neil Williams <codehelp@debian.org> to control@bugs.debian.org. (Mon, 17 Dec 2012 20:45:04 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Niko Tyni <ntyni@debian.org>:
Bug#633884; Package perl. (Sat, 05 Jan 2013 18:45:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Neil Williams <codehelp@debian.org>:
Extra info received and forwarded to list. Copy sent to Niko Tyni <ntyni@debian.org>. (Sat, 05 Jan 2013 18:45:03 GMT) Full text and rfc822 format available.

Message #28 received at 633884@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: 633884@bugs.debian.org
Subject: Added clean support to perl-cross-debian
Date: Sat, 5 Jan 2013 18:41:55 +0000
[Message part 1 (text/plain, inline)]
The debian/rules patch has been updated:

https://raw.github.com/codehelp/perl-cross-debian/master/patches/debian/rules.diff

(also attached for those who want to cross-build perl for testing)

However, there is some more to do with the extension install operations
and I've also got some checks to do on an upstream proposal for the
Makefile.SH upstream patch.

I'll continue working on the cross support and see what can be done to
clean up the extensions / installation issues.

-- 


Neil Williams
=============
http://www.linux.codehelp.co.uk/

[rules.diff (text/x-diff, attachment)]
[Message part 3 (application/pgp-signature, inline)]

Removed tag(s) patch. Request was from Dominic Hargreaves <dom@earth.li> to control@bugs.debian.org. (Mon, 11 Mar 2013 00:09:10 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Apr 16 05:25:44 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.