Skip Menu |

This queue is for tickets about the CPANPLUS CPAN distribution.

Report information
The Basics
Id: 56431
Status: resolved
Worked: 10 min
Priority: 0/
Queue: CPANPLUS

People
Owner: BINGOS [...] cpan.org
Requestors: jjore [...] cpan.org
Cc:
AdminCc:

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



Subject: CPANPLUS in core perl use /usr/local/cpan-run-perl
CPANPLUS has logic to find cpanp-run-perl but when this runs during perl-5.12.0's own `make test`, it runs the program /usr/local/bin/cpanp-run-perl instead of the script packaged with perl. Jos Boumans already fixed the lookup in core perl with the commit 8c57606294f48eb065dff03f7ffefc1e4e2cdce4. Unfortunately, $ENV{PATH} has /usr/local/src/perl-5.12.0-RC4/cpan/CPANPLUS/t/../bin which has the scripts but they aren't executable. We also need utils/ added to $ENV{PATH} because cpanp-run-perl has chmod+x over there. For diagnostics, my %ENV and the path to cpanp-run-perl that's found: $ENV1 = { 'DYLD_LIBRARY_PATH' => '/usr/local/src/perl-5.12.0-RC4', 'EMXSHELL' => 'sh', 'FTP_PASSIVE' => 1, 'HOME' => '/var/root', 'MAKEFLAGS' => '', 'MAKELEVEL' => '1', 'MFLAGS' => '', 'OLDPWD' => '/usr/local/src/perl-5.12.0-RC4', 'PATH' => '/usr/local/src/perl-5.12.0-RC4/cpan/CPANPLUS/t/../bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/PalmSDK/Current/bin:/usr/X11/bin', 'PERL' => './perl', 'PERL5LIB' => '../../lib:../../t:/usr/local/src/perl-5.12.0-RC4/cpan/CPANPLUS/t/../lib:/usr/local/src/perl-5.12.0-RC4/cpan/CPANPLUS/t/inc:/usr/local/src/perl-5.12.0-RC4/cpan/CPANPLUS/../../lib:/usr/local/src/perl-5.12.0-RC4/cpan/CPANPLUS/../../t:/usr/local/src/perl-5.12.0-RC4/cpan/CPANPLUS', 'PERL5_CPANPLUS_IS_RUNNING' => 53065, 'PERL5_CPANPLUS_IS_VERSION' => '0.90', 'PERL_CORE' => '../../t/perl', 'PERL_DESTRUCT_LEVEL' => '2', 'PWD' => '/usr/local/src/perl-5.12.0-RC4/cpan/CPANPLUS/t', 'SHELL' => '/bin/sh', 'SHLVL' => '3', 'TERM' => 'xterm', 'USER' => 'root', '_' => './perl' }; $cpanp_run_perl1 = [ '/usr/bin/cpanp-run-perl' ];
Chris Williams's fix for this is attached. Anyone desiring a fixed perl-5.12.0 can apply this to an extracted tarball with something like: patch -p1 < 0001-Add-the-utils-dir-to-ENV-PATH-if-running-under-PERL_.patch Anyone desiring to add this directly to their git repository of perl can use instead: git am 0001-Add-the-utils-dir-to-ENV-PATH-if-running-under-PERL_.patch This will cause the three failing tests to pass: cpan/CPANPLUS-Dist-Build/t/02_CPANPLUS-Dist-Build cpan/CPANPLUS/t/04_CPANPLUS-Module cpan/CPANPLUS/t/20_CPANPLUS-Dist-MM
Subject: 0001-Add-the-utils-dir-to-ENV-PATH-if-running-under-PERL_.patch
From 9c0c8114bce63bbdc907bcb9aa3d1698cf029c79 Mon Sep 17 00:00:00 2001 From: Chris Williams <chris@bingosnet.co.uk> Date: Thu, 8 Apr 2010 00:29:23 +0100 Subject: [PATCH] Add the utils/ dir to $ENV{PATH} if running under PERL_CORE for the CPANPLUS/CPANPLUS-Dist-Build tests --- cpan/CPANPLUS-Dist-Build/t/inc/conf.pl | 5 ++--- cpan/CPANPLUS/t/inc/conf.pl | 8 +++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/cpan/CPANPLUS-Dist-Build/t/inc/conf.pl b/cpan/CPANPLUS-Dist-Build/t/inc/conf.pl index a104eb9..506b3ed 100644 --- a/cpan/CPANPLUS-Dist-Build/t/inc/conf.pl +++ b/cpan/CPANPLUS-Dist-Build/t/inc/conf.pl @@ -29,11 +29,10 @@ BEGIN { ### add CPANPLUS' bin dir to the front of $ENV{PATH}, so that cpanp-run-perl ### and friends get picked up, only under PERL_CORE though. + $old_env_path = $ENV{PATH}; if ( $ENV{PERL_CORE} ) { - $old_env_path = $ENV{PATH}; $ENV{'PATH'} = join $Config{'path_sep'}, - grep { defined } "$FindBin::Bin/../../CPANPLUS/bin", $ENV{'PATH'}; - + grep { defined } "$FindBin::Bin/../../../utils", $ENV{'PATH'}; } ### Fix up the path to perl, as we're about to chdir diff --git a/cpan/CPANPLUS/t/inc/conf.pl b/cpan/CPANPLUS/t/inc/conf.pl index 4f6c3d6..44b358c 100644 --- a/cpan/CPANPLUS/t/inc/conf.pl +++ b/cpan/CPANPLUS/t/inc/conf.pl @@ -30,8 +30,14 @@ BEGIN { ### add our own path to the front of $ENV{PATH}, so that cpanp-run-perl ### and friends get picked up $old_env_path = $ENV{PATH}; - $ENV{'PATH'} = join $Config{'path_sep'}, + if ( $ENV{PERL_CORE} ) { + $ENV{'PATH'} = join $Config{'path_sep'}, + grep { defined } "$FindBin::Bin/../../../utils", $ENV{'PATH'}; + } + else { + $ENV{'PATH'} = join $Config{'path_sep'}, grep { defined } "$FindBin::Bin/../bin", $ENV{'PATH'}; + } ### Fix up the path to perl, as we're about to chdir ### but only under perlcore, or if the path contains delimiters, -- 1.7.0.GIT
For reference, the failing tests look like: cpan/CPANPLUS-Dist-Build/t/02_CPANPLUS-Dist-Build..............[ERROR] Build.PL failed: perl version 5.12.0 can't run /usr/local/src/perl-5.12.0-RC2/cpan/CPANPLUS-Dist-Build/../../lib/../../../../bin/cpanp-run-perl. Try the alternative(s): /usr/local/src/perl-5.12.0-RC2/cpan/CPANPLUS-Dist-Build/../../lib/../../../../bin/cpanp-run-perl5.10.0 (uses perl 5.12.0) Run "man perl" for more information about multiple version support in Mac OS X. [ERROR] Unable to create a new distribution object for 'Foo::Bar' -- cannot continue # Failed test ' Preparing module' # at t/02_CPANPLUS-Dist-Build.t line 112. FAILED at test 5 cpan/CPANPLUS/t/04_CPANPLUS-Module.............................perl version 5.12.0 can't run /usr/local/src/perl-5.12.0-RC2/cpan/CPANPLUS/../../lib/../../../../bin/cpanp-run-perl. Try the alternative(s): /usr/local/src/perl-5.12.0-RC2/cpan/CPANPLUS/../../lib/../../../../bin/cpanp-run-perl5.10.0 (uses perl 5.12.0) Run "man perl" for more information about multiple version support in Mac OS X. # Failed test ' Tested prereqs' # at t/04_CPANPLUS-Module.t line 309. FAILED at test 109 cpan/CPANPLUS/t/20_CPANPLUS-Dist-MM............................perl version 5.12.0 can't run /usr/local/src/perl-5.12.0-RC2/cpan/CPANPLUS/../../lib/../../../../bin/cpanp-run-perl. Try the alternative(s): /usr/local/src/perl-5.12.0-RC2/cpan/CPANPLUS/../../lib/../../../../bin/cpanp-run-perl5.10.0 (uses perl 5.12.0) Run "man perl" for more information about multiple version support in Mac OS X. # Failed test 'Testing module' # at t/20_CPANPLUS-Dist-MM.t line 108. FAILED at test 11
According to our records this has been resolved.