Skip Menu |

This queue is for tickets about the ExtUtils-Constant CPAN distribution.

Report information
The Basics
Id: 88645
Status: open
Priority: 0/
Queue: ExtUtils-Constant

People
Owner: Nobody in particular
Requestors: PERRAD [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: skip some tests when cross-compiling
the toolchain is not installed on the target when cross-compiling. there are no sense to install this module on target, but EUC is a part of Perl distribution. so that fixes the Perl test suite when cross-compiling. (same thing in EUMM, see https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/commit/8a68af92226faa44a548c926bd509ac7c39ee8be)
Subject: perl-cross-EUC.patch
diff --git a/t/Constant.t b/t/Constant.t index 5cc6f49..a47b6e1 100644 --- a/t/Constant.t +++ b/t/Constant.t @@ -2,7 +2,11 @@ use Config; unless ($Config{usedl}) { - print "1..0 # no usedl, skipping\n"; + print "1..0 # SKIP no usedl\n"; + exit 0; +} +if ($Config{'usecrosscompile'}) { + print "1..0 # SKIP no toolchain installed when cross-compiling\n"; exit 0; }
add patch V2
Subject: perl-cross-EUC-V2.patch
diff --git a/t/Constant.t b/t/Constant.t index 5cc6f49..1df97ea 100644 --- a/t/Constant.t +++ b/t/Constant.t @@ -1,8 +1,19 @@ #!/usr/bin/perl -w use Config; +use IPC::Cmd qw(can_run); + unless ($Config{usedl}) { - print "1..0 # no usedl, skipping\n"; + print "1..0 # SKIP no usedl\n"; + exit 0; +} + +my $make = $Config{make}; +$make = $ENV{MAKE} if exists $ENV{MAKE}; +if ($^O eq 'MSWin32' && $make eq 'nmake') { $make .= " -nologo"; } + +unless ( can_run($make) ) { + print "1..0 # SKIP make not available\n"; exit 0; } @@ -34,10 +45,6 @@ $^X = $perl; # module from blib @INC = map {File::Spec->rel2abs($_)} @INC if $] < 5.007 && $] >= 5.006; -my $make = $Config{make}; -$make = $ENV{MAKE} if exists $ENV{MAKE}; -if ($^O eq 'MSWin32' && $make eq 'nmake') { $make .= " -nologo"; } - # VMS may be using something other than MMS/MMK my $mms_or_mmk = 0; my $vms_lc = 0;
On Mon Sep 23 07:23:35 2013, PERRAD wrote: Show quoted text
> add patch V2
Sorry for the delay in replying. The link to the github patch no longer works, which is unfortunate, as I'm not convinced that the logic-as is in this patch is quite correct: +my $make = $Config{make}; +$make = $ENV{MAKE} if exists $ENV{MAKE}; +if ($^O eq 'MSWin32' && $make eq 'nmake') { $make .= " -nologo"; } + +unless ( can_run($make) ) { + print "1..0 # SKIP make not available\n"; exit 0; } I don't have access to Win32, certainly not with nmake, but from inspection, doesn't the code as written 1: change $make from "nmake" to "nmake -nologo" 2: then call can_run with the string "nmake -nologo" 3: which contains this code: for my $dir ( File::Spec->path, File::Spec->curdir ) { next if ! $dir || ! -d $dir; my $abs = File::Spec->catfile( IS_WIN32 ? Win32::GetShortPathName( $dir ) : $dir, $command); push @possibles, $abs if $abs = MM->maybe_command($abs); } which will call Win32::GetShortPathName("nmake -nologo") and will generate a shortname for "nmake -nologo" *not* for "nmake" 4: and then pass that to MM: sub maybe_command { my($self,$file) = @_; my @e = exists($ENV{'PATHEXT'}) ? split(/;/, $ENV{PATHEXT}) : qw(.com .exe .bat .cmd); my $e = ''; for (@e) { $e .= "\Q$_\E|" } chop $e; # see if file ends in one of the known extensions if ($file =~ /($e)$/i) { return $file if -e $file; } else { for (@e) { return "$file$_" if -e "$file$_"; } } return; } which will look on disk for (effectively) "nmake -nologo.exe" and hence not find it. ie - shouldn't the code to add " -nologo" be after the call to can_run()?
I use this patch when cross-compiling on linux (see https://github.com/arsv/perl-cross/blob/master/cnf/diffs/perl5-5.24.0/constant.patch). So, I didn't test it on Windows. You are right. The line with "nologo" must stay in its original location.
Subject: perl-cross-EUC-V3.patch
skip some tests when cross-compiling Signed-off-by: Francois Perrad <francois.perrad@gadz.org> diff --git a/t/Constant.t b/t/Constant.t index d6b4566..c4ed28f 100644 --- a/t/Constant.t +++ b/t/Constant.t @@ -1,8 +1,18 @@ #!/usr/bin/perl -w use Config; +use IPC::Cmd qw(can_run); + unless ($Config{usedl}) { - print "1..0 # no usedl, skipping\n"; + print "1..0 # SKIP no usedl\n"; + exit 0; +} + +my $make = $Config{make}; +$make = $ENV{MAKE} if exists $ENV{MAKE}; + +unless ( can_run($make) ) { + print "1..0 # SKIP make not available\n"; exit 0; } @@ -34,8 +44,6 @@ $ # module from blib @INC = map {File::Spec->rel2abs($_)} @INC if $] < 5.007 && $] >= 5.006; -my $make = $Config{make}; -$make = $ENV{MAKE} if exists $ENV{MAKE}; if ($^O eq 'MSWin32' && $make eq 'nmake') { $make .= " -nologo"; } # VMS may be using something other than MMS/MMK --