wfsp has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to install File::BOM into a local lib on a shared webhosters server. From Windows I can SSH in and start the cpan shell. Installing simple modules (pure perl, no dependancies) is working fine so I assume I have cpan's MyConfig.pm set up properly. I've included it the end of the post. Output from cpan>install File::BOM:
cpan> install File::BOM CPAN: Storable loaded ok Going to read /my_home_dir/.cpan/Metadata Database was generated on Mon, 27 Jul 2009 10:27:01 GMT Running install for module File::BOM Running make for M/MA/MATTLAW/File-BOM-0.14.tar.gz CPAN: Digest::MD5 loaded ok CPAN: Compress::Zlib loaded ok Checksum for /my_home_dir/.cpan/sources/authors/id/M/MA/MATTLAW/File-B +OM-0.14.tar.gz ok Scanning cache /my_home_dir/.cpan/build for sizes File-BOM-0.14/ File-BOM-0.14/t/ File-BOM-0.14/t/data/ File-BOM-0.14/t/data/broken_bom.txt File-BOM-0.14/t/99..shutdown.t File-BOM-0.14/t/03..exceptions.t File-BOM-0.14/t/04..pod.t File-BOM-0.14/t/lib/ File-BOM-0.14/t/lib/Test/ File-BOM-0.14/t/lib/Test/Framework.pm File-BOM-0.14/t/02..perlio-via.t File-BOM-0.14/t/00..setup.t File-BOM-0.14/t/01..bom.t File-BOM-0.14/lib/ File-BOM-0.14/lib/File/ File-BOM-0.14/lib/File/BOM.pm File-BOM-0.14/Changes File-BOM-0.14/MANIFEST File-BOM-0.14/TODO File-BOM-0.14/README-cygwin File-BOM-0.14/META.yml File-BOM-0.14/README File-BOM-0.14/Makefile.PL File-BOM-0.14/Build.PL CPAN.pm: Going to build M/MA/MATTLAW/File-BOM-0.14.tar.gz This module requires Module::Build to install itself. Install Module::Build now from CPAN? [y]
Selecting yes outputs (extracts):
Copying lib/Module/Build/Platform/EBCDIC.pm -> blib/lib/Module/Build/P +latform/EBCDIC.pm (more of the same) Writing config notes to blib/lib/Module/Build/ConfigData.pm Manifying blib/script/config_data -> blib/bindoc/config_data.1p (more of the same) /usr/bin/make -- OK Running make test /usr/bin/perl Build --makefile_env_macros 1 test t/PL_files..................ok 1/8Use of uninitialized value in additi +on (+) at /usr/share/perl5/File/Path.pm line 655. (many more of the same) File::Path::_rmtree('HASH(0x8801360)', 'ARRAY(0x8816734)') cal +led at /usr/share/perl5/File/Path.pm line 548 File::Path::rmtree('_build', 0, 0) called at /homepages/1/d179 +923192/htdocs/.cpan/build/Module-Build-0.34/blib/lib/Module/Build/Bas +e.pm line 4236 Module::Build::Base::delete_filetree('Module::Build', '_build' +) called at /homepages/1/d179923192/htdocs/.cpan/build/Module-Build-0 +.34/blib/lib/Module/Build/Base.pm line 984 Module::Build::Base::subclass('Module::Build', 'class', 'Bar:: +Builder') called at t/compat.t line 152 main::__ANON__() called at t/lib/MBTest.pm line 140 eval {...} called at t/lib/MBTest.pm line 140 MBTest::save_handle('GLOB(0x814f2a4)', 'CODE(0x8816920)') call +ed at t/lib/MBTest.pm line 148 MBTest::stdout_of('CODE(0x8816920)') called at t/compat.t line + 153 t/compat....................ok 139/0Use of uninitialized value in addi +tion (+) at /usr/share/perl5/File/Path.pm line 655. Use of uninitialized value in addition (+) at /usr/share/perl5/File/Pa +th.pm line 655. t/runthrough................NOK 20/32# Failed test in t/runthrough.t + at line 159. # got: 'Can't locate Archive/Tar.pm in @INC (@INC contains: t +/lib /homepages/1/d179923192/htdocs/.cpan/build/Module-Build-0.34/bli +b/lib /homepages/1/d179923192/htdocs/.cpan/build/Module-Build-0.34/bl +ib/arch t/bundled lib /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/ +share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /u +sr/share/perl/5.8 /usr/local/lib/site_perl . t/bundled) at /homepages +/1/d179923192/htdocs/.cpan/build/Module-Build-0.34/blib/lib/Module/Bu +ild/Base.pm line 3969. # ' # expected: '' Use of uninitialized value in addition (+) at /usr/share/perl5/File/Pa +th.pm line 655. Use of uninitialized value in addition (+) at /usr/share/perl5/File/Pa +th.pm line 655. Use of uninitialized value in addition (+) at /usr/share/perl5/File/Pa +th.pm line 655. # Looks like you failed 1 test of 32. t/runthrough................dubious Test returned status 1 (wstat 256, 0x100) DIED. FAILED test 20 Failed 1/32 tests, 96.88% okay (less 4 skipped tests: 27 okay, + 84.38%) t/script_dist...............ok 7/0Use of uninitialized value in additi +on (+) at /usr/share/perl5/File/Path.pm line 655. t/script_dist...............ok t/signature.................skipped all skipped: $ENV{TEST_SIGNATURE} is not set t/test_file_exts............ok t/test_type.................ok t/test_types................ok t/tilde.....................ok t/use_tap_harness...........skipped all skipped: TAP::Harness 3+ not installed t/versions..................ok t/write_default_maniskip....ok 1/0Use of uninitialized value in additi +on (+) at /usr/share/perl5/File/Path.pm line 655. t/write_default_maniskip....ok t/xs........................skipped all skipped: C_support not enabled Failed Test Stat Wstat Total Fail List of Failed ---------------------------------------------------------------------- +--------- t/runthrough.t 1 256 32 1 20 5 tests and 12 subtests skipped. Failed 1/32 test scripts. 1/1033 subtests failed. Files=32, Tests=1033, 28 wallclock secs (20.51 cusr + 4.99 csys = 25. +50 CPU) Failed 1/32 test programs. 1/1033 subtests failed. make: *** [test] Error 255 /usr/bin/make test -- NOT OK Running make install make test had returned bad status, won't install without force Couldn't install Module::Build, giving up. Running make test Make had some problems, maybe interrupted? Won't test Running make install Make had some problems, maybe interrupted? Won't install cpan>
Suspecting a version issue with File::Path I had previously installed it in the local lib (after restarting cpan a few times). But the tests are not finding the latest version.
Use of uninitialized value in addition (+) at /usr/share/perl5/File/Pa +th.pm line 655.
(uiserver):uxxxxxx:~ > perl -MCPAN -e 'use lib q{/kunden/homepages/1/d +179923192/htdocs/lib};CPAN::Shell->m(shift)' File::Path CPAN: Storable loaded ok Going to read /my_home_dir/.cpan/Metadata Database was generated on Mon, 27 Jul 2009 10:27:01 GMT Module id = File::Path DESCRIPTION File path and name utilities CPAN_USERID P5P (The Perl5 Porters Mailing List <perl5-porters@pe +rl.org>) CPAN_VERSION 2.07 CPAN_FILE D/DL/DLAND/File-Path-2.07.tar.gz DSLI_STATUS Supf (standard,comp.lang.perl.*,perl,functions) MANPAGE File::Path - Create or remove directory trees INST_FILE /my_home_dir/lib/File/Path.pm INST_VERSION 2.07 (uiserver):uxxxxxx:~ >
Shouldn't the cpan shell find the File::Path in lib? If it could it may fix some of the other errors.

Also

Can't locate Archive/Tar.pm in @INC (@INC contains: t/lib /xxxxxx/.cp +an/build/Module-Build-0.34/blib/lib /xxxxxx/.cpan/build/Module-Build- +0.34/blib/arch t/bundled lib /etc/perl /usr/local/lib/perl/5.8.8 /usr +/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl +/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl . t/bundled)
The xxxxxx _isn't_ my home dir (a truncated version of it, the leading dir is missing) which is why it can't find it (or, presumably, the local File::Path).

Is there anything I need to do to get cpan shell to use a correct @INC? Here's my MyConfig.pm

$CPAN::Config = { 'cpan_home' => q[/my_home_dir/.cpan], 'build_dir' => q[/my_home_dir/.cpan/build], 'keep_source_where' => q[/my_home_dir/.cpan/sources], 'histfile' => q[/my_home_dir/.cpan/histfile], 'makepl_arg' => q[PREFIX=/my_home_dir/lib LIB=/my_home_dir/l +ib], 'build_cache' => q[10], 'cache_metadata' => q[1], 'cpan_version_check' => q[1], 'dontload_hash' => { }, 'ftp' => q[/usr/bin/ftp], 'ftp_proxy' => q[], 'getcwd' => q[cwd], 'gpg' => q[/usr/bin/gpg], 'gzip' => q[/bin/gzip], 'histsize' => q[100], 'http_proxy' => q[], 'inactivity_timeout' => q[0], 'index_expire' => q[1], 'inhibit_startup_message' => q[0], 'lynx' => q[/usr/bin/lynx], 'make' => q[/usr/bin/make], 'make_arg' => q[], 'make_install_arg' => q[], 'ncftpget' => q[/usr/bin/ncftpget], 'no_proxy' => q[], 'pager' => q[less], 'prerequisites_policy' => q[follow], 'scan_cache' => q[atstart], 'shell' => q[/bin/bash], 'tar' => q[/bin/tar], 'term_is_latin' => q[1], 'unzip' => q[/usr/bin/unzip], 'wget' => q[/usr/bin/wget], 'urllist' => [ q[ftp://mirror.ox.ac.uk/sites/www.cpan.org/], q[ftp://mirrors.uk2.net/pub/CPAN/], q[ftp://ftp.demon.co.uk/pub/CPAN/], q[ftp://mirror.sov.uk.goscomb.net/pub/CPAN/], q[ftp://cpan.etal.org/pub/CPAN/], q[ftp://demon.co.uk/pub/CPAN/], q[ftp://ftp.mirror.8086.net/sites/CPAN/] ], }; 1; __END__

Replies are listed 'Best First'.
Re: Installing Module::Build into a local lib using the cpan shell
by ikegami (Patriarch) on Jul 29, 2009 at 14:30 UTC
    You normally tell Perl where to find locally installed modules by setting env var PERL5LIB. It's no exception here. However, this will fail if the (.t) test file uses taint mode (-T).
      Thanks, that got me a lot further along the road. :-)

      To impose a bit more, I'd appreciate it if you could run your eye over the make test output I'm getting now.

      Again, thanks.

        Can't load '/tmp/MB-ttEfFd43/Simple/blib/arch/auto/Simple/Simple.so' for module Simple: /tmp/MB-ttEfFd43/Simple/blib/arch/auto/Simple/Simple.so: failed to map segment from shared object: Operation not permitted at /usr/lib/perl/5.8/DynaLoader.pm line 225.
        at -e line 0

        Sorry, no expertise there.