This queue is for tickets about the Module-Build CPAN distribution.

Report information
The Basics
Id:
66549
Status:
open
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
chad.a.davis [...] gmail.com
Cc:
AdminCc:



Subject: unshift vs push onto @INC
Assume I'm trying to install Dummy::Module from the CPAN shell, and Dummy::Module depends on Dummy::Prereq 0.02, and Dummy::Prereq 0.01 is available in $PERL5LIB (in a non-standard location, e.g. from local::lib). M::B makes a ./Build script that 'unshifts' all of the non-standard directories from $PERL5LIB onto the front of @INC. M::B notices the unsatisfied dependency. CPAN.pm gets Dummy::Prereq 0.02 and tests it, but does not install it, because Dummy::Module has to be tested first. Instead, it prepends ./blib/lib and ./blib/arch to $PERL5LIB so that the updated versions will be found. It then tests Dummy::Module, using M::B. However the ./Build script then unshifts onto @INC any non-standard directories from $PERL5LIB that were present *before* Dummy::Prereq 0.02 was prepended to $PERL5LIB. I.e. if you install your modules to a non- standard location, you cannot install any (M::B) module for which you have an outdated prereq installed. I have been sending (many?) false alarms from CPAN::Reporter::Smoker because of this. It is not clear to me why @INC should be manipulated; @INC already contains $PERL5LIB, but assuming it should be manipulated, 'push' seems better. I changed this in the current git version, all tests still pass (patch attached). I was not clever enough to come up with a standalone test that would cause M::B to fail, but I have a contrived example attached. The sh script should not be executed directly (it contains an exec statement to create a pristine environment), but rather copy-pasted into a terminal. The session file shows the output that I see. You should be able to reproduce this, as long as your systems's perl install has a reasonably recent M::B. This issue happens to me on: 64 bit Perl 5.8.8 with MB 0.38 on CentOS 5.5 32 bit Perl 5.12.3 with MB 0.36 on Fedora 14 I also do not believe this depends on local::lib, as M::B finds any non- standard paths to prepend to @INC. I also believe that CPAN.pm is behaving as it should, as it prepends $PERL5LIB so that the updated prereqs can be found.
Subject: module-build-script.sh

Message body not shown because it is not plain text.

Subject: module-build-script-session.txt
Script started on Fri 11 Mar 2011 01:49:59 PM CET : bq_cdavis bq-pc-rr05 ~ ; # Start a clean shell, with no environment, : bq_cdavis bq-pc-rr05 ~ ; # (in any empty directory with write permission) : bq_cdavis bq-pc-rr05 ~ ; exec -cl /bin/bash --noprofile bash-4.1$ # Hide CPAN bash-4.1$ mv ~/.cpan{,.bak} mv: cannot stat `/home/bq_cdavis/.cpan': No such file or directory bash-4.1$ bash-4.1$ # Simple pmtools bash-4.1$ function pmvers { perl -M$1 -e 'print "\$$1::VERSION\n"' ; } bash-4.1$ pmvers Module::Build $::VERSION bash-4.1$ # 0.3603 <results with v0.38, but don't install it here, due to needing many prereqs bash-4.1$ bash-4.1$ # Bootstrap a new local::lib <cpan.org/CPAN/authors/id/A/AP/APEIRON/local-lib-1.008004.tar.gz bash-4.1$ wget -O - $ll | tar -xzf - --2011-03-11 13:50:06-- http://search.cpan.org/CPAN/authors/id/A/AP/APEIRON/local-lib-1.008004.tar.gz Resolving search.cpan.org... 194.106.223.155 Connecting to search.cpan.org|194.106.223.155|:80... connected. HTTP request sent, awaiting response... 302 Found Location: http://mirror.informatik.uni-mannheim.de/pub/mirrors/CPAN/authors/id/A/AP/APEIRON/local-lib-1.008004.tar.gz [following] --2011-03-11 13:50:07-- http://mirror.informatik.uni-mannheim.de/pub/mirrors/CPAN/authors/id/A/AP/APEIRON/local-lib-1.008004.tar.gz Resolving mirror.informatik.uni-mannheim.de... 134.155.89.123 Connecting to mirror.informatik.uni-mannheim.de|134.155.89.123|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 53977 (53K) [application/x-gzip] Saving to: `STDOUT' 100%[======================================>] 53,977 --.-K/s in 0.006s 2011-03-11 13:50:07 (8.99 MB/s) - written to stdout [53977/53977] bash-4.1$ cd local-lib-* bash-4.1$ perl Makefile.PL --bootstrap Attempting to create directory /home/bq_cdavis/perl5 *** Module::AutoInstall version 1.03 *** Checking for Perl dependencies... [Core Features] - ExtUtils::MakeMaker ...loaded. (6.56 >= 6.31) - ExtUtils::Install ...loaded. (1.55 >= 1.43) - Module::Build ...loaded. (0.3603 >= 0.36) - CPAN ...loaded. (1.9456 >= 1.82) *** Module::AutoInstall configuration finished. Checking if your kit is complete... Looks good Writing Makefile for local::lib bash-4.1$ make install cp lib/POD2/PT_BR/local/lib.pod blib/lib/POD2/PT_BR/local/lib.pod cp lib/lib/core/only.pm blib/lib/lib/core/only.pm cp lib/local/lib.pm blib/lib/local/lib.pm cp lib/POD2/DE/local/lib.pod blib/lib/POD2/DE/local/lib.pod Manifying blib/man3/POD2::PT_BR::local::lib.3pm Manifying blib/man3/lib::core::only.3pm Manifying blib/man3/local::lib.3pm Manifying blib/man3/POD2::DE::local::lib.3pm Installing /home/bq_cdavis/perl5/lib/perl5/local/lib.pm Installing /home/bq_cdavis/perl5/lib/perl5/POD2/PT_BR/local/lib.pod Installing /home/bq_cdavis/perl5/lib/perl5/POD2/DE/local/lib.pod Installing /home/bq_cdavis/perl5/lib/perl5/lib/core/only.pm Installing /home/bq_cdavis/perl5/man/man3/POD2::PT_BR::local::lib.3pm Installing /home/bq_cdavis/perl5/man/man3/lib::core::only.3pm Installing /home/bq_cdavis/perl5/man/man3/local::lib.3pm Installing /home/bq_cdavis/perl5/man/man3/POD2::DE::local::lib.3pm Appending installation info to /home/bq_cdavis/perl5/lib/perl5/i386-linux-thread-multi/perllocal.pod bash-4.1$ eval $(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib) bash-4.1$ # Check it bash-4.1$ echo $PERL5LIB /home/bq_cdavis/perl5/lib/perl5/i386-linux-thread-multi:/home/bq_cdavis/perl5/lib/perl5 bash-4.1$ cd .. bash-4.1$ bash-4.1$ # Probably don't have Test::More yet, otherwise skip this block <earch.cpan.org/CPAN/authors/id/M/MS/MSCHWERN/Test-Simple-0.98.tar.gz bash-4.1$ wget -O - $testmore|tar -xzf - --2011-03-11 13:50:09-- http://search.cpan.org/CPAN/authors/id/M/MS/MSCHWERN/Test-Simple-0.98.tar.gz Resolving search.cpan.org... 194.106.223.155 Connecting to search.cpan.org|194.106.223.155|:80... connected. HTTP request sent, awaiting response... 302 Found Location: http://ftp.gwdg.de/pub/languages/perl/CPAN/authors/id/M/MS/MSCHWERN/Test-Simple-0.98.tar.gz [following] --2011-03-11 13:50:09-- http://ftp.gwdg.de/pub/languages/perl/CPAN/authors/id/M/MS/MSCHWERN/Test-Simple-0.98.tar.gz Resolving ftp.gwdg.de... 134.76.12.3 Connecting to ftp.gwdg.de|134.76.12.3|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 107255 (105K) [application/x-gzip] Saving to: `STDOUT' 100%[======================================>] 107,255 --.-K/s in 0.1s 2011-03-11 13:50:09 (909 KB/s) - written to stdout [107255/107255] bash-4.1$ cd Test-Simple-* bash-4.1$ perl Makefile.PL Checking if your kit is complete... Looks good Writing Makefile for Test::Simple bash-4.1$ make install cp lib/Test/Builder/Tester/Color.pm blib/lib/Test/Builder/Tester/Color.pm cp lib/Test/Builder.pm blib/lib/Test/Builder.pm cp lib/Test/Simple.pm blib/lib/Test/Simple.pm cp lib/Test/Builder/IO/Scalar.pm blib/lib/Test/Builder/IO/Scalar.pm cp lib/Test/More.pm blib/lib/Test/More.pm cp lib/Test/Builder/Module.pm blib/lib/Test/Builder/Module.pm cp lib/Test/Builder/Tester.pm blib/lib/Test/Builder/Tester.pm cp lib/Test/Tutorial.pod blib/lib/Test/Tutorial.pod Manifying blib/man3/Test::Builder::Tester::Color.3pm Manifying blib/man3/Test::Simple.3pm Manifying blib/man3/Test::Builder.3pm Manifying blib/man3/Test::Builder::IO::Scalar.3pm Manifying blib/man3/Test::More.3pm Manifying blib/man3/Test::Builder::Tester.3pm Manifying blib/man3/Test::Builder::Module.3pm Manifying blib/man3/Test::Tutorial.3pm Installing /home/bq_cdavis/perl5/lib/perl5/Test/Builder.pm Installing /home/bq_cdavis/perl5/lib/perl5/Test/Simple.pm Installing /home/bq_cdavis/perl5/lib/perl5/Test/More.pm Installing /home/bq_cdavis/perl5/lib/perl5/Test/Tutorial.pod Installing /home/bq_cdavis/perl5/lib/perl5/Test/Builder/Module.pm Installing /home/bq_cdavis/perl5/lib/perl5/Test/Builder/Tester.pm Installing /home/bq_cdavis/perl5/lib/perl5/Test/Builder/Tester/Color.pm Installing /home/bq_cdavis/perl5/lib/perl5/Test/Builder/IO/Scalar.pm Installing /home/bq_cdavis/perl5/man/man3/Test::Builder::Tester::Color.3pm Installing /home/bq_cdavis/perl5/man/man3/Test::Simple.3pm Installing /home/bq_cdavis/perl5/man/man3/Test::Builder.3pm Installing /home/bq_cdavis/perl5/man/man3/Test::Builder::IO::Scalar.3pm Installing /home/bq_cdavis/perl5/man/man3/Test::More.3pm Installing /home/bq_cdavis/perl5/man/man3/Test::Builder::Tester.3pm Installing /home/bq_cdavis/perl5/man/man3/Test::Builder::Module.3pm Installing /home/bq_cdavis/perl5/man/man3/Test::Tutorial.3pm Appending installation info to /home/bq_cdavis/perl5/lib/perl5/i386-linux-thread-multi/perllocal.pod bash-4.1$ cd .. bash-4.1$ bash-4.1$ # First, Assume we have an old version of the prereq bash-4.1$ dp01=http://dl.dropbox.com/u/6526608/Dummy-Prereq-0.01.tar.gz bash-4.1$ wget -O - $dp01 | tar -xzf - --2011-03-11 13:50:11-- http://dl.dropbox.com/u/6526608/Dummy-Prereq-0.01.tar.gz Resolving dl.dropbox.com... 184.72.223.78 Connecting to dl.dropbox.com|184.72.223.78|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 2685 (2.6K) [application/x-tar] Saving to: `STDOUT' 100%[======================================>] 2,685 --.-K/s in 0s 2011-03-11 13:50:12 (146 MB/s) - written to stdout [2685/2685] bash-4.1$ cd Dummy-Prereq-0.01 bash-4.1$ perl Build.PL Creating new 'MYMETA.yml' with configuration results Creating new 'Build' script for 'Dummy-Prereq' version '0.01' bash-4.1$ ./Build test && ./Build install t/00-load.t ....... 1/1 # Testing Dummy::Prereq 0.01, Perl 5.012003, /usr/bin/perl t/00-load.t ....... ok t/manifest.t ...... skipped: Author tests not required for installation t/pod-coverage.t .. skipped: Test::Pod::Coverage 1.08 required for testing POD coverage t/pod.t ........... skipped: Test::Pod 1.22 required for testing POD All tests successful. Files=4, Tests=1, 1 wallclock secs ( 0.03 usr 0.00 sys + 0.08 cusr 0.03 csys = 0.14 CPU) Result: PASS Building Dummy-Prereq Installing /home/bq_cdavis/perl5/lib/perl5/Dummy/Prereq.pm Installing /home/bq_cdavis/perl5/man/man3/Dummy::Prereq.3pm bash-4.1$ # Check that it's 0.01 bash-4.1$ perl -MDummy::Prereq -e 'print "$Dummy::Prereq::VERSION\n"' 0.01 bash-4.1$ cd .. bash-4.1$ <install Dummy::Module, which depends on v0.02 of Dummy::Prereq bash-4.1$ dm=http://dl.dropbox.com/u/6526608/Dummy-Module.tar.gz bash-4.1$ wget -O - $dm|tar -xzf - --2011-03-11 13:50:13-- http://dl.dropbox.com/u/6526608/Dummy-Module.tar.gz Resolving dl.dropbox.com... 184.72.223.78 Connecting to dl.dropbox.com|184.72.223.78|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 2875 (2.8K) [application/x-tar] Saving to: `STDOUT' 100%[======================================>] 2,875 --.-K/s in 0s 2011-03-11 13:50:14 (42.9 MB/s) - written to stdout [2875/2875] bash-4.1$ cd Dummy-Module/ bash-4.1$ perl Build.PL Checking prerequisites... requires: ! Dummy::Prereq (0.01) is installed, but we need version >= 0.02 ERRORS/WARNINGS FOUND IN PREREQUISITES. You may wish to install the versions of the modules indicated above before proceeding with this installation Run 'Build installdeps' to install missing prerequisites. Creating new 'MYMETA.yml' with configuration results Creating new 'Build' script for 'Dummy-Module' version '0.01' bash-4.1$ # MB correctly identifies that we need v0.02 and only have v0.01 bash-4.1$ < ./Build script contains our additions (here from local::lib) to $PERL5LIB bash-4.1$ # grep '@INC' -A 4 Build bash-4.1$ # unshift @INC, bash-4.1$ # ( bash-4.1$ # '/home/bq_cdavis/perl5/lib/perl5/i386-linux-thread-multi', bash-4.1$ # '/home/bq_cdavis/perl5/lib/perl5' bash-4.1$ # ); bash-4.1$ cd .. bash-4.1$ <ould go fetch (the latest) Dummy::Prereq and build and test it bash-4.1$ dp02=http://dl.dropbox.com/u/6526608/Dummy-Prereq-0.02.tar.gz bash-4.1$ wget -O - $dp02| tar -xzf - --2011-03-11 13:50:14-- http://dl.dropbox.com/u/6526608/Dummy-Prereq-0.02.tar.gz Resolving dl.dropbox.com... 184.72.223.78 Connecting to dl.dropbox.com|184.72.223.78|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 2692 (2.6K) [application/x-tar] Saving to: `STDOUT' 100%[======================================>] 2,692 --.-K/s in 0s 2011-03-11 13:50:15 (27.1 MB/s) - written to stdout [2692/2692] bash-4.1$ cd Dummy-Prereq-0.02 bash-4.1$ perl Build.PL Creating new 'MYMETA.yml' with configuration results Creating new 'Build' script for 'Dummy-Prereq' version '0.02' bash-4.1$ ./Build test t/00-load.t ....... 1/1 # Testing Dummy::Prereq 0.02, Perl 5.012003, /usr/bin/perl t/00-load.t ....... ok t/manifest.t ...... skipped: Author tests not required for installation t/pod-coverage.t .. skipped: Test::Pod::Coverage 1.08 required for testing POD coverage t/pod.t ........... skipped: Test::Pod 1.22 required for testing POD All tests successful. Files=4, Tests=1, 0 wallclock secs ( 0.03 usr 0.00 sys + 0.09 cusr 0.01 csys = 0.13 CPU) Result: PASS <does not install this (yet), because Dummy::Module has to be tested first < pass, CPAN.pm *prepends* $PWD/blib/lib and $PWD/blib/arch to $PERL5LIB : bash-4.1$ export PERL5LIB=$PWD/blib/lib:$PWD/blib/arch:$PERL5LIB bash-4.1$ # Check it bash-4.1$ echo $PERL5LIB /home/bq_cdavis/Dummy-Prereq-0.02/blib/lib:/home/bq_cdavis/Dummy-Prereq-0.02/blib/arch:/home/bq_cdavis/perl5/lib/perl5/i386-linux-thread-multi:/home/bq_cdavis/perl5/lib/perl5 bash-4.1$ # Which gives: <b/perl5/i386-linux-thread-multi:/home/bq_cdavis/perl5/lib/perl5 <s back (now that all deps have passed tests), to test Dummy::Module bash-4.1$ cd .. bash-4.1$ <se all the prereqs passed and they've been prepended to $PERL5LIB bash-4.1$ cd Dummy-Module bash-4.1$ ./Build test --verbose Copying lib/Dummy/Module.pm -> blib/lib/Dummy/Module.pm t/00-load.t ................ 1..1 ok 1 - use Dummy::Module; # Testing Dummy::Module 0.01, Perl 5.012003, /usr/bin/perl ok t/manifest.t ............... 1..0 # SKIP Author tests not required for installation skipped: Author tests not required for installation t/pod-coverage.t ........... 1..0 # SKIP Test::Pod::Coverage 1.08 required for testing POD coverage skipped: Test::Pod::Coverage 1.08 required for testing POD coverage t/pod.t .................... 1..0 # SKIP Test::Pod 1.22 required for testing POD skipped: Test::Pod 1.22 required for testing POD t/right-prereq-versions.t .. ok 1 - use Dummy::Prereq; not ok 2 - Right version of Prereq: 0.01 # Failed test 'Right version of Prereq: 0.01' # at t/right-prereq-versions.t line 12. # got: '0.01' # expected: '0.02' # # PERL5LIB: # /home/bq_cdavis/Dummy-Module/blib/lib # /home/bq_cdavis/Dummy-Module/blib/arch # /home/bq_cdavis/perl5/lib/perl5/i386-linux-thread-multi # /home/bq_cdavis/perl5/lib/perl5/i386-linux-thread-multi # /home/bq_cdavis/perl5/lib/perl5 # /home/bq_cdavis/Dummy-Prereq-0.02/blib/lib # /home/bq_cdavis/Dummy-Prereq-0.02/blib/arch # /usr/local/lib/perl5 # /usr/local/share/perl5 # /usr/lib/perl5 # /usr/share/perl5 # /usr/lib/perl5 # /usr/share/perl5 # /usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi # /usr/local/lib/perl5/site_perl/5.10.0 # /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi # /usr/lib/perl5/vendor_perl # /usr/lib/perl5/site_perl # 1..2 # Looks like you failed 1 test of 2. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/2 subtests Test Summary Report ------------------- t/right-prereq-versions.t (Wstat: 256 Tests: 2 Failed: 1) Failed test: 2 Non-zero exit status: 1 Files=5, Tests=3, 1 wallclock secs ( 0.03 usr 0.01 sys + 0.09 cusr 0.03 csys = 0.16 CPU) Result: FAIL Failed 1/5 test programs. 1/3 subtests failed. bash-4.1$ # Which dies, because Dummy::Prereq is still version 0.01 <prepends* the original $PERL5LIB to the $PERL5LIB set by CPAN.pm <f those directories, MB picks that up, and Dummy-Module fails bash-4.1$ bash-4.1$ logout Script done on Fri 11 Mar 2011 01:50:20 PM CET
Subject: MB-INC.patch
diff --git a/lib/Module/Build/Base.pm b/lib/Module/Build/Base.pm index 3ffca3b..384bec6 100644 --- a/lib/Module/Build/Base.pm +++ b/lib/Module/Build/Base.pm @@ -1847,7 +1847,7 @@ BEGIN { die ("Configuration seems to be out of date, please re-run 'perl Build.PL' again.\\n"); } } - unshift \@INC, + push \@INC, ( $quoted_INC );
From: chad.a.davis@gmail.com
I would also hide ~/.cpan and ~/perl5 , if you have them, before trying the attached script. (Updated output of my script session after fixing minor bugs in script).
Subject: module-build-script-session.txt
Script started, file is module-build-script-session.txt : bq_cdavis bq-pc-rr05 ~/tmp ; # Start a clean shell, with no environment, : bq_cdavis bq-pc-rr05 ~/tmp ; # (in any empty directory with write permission) : bq_cdavis bq-pc-rr05 ~/tmp ; exec -cl /bin/bash --noprofile bash-4.1$ bash-4.1$ # Simple pmtools bash-4.1$ function pmvers { perl -M$1 -e "print \"\$$1::VERSION\n\"" ; } bash-4.1$ pmvers Module::Build 0.3603 bash-4.1$ # 0.3603 <results with v0.38, but don't install it here, due to needing many prereqs bash-4.1$ bash-4.1$ # Bootstrap a new local::lib <cpan.org/CPAN/authors/id/A/AP/APEIRON/local-lib-1.008004.tar.gz bash-4.1$ wget -O - $ll | tar -xzf - --2011-03-11 14:52:31-- http://search.cpan.org/CPAN/authors/id/A/AP/APEIRON/local-lib-1.008004.tar.gz Resolving search.cpan.org... 194.106.223.155 Connecting to search.cpan.org|194.106.223.155|:80... connected. HTTP request sent, awaiting response... 302 Found Location: http://cpan.mirror.clusters.kg/authors/id/A/AP/APEIRON/local-lib-1.008004.tar.gz [following] --2011-03-11 14:52:31-- http://cpan.mirror.clusters.kg/authors/id/A/AP/APEIRON/local-lib-1.008004.tar.gz Resolving cpan.mirror.clusters.kg... 94.136.162.2 Connecting to cpan.mirror.clusters.kg|94.136.162.2|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 53977 (53K) [application/x-gzip] Saving to: `STDOUT' 100%[======================================>] 53,977 --.-K/s in 0.04s 2011-03-11 14:52:31 (1.26 MB/s) - written to stdout [53977/53977] bash-4.1$ cd local-lib-* bash-4.1$ perl Makefile.PL --bootstrap *** Module::AutoInstall version 1.03 *** Checking for Perl dependencies... [Core Features] - ExtUtils::MakeMaker ...loaded. (6.56 >= 6.31) - ExtUtils::Install ...loaded. (1.55 >= 1.43) - Module::Build ...loaded. (0.3603 >= 0.36) - CPAN ...loaded. (1.9456 >= 1.82) *** Module::AutoInstall configuration finished. Writing Makefile for local::lib bash-4.1$ make install Skip blib/lib/POD2/PT_BR/local/lib.pod (unchanged) Skip blib/lib/lib/core/only.pm (unchanged) Skip blib/lib/local/lib.pm (unchanged) Skip blib/lib/POD2/DE/local/lib.pod (unchanged) Manifying blib/man3/POD2::PT_BR::local::lib.3pm Manifying blib/man3/lib::core::only.3pm Manifying blib/man3/local::lib.3pm Manifying blib/man3/POD2::DE::local::lib.3pm Appending installation info to /home/bq_cdavis/perl5/lib/perl5/i386-linux-thread-multi/perllocal.pod bash-4.1$ eval $(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib) bash-4.1$ # Check it bash-4.1$ echo $PERL5LIB /home/bq_cdavis/perl5/lib/perl5/i386-linux-thread-multi:/home/bq_cdavis/perl5/lib/perl5 bash-4.1$ cd .. bash-4.1$ bash-4.1$ # Probably don't have Test::More yet, otherwise skip this block <earch.cpan.org/CPAN/authors/id/M/MS/MSCHWERN/Test-Simple-0.98.tar.gz bash-4.1$ wget -O - $testmore|tar -xzf - --2011-03-11 14:52:33-- http://search.cpan.org/CPAN/authors/id/M/MS/MSCHWERN/Test-Simple-0.98.tar.gz Resolving search.cpan.org... 194.106.223.155 Connecting to search.cpan.org|194.106.223.155|:80... connected. HTTP request sent, awaiting response... 302 Found Location: http://cpan.mirror.iphh.net/authors/id/M/MS/MSCHWERN/Test-Simple-0.98.tar.gz [following] --2011-03-11 14:52:33-- http://cpan.mirror.iphh.net/authors/id/M/MS/MSCHWERN/Test-Simple-0.98.tar.gz Resolving cpan.mirror.iphh.net... 62.201.161.82, 2001:868:0:182::2 Connecting to cpan.mirror.iphh.net|62.201.161.82|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 107255 (105K) [application/x-gzip] Saving to: `STDOUT' 100%[======================================>] 107,255 --.-K/s in 0.08s 2011-03-11 14:52:33 (1.32 MB/s) - written to stdout [107255/107255] bash-4.1$ cd Test-Simple-* bash-4.1$ perl Makefile.PL Writing Makefile for Test::Simple bash-4.1$ make install Skip blib/lib/Test/Builder/Tester/Color.pm (unchanged) Skip blib/lib/Test/Builder.pm (unchanged) Skip blib/lib/Test/Simple.pm (unchanged) Skip blib/lib/Test/Builder/IO/Scalar.pm (unchanged) Skip blib/lib/Test/More.pm (unchanged) Skip blib/lib/Test/Builder/Module.pm (unchanged) Skip blib/lib/Test/Builder/Tester.pm (unchanged) Skip blib/lib/Test/Tutorial.pod (unchanged) Manifying blib/man3/Test::Builder::Tester::Color.3pm Manifying blib/man3/Test::Simple.3pm Manifying blib/man3/Test::Builder.3pm Manifying blib/man3/Test::Builder::IO::Scalar.3pm Manifying blib/man3/Test::More.3pm Manifying blib/man3/Test::Builder::Tester.3pm Manifying blib/man3/Test::Builder::Module.3pm Manifying blib/man3/Test::Tutorial.3pm Appending installation info to /home/bq_cdavis/perl5/lib/perl5/i386-linux-thread-multi/perllocal.pod bash-4.1$ cd .. bash-4.1$ bash-4.1$ # First, Assume we have an old version of the prereq bash-4.1$ dp01=http://dl.dropbox.com/u/6526608/Dummy-Prereq-0.01.tar.gz bash-4.1$ wget -O - $dp01 | tar -xzf - --2011-03-11 14:52:35-- http://dl.dropbox.com/u/6526608/Dummy-Prereq-0.01.tar.gz Resolving dl.dropbox.com... 184.72.243.56 Connecting to dl.dropbox.com|184.72.243.56|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 2685 (2.6K) [application/x-tar] Saving to: `STDOUT' 100%[======================================>] 2,685 --.-K/s in 0s 2011-03-11 14:52:36 (239 MB/s) - written to stdout [2685/2685] bash-4.1$ cd Dummy-Prereq-0.01 bash-4.1$ perl Build.PL Creating new 'MYMETA.yml' with configuration results Creating new 'Build' script for 'Dummy-Prereq' version '0.01' bash-4.1$ ./Build test && ./Build install t/00-load.t ....... 1/1 # Testing Dummy::Prereq 0.01, Perl 5.012003, /usr/bin/perl t/00-load.t ....... ok t/manifest.t ...... skipped: Author tests not required for installation t/pod-coverage.t .. skipped: Test::Pod::Coverage 1.08 required for testing POD coverage t/pod.t ........... skipped: Test::Pod 1.22 required for testing POD All tests successful. Files=4, Tests=1, 0 wallclock secs ( 0.02 usr 0.01 sys + 0.07 cusr 0.01 csys = 0.11 CPU) Result: PASS Building Dummy-Prereq bash-4.1$ # Check that it's 0.01 bash-4.1$ perl -MDummy::Prereq -e 'print "$Dummy::Prereq::VERSION\n"' 0.01 bash-4.1$ cd .. bash-4.1$ <install Dummy::Module, which depends on v0.02 of Dummy::Prereq bash-4.1$ dm=http://dl.dropbox.com/u/6526608/Dummy-Module.tar.gz bash-4.1$ wget -O - $dm|tar -xzf - --2011-03-11 14:52:36-- http://dl.dropbox.com/u/6526608/Dummy-Module.tar.gz Resolving dl.dropbox.com... 184.72.243.56 Connecting to dl.dropbox.com|184.72.243.56|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 2875 (2.8K) [application/x-tar] Saving to: `STDOUT' 100%[======================================>] 2,875 --.-K/s in 0s 2011-03-11 14:52:37 (30.8 MB/s) - written to stdout [2875/2875] bash-4.1$ cd Dummy-Module/ bash-4.1$ perl Build.PL Checking prerequisites... requires: ! Dummy::Prereq (0.01) is installed, but we need version >= 0.02 ERRORS/WARNINGS FOUND IN PREREQUISITES. You may wish to install the versions of the modules indicated above before proceeding with this installation Run 'Build installdeps' to install missing prerequisites. Creating new 'MYMETA.yml' with configuration results Creating new 'Build' script for 'Dummy-Module' version '0.01' bash-4.1$ # MB correctly identifies that we need v0.02 and only have v0.01 bash-4.1$ < ./Build script contains our additions (here from local::lib) to $PERL5LIB bash-4.1$ # grep '@INC' -A 4 Build bash-4.1$ # unshift @INC, bash-4.1$ # ( bash-4.1$ # '/home/bq_cdavis/perl5/lib/perl5/i386-linux-thread-multi', bash-4.1$ # '/home/bq_cdavis/perl5/lib/perl5' bash-4.1$ # ); bash-4.1$ cd .. bash-4.1$ <ould go fetch (the latest) Dummy::Prereq and build and test it bash-4.1$ dp02=http://dl.dropbox.com/u/6526608/Dummy-Prereq-0.02.tar.gz bash-4.1$ wget -O - $dp02| tar -xzf - --2011-03-11 14:52:37-- http://dl.dropbox.com/u/6526608/Dummy-Prereq-0.02.tar.gz Resolving dl.dropbox.com... 184.72.243.56 Connecting to dl.dropbox.com|184.72.243.56|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 2692 (2.6K) [application/x-tar] Saving to: `STDOUT' 100%[======================================>] 2,692 --.-K/s in 0s 2011-03-11 14:52:38 (200 MB/s) - written to stdout [2692/2692] bash-4.1$ cd Dummy-Prereq-0.02 bash-4.1$ perl Build.PL Creating new 'MYMETA.yml' with configuration results Creating new 'Build' script for 'Dummy-Prereq' version '0.02' bash-4.1$ ./Build test t/00-load.t ....... 1/1 # Testing Dummy::Prereq 0.02, Perl 5.012003, /usr/bin/perl t/00-load.t ....... ok t/manifest.t ...... skipped: Author tests not required for installation t/pod-coverage.t .. skipped: Test::Pod::Coverage 1.08 required for testing POD coverage t/pod.t ........... skipped: Test::Pod 1.22 required for testing POD All tests successful. Files=4, Tests=1, 1 wallclock secs ( 0.03 usr 0.01 sys + 0.06 cusr 0.02 csys = 0.12 CPU) Result: PASS <does not install this (yet), because Dummy::Module has to be tested first < pass, CPAN.pm *prepends* $PWD/blib/lib and $PWD/blib/arch to $PERL5LIB : bash-4.1$ export PERL5LIB=$PWD/blib/lib:$PWD/blib/arch:$PERL5LIB bash-4.1$ # Check it bash-4.1$ echo $PERL5LIB /net/netfile2/ag-russell/bq_cdavis/tmp/Dummy-Prereq-0.02/blib/lib:/net/netfile2/ag-russell/bq_cdavis/tmp/Dummy-Prereq-0.02/blib/arch:/home/bq_cdavis/perl5/lib/perl5/i386-linux-thread-multi:/home/bq_cdavis/perl5/lib/perl5 bash-4.1$ # Which gives: <b/perl5/i386-linux-thread-multi:/home/bq_cdavis/perl5/lib/perl5 <s back (now that all deps have passed tests), to test Dummy::Module bash-4.1$ cd .. bash-4.1$ <se all the prereqs passed and they've been prepended to $PERL5LIB bash-4.1$ cd Dummy-Module bash-4.1$ ./Build test --verbose Copying lib/Dummy/Module.pm -> blib/lib/Dummy/Module.pm t/00-load.t ................ 1..1 ok 1 - use Dummy::Module; # Testing Dummy::Module 0.01, Perl 5.012003, /usr/bin/perl ok t/manifest.t ............... 1..0 # SKIP Author tests not required for installation skipped: Author tests not required for installation t/pod-coverage.t ........... 1..0 # SKIP Test::Pod::Coverage 1.08 required for testing POD coverage skipped: Test::Pod::Coverage 1.08 required for testing POD coverage t/pod.t .................... 1..0 # SKIP Test::Pod 1.22 required for testing POD skipped: Test::Pod 1.22 required for testing POD t/right-prereq-versions.t .. ok 1 - use Dummy::Prereq; not ok 2 - Right version of Prereq: 0.01 # Failed test 'Right version of Prereq: 0.01' # at t/right-prereq-versions.t line 12. # got: '0.01' # expected: '0.02' # # PERL5LIB: # /net/netfile2/ag-russell/bq_cdavis/tmp/Dummy-Module/blib/lib # /net/netfile2/ag-russell/bq_cdavis/tmp/Dummy-Module/blib/arch # /home/bq_cdavis/perl5/lib/perl5/i386-linux-thread-multi # /home/bq_cdavis/perl5/lib/perl5/i386-linux-thread-multi # /home/bq_cdavis/perl5/lib/perl5 # /net/netfile2/ag-russell/bq_cdavis/tmp/Dummy-Prereq-0.02/blib/lib # /net/netfile2/ag-russell/bq_cdavis/tmp/Dummy-Prereq-0.02/blib/arch # /usr/local/lib/perl5 # /usr/local/share/perl5 # /usr/lib/perl5 # /usr/share/perl5 # /usr/lib/perl5 # /usr/share/perl5 # /usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi # /usr/local/lib/perl5/site_perl/5.10.0 # /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi # /usr/lib/perl5/vendor_perl # /usr/lib/perl5/site_perl # 1..2 # Looks like you failed 1 test of 2. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/2 subtests Test Summary Report ------------------- t/right-prereq-versions.t (Wstat: 256 Tests: 2 Failed: 1) Failed test: 2 Non-zero exit status: 1 Files=5, Tests=3, 0 wallclock secs ( 0.02 usr 0.01 sys + 0.08 cusr 0.03 csys = 0.14 CPU) Result: FAIL Failed 1/5 test programs. 1/3 subtests failed. bash-4.1$ # Which dies, because Dummy::Prereq is still version 0.01 <prepends* the original $PERL5LIB to the $PERL5LIB set by CPAN.pm <f those directories, MB picks that up, and Dummy-Module fails bash-4.1$ bash-4.1$ logout Script done, file is module-build-script-session.txt
This sounds suspiciously similar to the following bug in local::lib: https://rt.cpan.org/Ticket/Display.html?id=66534 Can you replicate this without using local::lib, but with a PERL5LIB set manually?
From: chad.a.davis@gmail.com
Show quoted text
> Can you replicate this without using local::lib, but with a PERL5LIB
set
Show quoted text
> manually? >
Yes. The symptoms are the same as with that local::lib issue, but I believe that the issue here is within M::B itself, as it saves components from $PERL5LIB and then unshifts them back onto $PERL5LIB from the ./Build script. These path components precede the components that CPAN prepends (./blib/lib and ./blib/auto) so that the outdated deps are found before the just-built updated deps. I simplified the demo script for this case. You should be able to run this if you simply start with a clean environment: exec -cl /bin/bash --noprofile and then wget -q http://dl.dropbox.com/u/6526608/module-build-manual.sh and finally sh module-build-manual.sh Comments in the script explain what's happening. Essentially, it gets an outdated prereq installed (to a custom lib path), then tries to install a module that requires a newer prereq. You need to have Module::Build and Test::More already installed (e.g. via your package manager). Tested on Fedora 14 + perl 5.12.3 + M::B 0.3603 CentOS 5.6 + perl 5.8.8 + M::B 0.2807 Ubuntu 11.04 + perl 5.10.1 + M::B 0.340201 Ubuntu 11.04 + perl 5.10.1 + M::B 0.38 The last two are AWS AMIs, to be sure that there were no custom quirks. In the latter case, I installed the latest M::B with the system cpan. None of the cases used local::lib.


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.