CPAN install Module::Install fails passing tests (strawberryperl)

1.8k views Asked by At

I'm completely new to Perl, so maybe there is something obvious I'm not seeing.

I'm using perl to compile PostgreSQL database (C++) and I need to call an "install" command (here there are PostgreSQL installation instructions, and source files with code used), this is the output:

Can't locate Install.pm in @INC (you may need to install the Install module) 
(@INC contains: shows/me/several/directories/
BEGIN failed--compilation aborted at install.pl line 9.

Searching internet about this error, I found that I have to install Module::Install and here comes the error:

$ cpan Module::Install
Loading internal null logger. Install Log::Log4perl for logging messages
CPAN: CPAN::SQLite loaded ok (v0.211)
Database was generated on Mon, 11 Sep 2017 15:32:15 GMT

Running install for module 'Module::Install'
CPAN: Digest::SHA loaded ok (v5.96)
CPAN: Compress::Zlib loaded ok (v2.074)
Checksum for C:\Users\e047439\.conan\data\strawberryperl\5.26.0\conan\stable\package\ca33edce272a279b24f87dc0d4cf5bbdcffbc187\cpan\sources\authors\id\E\ET\ETHER\Module-Install-1.18.tar.gz ok
CPAN: Archive::Tar loaded ok (v2.26)
CPAN: YAML::XS loaded ok (v0.65)
CPAN: CPAN::Meta::Requirements loaded ok (v2.140)
CPAN: Parse::CPAN::Meta loaded ok (v2.150010)
CPAN: CPAN::Meta loaded ok (v2.150010)
CPAN: Module::CoreList loaded ok (v5.20170530)
Configuring E/ET/ETHER/Module-Install-1.18.tar.gz with Makefile.PL
include C:/Users/e047439/.conan/data/strawberryperl/5.26.0/conan/stable/package/ca33edce272a279b24f87dc0d4cf5bbdcffbc187/cpan/build/Module-Install-1.18-4/inc/Module/Install.pm
include inc/Module/Install/Metadata.pm
include inc/Module/Install/Base.pm
include inc/Module/Install/Makefile.pm
include inc/Module/Install/With.pm
include inc/Module/Install/WriteAll.pm
include inc/Module/Install/Win32.pm
include inc/Module/Install/Can.pm
include inc/Module/Install/Fetch.pm
Checking if your kit is complete...
Looks good
Generating a gmake-style Makefile
Writing Makefile for Module::Install
Writing MYMETA.yml and MYMETA.json
Writing META.yml
  ETHER/Module-Install-1.18.tar.gz
  C:\Users\e047439\.conan\data\strawberryperl\5.26.0\conan\stable\package\ca33edce272a279b24f87dc0d4cf5bbdcffbc187\perl\bin\perl.exe Makefile.PL -- OK
Running make for E/ET/ETHER/Module-Install-1.18.tar.gz
cp lib/Module/Install/Admin/Makefile.pm blib\lib\Module\Install\Admin\Makefile.pm
cp lib/Module/Install/Admin/Compiler.pm blib\lib\Module\Install\Admin\Compiler.pm
cp lib/Module/Install/Admin/Manifest.pm blib\lib\Module\Install\Admin\Manifest.pm
cp lib/Module/Install/Admin/Metadata.pm blib\lib\Module\Install\Admin\Metadata.pm
cp lib/Module/Install/Admin.pm blib\lib\Module\Install\Admin.pm
cp lib/Module/Install/Admin/Include.pm blib\lib\Module\Install\Admin\Include.pm
cp lib/Module/Install/Bundle.pm blib\lib\Module\Install\Bundle.pm
cp lib/Module/Install/Can.pm blib\lib\Module\Install\Can.pm
cp lib/Module/Install/Admin/WriteAll.pm blib\lib\Module\Install\Admin\WriteAll.pm
cp lib/Module/Install/Base.pm blib\lib\Module\Install\Base.pm
cp lib/Module/Install/Admin/Find.pm blib\lib\Module\Install\Admin\Find.pm
cp lib/Module/Install/Admin/ScanDeps.pm blib\lib\Module\Install\Admin\ScanDeps.pm
cp lib/Module/Install.pod blib\lib\Module\Install.pod
cp lib/Module/Install.pm blib\lib\Module\Install.pm
cp lib/Module/Install/Admin/Bundle.pm blib\lib\Module\Install\Admin\Bundle.pm
cp lib/Module/Install/AutoInstall.pm blib\lib\Module\Install\AutoInstall.pm
cp lib/Module/Install/API.pod blib\lib\Module\Install\API.pod
cp lib/Module/AutoInstall.pm blib\lib\Module\AutoInstall.pm
cp lib/Module/Install/With.pm blib\lib\Module\Install\With.pm
cp lib/Module/Install/Run.pm blib\lib\Module\Install\Run.pm
cp lib/Module/Install/Deprecated.pm blib\lib\Module\Install\Deprecated.pm
cp lib/Module/Install/PAR.pm blib\lib\Module\Install\PAR.pm
cp lib/Module/Install/Scripts.pm blib\lib\Module\Install\Scripts.pm
cp lib/Module/Install/Win32.pm blib\lib\Module\Install\Win32.pm
cp lib/Module/Install/Fetch.pm blib\lib\Module\Install\Fetch.pm
cp lib/Module/Install/Include.pm blib\lib\Module\Install\Include.pm
cp lib/Module/Install/MakeMaker.pm blib\lib\Module\Install\MakeMaker.pm
cp lib/Module/Install/Makefile.pm blib\lib\Module\Install\Makefile.pm
cp lib/Module/Install/Philosophy.pod blib\lib\Module\Install\Philosophy.pod
cp lib/Module/Install/Share.pm blib\lib\Module\Install\Share.pm
cp lib/Module/Install/Compiler.pm blib\lib\Module\Install\Compiler.pm
cp lib/Module/Install/WriteAll.pm blib\lib\Module\Install\WriteAll.pm
cp lib/Module/Install/Metadata.pm blib\lib\Module\Install\Metadata.pm
cp lib/Module/Install/Inline.pm blib\lib\Module\Install\Inline.pm
cp lib/Module/Install/External.pm blib\lib\Module\Install\External.pm
cp lib/Module/Install/FAQ.pod blib\lib\Module\Install\FAQ.pod
cp lib/Module/Install/DSL.pm blib\lib\Module\Install\DSL.pm
cp lib/inc/Module/Install.pm blib\lib\inc\Module\Install.pm
cp lib/inc/Module/Install/DSL.pm blib\lib\inc\Module\Install\DSL.pm
  ETHER/Module-Install-1.18.tar.gz
  C:\Users\e047439\.conan\data\strawberryperl\5.26.0\conan\stable\package\ca33edce272a279b24f87dc0d4cf5bbdcffbc187\c\bin\gmake.exe -- OK
Running make test
"C:\Users\e047439\.conan\data\strawberryperl\5.26.0\conan\stable\package\ca33edce272a279b24f87dc0d4cf5bbdcffbc187\perl\bin\perl.exe" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'inc', 'blib\lib', 'blib\arch')" t/*.t t/recursive/*.t
t/01_compile.t .......................... ok
t/02_mymeta.t ........................... skipped: New EU::MM has own MYMETA support
t/03_autoinstall.t ...................... skipped: Skipping dangerous test
t/04_version.t .......................... ok
t/05_share.t ............................ 3/22
#   Failed test 'make'
#   at t/05_share.t line 37.

#   Failed test 'Found install_share in correct dist_dir location'
#   at t/05_share.t line 40.

#   Failed test 'Found expected file in dist_dir location'
#   at t/05_share.t line 43.
open(t\Foo39760\blib\lib\auto\share\dist\Foo\dist_file.txt): No such file or directory at (eval 27) line 3.
# Looks like your test exited with 2 just after 6.
t/05_share.t ............................ Dubious, test returned 2 (wstat 512, 0x200)
Failed 19/22 subtests
t/06_ppport.t ........................... ok
t/07_perl_version.t ..................... ok
t/08_dsl.t .............................. ok
t/09_read.t ............................. ok
t/10_test.t ............................. ok
t/11_extraction.t ....................... ok
t/12_eumm_params.t ...................... ok
t/13_author_tests.t ..................... ok
t/13_author_tests_ext.t ................. skipped: requires Module::Install::AuthorTests
t/13_author_tests_ext2.t ................ skipped: requires Module::Install::ExtraTests 0.007
t/14_auto_include_deps_with_version.t ... skipped: your perl is new enough to have File::Spec 3.30 in core
t/15_wrong_usage.t ...................... ok
t/16_require.t .......................... ok
t/17_sign.t ............................. ok
t/18_all_from.t ......................... ok
t/19_authors.t .......................... ok
t/20_authors_with_special_characters.t .. ok
t/21_makemaker_args.t ................... ok
t/22_installdirs.t ...................... 12/24 old INSTALLDIRS (probably set by makemaker_args) is overriden by installdirs
t/22_installdirs.t ...................... ok
t/23_pl_files.t ......................... ok
t/24_multiple_license_blocks.t .......... ok
t/25_perl_version_from.t ................ ok
t/26_unknown_func.t ..................... ok
t/27_build_requires_and_include.t ....... 1/14 Warning: prerequisite Test::More 9999 not found. We have 1.302085.
t/27_build_requires_and_include.t ....... ok
t/28_makemaker_args.t ................... ok
t/29_requires_from.t .................... ok
t/30_build_subdirs.t .................... ok
t/31_add_metadata.t ..................... ok
t/32_module_name.t ...................... ok
t/33_copy.t ............................. ok
t/34_readwrite.t ........................ ok
t/recursive/test.t ...................... ok

Test Summary Report
-------------------
t/05_share.t                          (Wstat: 512 Tests: 6 Failed: 3)
  Failed tests:  4-6
  Non-zero exit status: 2
  Parse errors: Bad plan.  You planned 22 tests but ran 6.
Files=37, Tests=541, 76 wallclock secs ( 0.25 usr +  0.25 sys =  0.50 CPU)
Result: FAIL
Failed 1/37 test programs. 3/541 subtests failed.
gmake: *** [Makefile:823: test_dynamic] Error 255
  ETHER/Module-Install-1.18.tar.gz
  C:\Users\e047439\.conan\data\strawberryperl\5.26.0\conan\stable\package\ca33edce272a279b24f87dc0d4cf5bbdcffbc187\c\bin\gmake.exe test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports ETHER/Module-Install-1.18.tar.gz
Stopping: 'install' failed for 'Module::Install'.

Some tests are failing and I don't know neither how to bypass it nor to solve it.

Thanks in advance.

1

There are 1 answers

3
ikegami On

Many scripts assume the script's directory is in @INC. That usually worked because the scripts's directory often happened to be the same as the CWD, and the CWD (.) was in @INC. But it wasn't always the case, and it's virtually never the case now that . is no longer in @INC.

In src/tools/msvc/install.pl,

Before the following:

use Install qw(Install);

Add the following:

use FindBin qw( $RealBin );
use lib $RealBin;