Re: [Module::Build] MB-Compat uses wrong perl - FOLLOWUP
Status: Beta
Brought to you by:
kwilliams
|
From: Jim C. <jc...@di...> - 2003-12-21 15:18:41
|
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
>
> .
>
|