Thread: [Module::Build] MB uses wrong perl
Status: Beta
Brought to you by:
kwilliams
|
From: Jim C. <jc...@di...> - 2003-11-29 00:51:18
|
when I use an older perl (ex: perl5.6.2) to build the Makefile, several
things go wrong;
1. Makefile uses /usr/local/bin/perl, not /usr/local/bin/perl5.6.2
all : force_do_it
/usr/local/bin/perl Build
This patch 'seems' to fix this prob (but does nothing for my separate
hanging problem).
I saw your Change notes about $^X unreliability, so this may not be the
thing, but its a start..
diff -ru Module-Build-0.21/lib/Module/Build/Base.pm
Module-Build-0.21-mod/lib/Module/Build/Base.pm
--- Module-Build-0.21/lib/Module/Build/Base.pm Wed Oct 15 19:25:18 2003
+++ Module-Build-0.21-mod/lib/Module/Build/Base.pm Fri Nov 7
17:10:22 2003
@@ -166,8 +166,8 @@
sub find_perl_interpreter {
my $perl;
File::Spec->file_name_is_absolute($perl = $^X)
- or -f ($perl = $Config::Config{perlpath})
- or ($perl = $^X);
+ or ($perl = $^X)
+ or -f ($perl = $Config::Config{perlpath});
return $perl;
}
2. executable version mismatch.
[root@harpo Module-Build-0.21]# perl5.6.2 Makefile.PL
perl5.6.2 Build.PL
Checking whether your kit is complete...
Looks good
WARNING: ExtUtils::ParseXS: Prerequisite ExtUtils::ParseXS isn't installed
WARNING: YAML: Prerequisite YAML isn't installed
ERRORS/WARNINGS FOUND IN PREREQUISITES. You may wish to install the
versions
of the modules indicated above before proceeding with this installation.
Deleting Build
Removed previous script 'Build'
Creating new 'Build' script for 'Module-Build' version '0.21'
[root@harpo Module-Build-0.21]# make
/usr/local/bin/perl Build
Perl lib version (v5.6.2) doesn't match executable version (v5.8.2) at
/usr/local/lib/perl5/5.6.2/i686-linux/Config.pm line 21.
guidance appreciated,
reqs for more info welcome,
jimc
|
|
From: Randy W. S. <Ra...@Th...> - 2003-11-29 11:02:59
|
On 11/28/2003 7:51 PM, Jim Cromie wrote:
>
> when I use an older perl (ex: perl5.6.2) to build the Makefile, several
> things go wrong;
>
> 1. Makefile uses /usr/local/bin/perl, not /usr/local/bin/perl5.6.2
>
> all : force_do_it
> /usr/local/bin/perl Build
>
> This patch 'seems' to fix this prob (but does nothing for my separate
> hanging problem).
> I saw your Change notes about $^X unreliability, so this may not be the
> thing, but its a start..
>
> diff -ru Module-Build-0.21/lib/Module/Build/Base.pm
> Module-Build-0.21-mod/lib/Module/Build/Base.pm
> --- Module-Build-0.21/lib/Module/Build/Base.pm Wed Oct 15 19:25:18 2003
> +++ Module-Build-0.21-mod/lib/Module/Build/Base.pm Fri Nov 7
> 17:10:22 2003
> @@ -166,8 +166,8 @@
> sub find_perl_interpreter {
> my $perl;
> File::Spec->file_name_is_absolute($perl = $^X)
> - or -f ($perl = $Config::Config{perlpath})
> - or ($perl = $^X);
> + or ($perl = $^X)
> + or -f ($perl = $Config::Config{perlpath});
> return $perl;
> }
>
>
> 2. executable version mismatch.
>
>
> [root@harpo Module-Build-0.21]# perl5.6.2 Makefile.PL
> perl5.6.2 Build.PL
> Checking whether your kit is complete...
> Looks good
> WARNING: ExtUtils::ParseXS: Prerequisite ExtUtils::ParseXS isn't installed
> WARNING: YAML: Prerequisite YAML isn't installed
> ERRORS/WARNINGS FOUND IN PREREQUISITES. You may wish to install the
> versions
> of the modules indicated above before proceeding with this installation.
>
> Deleting Build
> Removed previous script 'Build'
> Creating new 'Build' script for 'Module-Build' version '0.21'
> [root@harpo Module-Build-0.21]# make
> /usr/local/bin/perl Build
> Perl lib version (v5.6.2) doesn't match executable version (v5.8.2) at
> /usr/local/lib/perl5/5.6.2/i686-linux/Config.pm line 21.
>
>
> guidance appreciated,
> reqs for more info welcome,
>
> jimc
>
perl -V
WAG. Is @INC pointing to the right places.
Randy.
|
|
From: Nicholas C. <ni...@cc...> - 2003-11-29 11:24:57
|
On Fri, Nov 28, 2003 at 05:51:16PM -0700, Jim Cromie wrote:
> sub find_perl_interpreter {
> my $perl;
> File::Spec->file_name_is_absolute($perl = $^X)
> - or -f ($perl = $Config::Config{perlpath})
> - or ($perl = $^X);
> + or ($perl = $^X)
^^ that will always be true (unless perl is named "0" and . is in
your PATH)
> + or -f ($perl = $Config::Config{perlpath});
hence this will never be reached
> perl -V
>
> WAG. Is @INC pointing to the right places.
Inline had what seemed to be the same problem. It occurs when you
install (say) 5.6.1, and it "knows" that it is /usr/local/bin/perl
(ie
/usr/local/bin/perl5.6.1 -MConfig -le 'print $Config::Config{perlpath}'
will give that.)
Later you install 5.8.2 in /usr/local/bin. /usr/local/bin/perl is now
a hard link to /usr/local/bin/perl5.8.2
and its Config thinks (correctly) that it is /usr/local/bin/perl
However, 5.6.1 is still available as /usr/local/bin/perl5.6.1, and so:
$ /usr/local/bin/perl5.6.1 -MConfig -le 'print $Config::Config{perlpath}'
/usr/local/bin/perl
So if you explictly run your script as /usr/local/bin/perl5.6.1 Build.PL
$^X points to the right thing, but $Config::Config{perlpath} no longer does.
If this is the same problem, offhand I can't remember the best way to solve
it. Pinch the code from Inline :-)
Nicholas Clark
|
|
From: Jim C. <jc...@di...> - 2003-12-01 00:17:48
|
Nicholas Clark wrote:
>On Fri, Nov 28, 2003 at 05:51:16PM -0700, Jim Cromie wrote:
>
>
Following up on this thread I started, P5P has discussions today which
appear to explain this;
xsubpp is now installed into bin not lib, so a box with multiple
versions can get fouled up.
I havent yet proven that this is my problem, but it sounds right.
Subject: xsubpp is not installed.
thanks Nick
>>sub find_perl_interpreter {
>> my $perl;
>> File::Spec->file_name_is_absolute($perl = $^X)
>>- or -f ($perl = $Config::Config{perlpath})
>>- or ($perl = $^X);
>>+ or ($perl = $^X)
>>
>>
>
> ^^ that will always be true (unless perl is named "0" and . is in
>your PATH)
>
>
>
>>+ or -f ($perl = $Config::Config{perlpath});
>>
>>
>
>hence this will never be reached
>
>
I think thats the point - to set $perl one way or the other.
preferring an absolute path form of $^X, or %Configs notion, or just $^X.
>
>
>>perl -V
>>
>>WAG. Is @INC pointing to the right places.
>>
>>
>
>Inline had what seemed to be the same problem. It occurs when you
>install (say) 5.6.1, and it "knows" that it is /usr/local/bin/perl
>(ie
>/usr/local/bin/perl5.6.1 -MConfig -le 'print $Config::Config{perlpath}'
>will give that.)
>
>Later you install 5.8.2 in /usr/local/bin. /usr/local/bin/perl is now
>a hard link to /usr/local/bin/perl5.8.2
>and its Config thinks (correctly) that it is /usr/local/bin/perl
>However, 5.6.1 is still available as /usr/local/bin/perl5.6.1, and so:
>
>$ /usr/local/bin/perl5.6.1 -MConfig -le 'print $Config::Config{perlpath}'
>/usr/local/bin/perl
>
>So if you explictly run your script as /usr/local/bin/perl5.6.1 Build.PL
>$^X points to the right thing, but $Config::Config{perlpath} no longer does.
>
>If this is the same problem, offhand I can't remember the best way to solve
>it. Pinch the code from Inline :-)
>
>Nicholas Clark
>
>
>
|
|
From: Jim C. <jc...@di...> - 2003-12-21 15:18:41
Attachments:
patch.perlpath2
|
I wanted to follow up on this problem, and restate for
clarity. (original at bottom).
Im using MB::Compat, ie: perl Makefile.PL ---> Makefile.
When 'perl5.6.2' is substituted for 'perl', things go wrong.
since 'perl5.6.2' is not an absolute path,
MB::find_perl_interpreter()s 1st attempt fails,
ie: 'File::Spec->file_name_is_absolute($perl = $^X) '
then '-f ($perl = $Config::Config{perlpath})',
succeeds, returning "/usr/local/bin/perl"
since my /usr/local/bin/perl is 5.8.2, not 5.6.2, all
manner of badness ensues. Makefile uses
/usr/local/bin/perl, but Build script contains
5.6.2 lib-paths etc, resulting in:
[jimc@harpo Data-Dumper-EasyOO-0.02-p1]$ make
/usr/local/bin/perl Build
Perl lib version (v5.6.2) doesn't match executable version
(v5.8.2) at
/usr/local/lib/perl5/5.6.2/i686-linux/Config.pm line 21.
This is due in part to value of $^X,
which is full path for 5.8.2, but not for others.
$> perl -e 'print "$^X\n"'
/usr/local/bin/perl5.8.2-threads
$> perl5.6.2 -e 'print "$^X\n"'
perl5.6.2
$> perl5.00503 -e 'print "$^X\n"'
perl5.00503
$> perl5.6.1 -e 'print "$^X\n"'
perl5.6.1
Its also clear that my %Config is wrong; due to a 5.6.2
-des build/install into /usr/local/bin/perl, and a 5.8.2
install on top. Since installs also appear to write
/usr/local/bin/perl$version, this could probably be fixed by
a CORE patch to make perlpath use the complete, versioned
name (ie /usr/local/bin/perl5.6.2 thats also? installed),
but there are a lot of perls already out there, and Im not
sure it wouldnt break other things.
So I see the following options:
1. use full path when 'making' for older perls
2. use my patch below (works for .21_01 too)
3. a more robust patch, something like
# make full pathname from filename
($perl) = grep { -x "$_/$^X "} File::Spec->path()
The attached patch takes this approach.
4. a warning in MB::Cookbook - I dont like this - the root
cause seems eminently fixable...
Jim Cromie wrote:
>
> when I use an older perl (ex: perl5.6.2) to build the Makefile,
> several things go wrong;
>
> 1. Makefile uses /usr/local/bin/perl, not /usr/local/bin/perl5.6.2
>
> all : force_do_it
> /usr/local/bin/perl Build
>
> This patch 'seems' to fix this prob (but does nothing for my separate
> hanging problem).
> I saw your Change notes about $^X unreliability, so this may not be
> the thing, but its a start..
>
> diff -ru Module-Build-0.21/lib/Module/Build/Base.pm
> Module-Build-0.21-mod/lib/Module/Build/Base.pm
> --- Module-Build-0.21/lib/Module/Build/Base.pm Wed Oct 15 19:25:18
> 2003
> +++ Module-Build-0.21-mod/lib/Module/Build/Base.pm Fri Nov 7
> 17:10:22 2003
> @@ -166,8 +166,8 @@
> sub find_perl_interpreter {
> my $perl;
> File::Spec->file_name_is_absolute($perl = $^X)
> - or -f ($perl = $Config::Config{perlpath})
> - or ($perl = $^X);
> + or ($perl = $^X)
> + or -f ($perl = $Config::Config{perlpath});
> return $perl;
> }
>
>
> 2. executable version mismatch.
>
>
> [root@harpo Module-Build-0.21]# perl5.6.2 Makefile.PL
> perl5.6.2 Build.PL
> Checking whether your kit is complete...
> Looks good
> WARNING: ExtUtils::ParseXS: Prerequisite ExtUtils::ParseXS isn't
> installed
> WARNING: YAML: Prerequisite YAML isn't installed
> ERRORS/WARNINGS FOUND IN PREREQUISITES. You may wish to install the
> versions
> of the modules indicated above before proceeding with this installation.
>
> Deleting Build
> Removed previous script 'Build'
> Creating new 'Build' script for 'Module-Build' version '0.21'
> [root@harpo Module-Build-0.21]# make
> /usr/local/bin/perl Build
> Perl lib version (v5.6.2) doesn't match executable version (v5.8.2) at
> /usr/local/lib/perl5/5.6.2/i686-linux/Config.pm line 21.
>
>
> guidance appreciated,
> reqs for more info welcome,
>
> jimc
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: SF.net Giveback Program.
> Does SourceForge.net help you be more productive? Does it
> help you create better code? SHARE THE LOVE, and help us help
> YOU! Click Here: http://sourceforge.net/donate/
> _______________________________________________
> Module-build-general mailing list
> Mod...@li...
> https://lists.sourceforge.net/lists/listinfo/module-build-general
>
> .
>
|