Thanks for taking the time over this!
The obvious way forward is to have that test simply not use autodie, which I
will put in my next Merge Request for Chris to ignore ;-)
-----Original Message-----
From: ***@optusnet.com.au
Sent: Tuesday, January 27, 2015 11:33 PM
To: Ed
Cc: pdl-porters
Subject: Re: [Pdl-porters] Support for perl-5.8.x in PDL-2.008 ?
-----Original Message-----
From: Ed
Sent: Wednesday, January 28, 2015 3:23 AM
To: ***@optusnet.com.au
Cc: pdl-porters
Subject: Re: [Pdl-porters] Support for perl-5.8.x in PDL-2.008 ?
Post by Edt/lut.t passes on my perlbrew 5.8.9 on Linux. I'm not going to go through
the agony of making a Windows 5.8.9. Can you tell me what the failure
message is, so I can fix it?
On 5.8.8:
#################################
C:\sisyphusion\PDL-2.007_08>perl -Mblib t/lut.t
1..8
# Running under perl version 5.008008 for MSWin32
# Current time local: Wed Jan 28 09:11:59 2015
# Current time GMT: Tue Jan 27 22:11:59 2015
# Using Test.pm version 1.25
Can't locate autodie.pm in @INC (@INC contains:
C:\sisyphusion\PDL-2.007_08\blib\arch C:\sisyphusion\PDL-2.007_08\blib\lib
C:/MinGW/perl588/lib C:/MinGW/perl588/site/lib .) at
C:\sisyphusion\PDL-2.007_08blib\lib/PDL/Graphics/LUT.pm line 131.
BEGIN failed--compilation aborted at
C:\sisyphusion\PDL-2.007_08\blib\lib/PDL/Graphics/LUT.pm line 131.
Compilation failed in require at t/lut.t line 12.
BEGIN failed--compilation aborted at t/lut.t line 12.
#################################
I then installed autodie 2.19
#################################
C:\sisyphusion\PDL-2.007_08>perl -Mblib t/lut.t
1..8
# Running under perl version 5.008008 for MSWin32
# Current time local: Wed Jan 28 09:17:58 2015
# Current time GMT: Tue Jan 27 22:17:58 2015
# Using Test.pm version 1.25
Incorrect version of Fatal.pm loaded by autodie.
The autodie pragma uses an updated version of Fatal to do its heavy lifting.
We seem to have loaded Fatal version 1.03, which is probably the version
that came with your version of Perl. However autodie needs version 2.19,
which would have come bundled with autodie.
You may be able to solve this problem by adding the following line of code
to your main program, before any use of Fatal or autodie.
use lib "C:/MinGW/perl588/site/lib/";
at C:/MinGW/perl588/site/lib/autodie.pm line 53
BEGIN failed--compilation aborted at C:/MinGW/perl588/site/lib/autodie.pm
line 53.
Compilation failed in require at
C:\sisyphusion\PDL-2.007_08\blib\lib/PDL/Graphics/LUT.pm line 131.
BEGIN failed--compilation aborted at
C:\sisyphusion\PDL-2.007_08\blib\lib/PDL/Graphics/LUT.pm line 131.
Compilation failed in require at t/lut.t line 12.
BEGIN failed--compilation aborted at t/lut.t line 12.
#################################
The problem there is that perl/lib comes ahead of perl/site/lib in @INC so,
although the requisite Fatal.pm has been installed, it's still the old
version in perl/lib that gets found first.
If I hide perl/lib/Fatal.pm I get:
#################################
C:\sisyphusion\PDL-2.007_08>perl -Mblib t/lut.t
1..8
# Running under perl version 5.008008 for MSWin32
# Current time local: Wed Jan 28 09:32:55 2015
# Current time GMT: Tue Jan 27 22:32:55 2015
# Using Test.pm version 1.25
ok 1
ok 2
ok 3
ok 4
ok 5
ok 6
ok 7
ok 8
#################################
On Windows perl/site/lib came after perl/lib in @INC until perl 5.12.0 (when
sanity finally came to prevail).
So:
1) Add autodie to prereq_pm;
2) At the beginning of t/lut.t we need something like:
BEGIN {
# Swap $INC[-3] and $INC[-2] on 5.8.x builds of Windows perl
if($^O =~ /MSWin32/i && $] < 5.009 &&
$INC[-3] =~ /(\\|\/)lib/ &&
$INC[-2] =~ /site(\\|\/)lib/) {
my $first = $INC[-2];
$INC[-2] = $INC[-3];
$INC[-3] = $first;
}
}
Maybe you can think of something better for 2)
It makes assumptions that it oughtn't make, though I'd be surprised if it
ever strikes a situation where it fails to work as intended.
(But then I'd be surprised if PDL ever gets built on a Windows build of
perl-5.8.x - other than my own.)
What way to waste an hour ;-)
Cheers,
Rob