Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.91k stars 542 forks source link

skip lib/ExtUtils/t/Embed.t when cross-compiling #13253

Closed p5pRT closed 11 years ago

p5pRT commented 11 years ago

Migrated from rt.perl.org#119769 (status was 'resolved')

Searchable as RT119769$

p5pRT commented 11 years ago

From @fperrad

Created by @fperrad

The toolchain is not installed on the target when cross-compiling. So\, this test must be skipped\, see patch below.

(info for dual life modules with same issue : - ExtUtils-MakeMaker : see https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/pull/69, merged and shipped with 6.77_02 - Module-Builder : see https://github.com/Perl-Toolchain-Gang/Module-Build/pull/30 - ExtUtils-Constant : see https://rt.cpan.org/Ticket/Display.html?id=88645 - ExtUtils-Install : see https://rt.cpan.org/Ticket/Display.html?id=88644 )

Inline Patch ```diff diff --git a/lib/ExtUtils/t/Embed.t b/lib/ExtUtils/t/Embed.t index 7a83c98..380ae93 100644 --- a/lib/ExtUtils/t/Embed.t +++ b/lib/ExtUtils/t/Embed.t @@ -12,6 +12,10 @@ use ExtUtils::Embed; use File::Spec; +if ( $Config{'usecrosscompile'} ) { + print "1..0 # SKIP no toolchain installed when cross-compiling\n"; + exit 0; +} open(my $fh,">embed_test.c") || die "Cannot open embed_test.c:$!"; print $fh ; close($fh); -- 1.7.9.5 ```
Perl Info ``` Flags: category=library severity=low Site configuration information for perl 5.18.1: Configured by fperrad at Tue Sep 10 09:04:04 CEST 2013. Summary of my perl5 (revision 5 version 18 subversion 1) configuration: Platform: osname=linux, osvers=3.2.0-49-generic, archname=i686-linux uname='linux gperrad-laptop 3.2.0-49-generic #75-ubuntu smp tue jun 18 17:40:13 utc 2013 i686 i686 i386 gnulinux ' config_args='-de -Dprefix=/home/fperrad/perl5/perlbrew/perls/perl-5.18.1 -Aeval:scriptdir=/home/fperrad/perl5/perlbrew/perls/perl-5.18.1/bin' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=undef, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2', cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include' ccversion='', gccversion='4.6.3', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='cc', ldflags =' -fstack-protector -L/usr/local/lib' libpth=/usr/local/lib /lib/i386-linux-gnu /lib/../lib /usr/lib/i386-linux-gnu /usr/lib/../lib /lib /usr/lib libs=-lnsl -ldl -lm -lcrypt -lutil -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc libc=, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.15' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector' Locally applied patches: @INC for perl 5.18.1: /home/fperrad/perl5/perlbrew/perls/perl-5.18.1/lib/site_perl/5.18.1/i686-linux /home/fperrad/perl5/perlbrew/perls/perl-5.18.1/lib/site_perl/5.18.1 /home/fperrad/perl5/perlbrew/perls/perl-5.18.1/lib/5.18.1/i686-linux /home/fperrad/perl5/perlbrew/perls/perl-5.18.1/lib/5.18.1 . Environment for perl 5.18.1: HOME=/home/fperrad LANG=en_US.UTF-8 LANGUAGE=fr:en LC_ADDRESS=fr_FR.UTF-8 LC_IDENTIFICATION=fr_FR.UTF-8 LC_MEASUREMENT=fr_FR.UTF-8 LC_MONETARY=fr_FR.UTF-8 LC_NAME=fr_FR.UTF-8 LC_NUMERIC=fr_FR.UTF-8 LC_PAPER=fr_FR.UTF-8 LC_TELEPHONE=fr_FR.UTF-8 LC_TIME=fr_FR.UTF-8 LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/home/fperrad/perl5/perlbrew/bin:/home/fperrad/perl5/perlbrew/perls/perl-5.18.1/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games PERLBREW_BASHRC_VERSION=0.64 PERLBREW_HOME=/home/fperrad/.perlbrew PERLBREW_MANPATH=/home/fperrad/perl5/perlbrew/perls/perl-5.18.1/man PERLBREW_PATH=/home/fperrad/perl5/perlbrew/bin:/home/fperrad/perl5/perlbrew/perls/perl-5.18.1/bin PERLBREW_PERL=perl-5.18.1 PERLBREW_ROOT=/home/fperrad/perl5/perlbrew PERLBREW_VERSION=0.64 PERL_BADLANG (unset) SHELL=/bin/bash ```
p5pRT commented 11 years ago

From @tonycoz

On Fri Sep 13 00​:35​:36 2013\, fperrad wrote​:

The toolchain is not installed on the target when cross-compiling. So\, this test must be skipped\, see patch below.

Thanks\, applied as 21869cac5ad982d653d92969f57df591682e8998.

Tony

p5pRT commented 11 years ago

The RT System itself - Status changed from 'new' to 'open'

p5pRT commented 11 years ago

@tonycoz - Status changed from 'open' to 'resolved'

p5pRT commented 11 years ago

From @Hugmeir

On Fri\, Sep 13\, 2013 at 4​:35 AM\, Francois PERRAD \perlbug\-followup@​perl\.orgwrote​:

# New Ticket Created by Francois PERRAD # Please include the string​: [perl #119769] # in the subject line of all future correspondence about this issue. # \<URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=119769 >

This is a bug report for perl from francois.perrad@​gadz.org\, generated with the help of perlbug 1.39 running under perl 5.18.1.

----------------------------------------------------------------- [Please describe your issue here]

The toolchain is not installed on the target when cross-compiling. So\, this test must be skipped\, see patch below.

(info for dual life modules with same issue : - ExtUtils-MakeMaker : see https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/pull/69, merged and shipped with 6.77_02 - Module-Builder : see https://github.com/Perl-Toolchain-Gang/Module-Build/pull/30 - ExtUtils-Constant : see https://rt.cpan.org/Ticket/Display.html?id=88645 - ExtUtils-Install : see https://rt.cpan.org/Ticket/Display.html?id=88644 )

diff --git a/lib/ExtUtils/t/Embed.t b/lib/ExtUtils/t/Embed.t index 7a83c98..380ae93 100644 --- a/lib/ExtUtils/t/Embed.t +++ b/lib/ExtUtils/t/Embed.t @​@​ -12\,6 +12\,10 @​@​ use ExtUtils​::Embed; use File​::Spec;

+if ( $Config{'usecrosscompile'} ) { + print "1..0 # SKIP no toolchain installed when cross-compiling\n"; + exit 0; +} open(my $fh\,">embed_test.c") || die "Cannot open embed_test.c​:$!"; print $fh \; close($fh); -- 1.7.9.5

Pardons\, dropped the ball on this one. I meant to reply before it got applied\, but oh well.

It's not necessarily true that the toolchain is not installed when cross-compiling. Particularly\, with castaway's branch\, it is installed\, but generally useless *unless* the target OS does a bit of extra legwork to have all the proper binaries with the correct names in place. That might seem like a stretch\, but I bet that a bunch of people on the list have a device that does exactly that​: the Raspberry Pi. You cross-compile using arm-linux-gnueabihf-gcc\, and the raspi itself provides a arm-linux-gnueabihf-gcc\, which is a symlink to gcc.

The applied patch isn't intrusive and does help the current cross-compilation situation\, so no need to revert it or anything\, but whenever castaway's branch is merged we can deal with this better\, perhaps doing something like this​: https://github.com/Hugmeir/utf8mess/commit/e4c8127787478ea81e5de0e6d358146940908433

p5pRT commented 11 years ago

From @tonycoz

On Mon\, Sep 16\, 2013 at 09​:40​:54PM -0300\, Brian Fraser wrote​:

The applied patch isn't intrusive and does help the current cross-compilation situation\, so no need to revert it or anything\, but whenever castaway's branch is merged we can deal with this better\, perhaps doing something like this​: https://github.com/Hugmeir/utf8mess/commit/e4c8127787478ea81e5de0e6d358146940908433

What's the chance of at least part of castaway's branch landing?

I suspect having it land as one huge chunk is going to be painful.

Tony

p5pRT commented 11 years ago

From @Hugmeir

On Mon\, Sep 16\, 2013 at 9​:48 PM\, Tony Cook \tony@&#8203;develop\-help\.com wrote​:

On Mon\, Sep 16\, 2013 at 09​:40​:54PM -0300\, Brian Fraser wrote​:

The applied patch isn't intrusive and does help the current cross-compilation situation\, so no need to revert it or anything\, but whenever castaway's branch is merged we can deal with this better\, perhaps doing something like this​:

https://github.com/Hugmeir/utf8mess/commit/e4c8127787478ea81e5de0e6d358146940908433

What's the chance of at least part of castaway's branch landing?

I suspect having it land as one huge chunk is going to be painful.

From a quick look\, if the ~20 not-android-related commits that change Configure land\, everything else is pretty self-contained and should be easy to feed incrementally. Tux said those needed to be okay'd by Nicholas and rjbs beforehand\, though. With just the Configure-specific bits\, you could get a full(?) perl on the raspi\, and a half-working perl in android that's closer to miniperl than anything else\, but a perl nonetheless. Tests for both would only go as far as porting/. A roadblock is that it'll break WinCE again\, because those Makefiles need to be updated manually.

p5pRT commented 11 years ago

From @tux

On Mon\, 16 Sep 2013 22​:06​:08 -0300\, Brian Fraser \fraserbn@&#8203;gmail\.com wrote​:

On Mon\, Sep 16\, 2013 at 9​:48 PM\, Tony Cook \tony@&#8203;develop\-help\.com wrote​:

On Mon\, Sep 16\, 2013 at 09​:40​:54PM -0300\, Brian Fraser wrote​:

The applied patch isn't intrusive and does help the current cross-compilation situation\, so no need to revert it or anything\, but whenever castaway's branch is merged we can deal with this better\, perhaps doing something like this​:

https://github.com/Hugmeir/utf8mess/commit/e4c8127787478ea81e5de0e6d358146940908433

What's the chance of at least part of castaway's branch landing?

I suspect having it land as one huge chunk is going to be painful.

From a quick look\, if the ~20 not-android-related commits that change Configure land\, everything else is pretty self-contained and should be easy to feed incrementally. Tux said those needed to be okay'd by Nicholas and rjbs beforehand\, though. With just the Configure-specific bits\, you could get a full(?) perl on the raspi\, and a half-working perl in android that's closer to miniperl than anything else\, but a perl nonetheless. Tests for both would only go as far as porting/. A roadblock is that it'll break WinCE again\, because those Makefiles need to be updated manually.

I need signals well in advance please\, so I can start the work. If I integrate this branch\, I will have to break down all the Configure changes into separate diff's for meta\, and I will regenerate Configure into one single blead commit\, unless higher powers want to see each commit back in Configure changes like cherry-picks (which they are not)

-- H.Merijn Brand http​://tux.nl Perl Monger http​://amsterdam.pm.org/ using perl5.00307 .. 5.19 porting perl5 on HP-UX\, AIX\, and openSUSE http​://mirrors.develooper.com/hpux/ http​://www.test-smoke.org/ http​://qa.perl.org http​://www.goldmark.org/jeff/stupid-disclaimers/

p5pRT commented 11 years ago

From @fperrad

2013/9/17 Brian Fraser \fraserbn@&#8203;gmail\.com​:

On Fri\, Sep 13\, 2013 at 4​:35 AM\, Francois PERRAD \perlbug\-followup@&#8203;perl\.org wrote​:

# New Ticket Created by Francois PERRAD # Please include the string​: [perl #119769] # in the subject line of all future correspondence about this issue. # \<URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=119769 >

This is a bug report for perl from francois.perrad@​gadz.org\, generated with the help of perlbug 1.39 running under perl 5.18.1.

----------------------------------------------------------------- [Please describe your issue here]

The toolchain is not installed on the target when cross-compiling. So\, this test must be skipped\, see patch below.

(info for dual life modules with same issue : - ExtUtils-MakeMaker : see https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/pull/69, merged and shipped with 6.77_02 - Module-Builder : see https://github.com/Perl-Toolchain-Gang/Module-Build/pull/30 - ExtUtils-Constant : see https://rt.cpan.org/Ticket/Display.html?id=88645 - ExtUtils-Install : see https://rt.cpan.org/Ticket/Display.html?id=88644 )

diff --git a/lib/ExtUtils/t/Embed.t b/lib/ExtUtils/t/Embed.t index 7a83c98..380ae93 100644 --- a/lib/ExtUtils/t/Embed.t +++ b/lib/ExtUtils/t/Embed.t @​@​ -12\,6 +12\,10 @​@​ use ExtUtils​::Embed; use File​::Spec;

+if ( $Config{'usecrosscompile'} ) { + print "1..0 # SKIP no toolchain installed when cross-compiling\n"; + exit 0; +} open(my $fh\,">embed_test.c") || die "Cannot open embed_test.c​:$!"; print $fh \; close($fh); -- 1.7.9.5

Pardons\, dropped the ball on this one. I meant to reply before it got applied\, but oh well.

It's not necessarily true that the toolchain is not installed when cross-compiling. Particularly\, with castaway's branch\, it is installed\, but generally useless *unless* the target OS does a bit of extra legwork to have all the proper binaries with the correct names in place. That might seem like a stretch\, but I bet that a bunch of people on the list have a device that does exactly that​: the Raspberry Pi. You cross-compile using arm-linux-gnueabihf-gcc\, and the raspi itself provides a arm-linux-gnueabihf-gcc\, which is a symlink to gcc.

The applied patch isn't intrusive and does help the current cross-compilation situation\, so no need to revert it or anything\, but whenever castaway's branch is merged we can deal with this better\, perhaps doing something like this​: https://github.com/Hugmeir/utf8mess/commit/e4c8127787478ea81e5de0e6d358146940908433

well\, looks better than my initial patch.

so\, I improve my work with a new patch.

François

p5pRT commented 11 years ago

From @fperrad

0001-perl-cross.patch ```diff skip lib/ExtUtils/t/Embed.t when cross-compiling Signed-off-by: Francois Perrad diff --git a/lib/ExtUtils/t/Embed.t b/lib/ExtUtils/t/Embed.t index 192c738..421fe71 100644 --- a/lib/ExtUtils/t/Embed.t +++ b/lib/ExtUtils/t/Embed.t @@ -11,9 +11,11 @@ use Config; use ExtUtils::Embed; use File::Spec; +use IPC::Cmd qw(can_run); -if ( $Config{'usecrosscompile'} ) { - print "1..0 # SKIP no toolchain installed when cross-compiling\n"; +my $cc = $Config{'cc'}; +if ( $Config{'usecrosscompile'} && !can_run($cc) ) { + print "1..0 # SKIP compiler not available (cross-compiling)\n"; exit 0; } open(my $fh,">embed_test.c") || die "Cannot open embed_test.c:$!"; @@ -22,7 +24,6 @@ $| = 1; print "1..10\n"; -my $cc = $Config{'cc'}; my $cl = ($^O eq 'MSWin32' && $cc eq 'cl'); my $skip_exe = $^O eq 'os2' && $Config{ldflags} =~ /(?