Subject: | Hidden test dependency on File::Slurp |
This ones a strange bug.
Its more a side effect of vendor mistakes than anything, but its hard trying to explain a solution.
1. Test::Name::FromLine is bundled in @INC
2. Therefor, it would appear that the "Build requires" of Test::Name::FromLine was the mistake
3. And so, a vendor dependency on Test::Name::FromLine gets omitted.
4. Which means Test::Name::FromLine doesn't get installed from CPAN, which means File::Slurp doesn't get installed.
5. This leads to the failure listed below.
And this is extra confusing, because it means for vendors, the dependency ... isn't used. But the dependency is never the less needed for a transient dependency to work.
To reduce confusion, it would be better to either ship Test::Name::FromLine in @INC, or add it as a dependency ... but not both.
However, presently:
- If you ship Test::Name::FromLine in @INC, you must depend on File::Slurp
$ perldoc -l File::Slurp
/home/kent/perl5/perlbrew/perls/5.22.1-nossp-sdbm-nopmc/lib/site_perl/5.22.1/File/Slurp.pm
$ mv -f $(perldoc -l File::Slurp){,hidden}
$ make test
PERL_DL_NONLAZY=1 "/home/kent/perl5/perlbrew/perls/5.22.1-nossp-sdbm-nopmc/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'inc', 'blib/lib', 'blib/arch')" t/*.t
t/00_compile.t .. Possible precedence issue with control flow operator at /home/kent/.cpanm/work/1462333850.19715/Test-Time-0.04/inc/Test/Builder.pm line 917.
t/00_compile.t .. ok
t/01_base.t ..... Possible precedence issue with control flow operator at /home/kent/.cpanm/work/1462333850.19715/Test-Time-0.04/inc/Test/Builder.pm line 917.
Can't locate File/Slurp.pm in @INC (you may need to install the File::Slurp module) (@INC contains: /home/kent/.cpanm/work/1462333850.19715/Test-Time-0.04/inc /home/kent/.cpanm/work/1462333850.19715/Test-Time-0.04/blib/lib /home/kent/.cpanm/work/1462333850.19715/Test-Time-0.04/blib/arch /home/kent/perl5/perlbrew/perls/5.22.1-nossp-sdbm-nopmc/lib/site_perl/5.22.1/x86_64-linux /home/kent/perl5/perlbrew/perls/5.22.1-nossp-sdbm-nopmc/lib/site_perl/5.22.1 /home/kent/perl5/perlbrew/perls/5.22.1-nossp-sdbm-nopmc/lib/5.22.1/x86_64-linux /home/kent/perl5/perlbrew/perls/5.22.1-nossp-sdbm-nopmc/lib/5.22.1 .) at /home/kent/.cpanm/work/1462333850.19715/Test-Time-0.04/inc/Test/Name/FromLine.pm line 9.
BEGIN failed--compilation aborted at /home/kent/.cpanm/work/1462333850.19715/Test-Time-0.04/inc/Test/Name/FromLine.pm line 9.
Compilation failed in require at t/01_base.t line 4.
BEGIN failed--compilation aborted at t/01_base.t line 4.
t/01_base.t ..... Dubious, test returned 2 (wstat 512, 0x200)
No subtests run
Test Summary Report
-------------------
t/01_base.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: No plan found in TAP output
Files=2, Tests=1, 1 wallclock secs ( 0.04 usr 0.00 sys + 0.04 cusr 0.01 csys = 0.09 CPU)
Result: FAIL
Failed 1/2 test programs. 0/1 subtests failed.
Makefile:776: recipe for target 'test_dynamic' failed
make: *** [test_dynamic] Error 2
grep File::Slurp -r .
./inc/Test/Name/FromLine.pm:use File::Slurp;
grep Test::Name::FromLine -r .
./Makefile.PL:build_requires 'Test::Name::FromLine';
./MYMETA.json: "Test::Name::FromLine" : "0"
./t/01_base.t:use Test::Name::FromLine;
./inc/Test/Name/FromLine.pm:package Test::Name::FromLine;
./Makefile:# BUILD_REQUIRES => { ExtUtils::MakeMaker=>q[6.36], Test::More=>q[0], Test::Name::FromLine=>q[0] }
./Makefile:# PREREQ_PM => { ExtUtils::MakeMaker=>q[6.36], Filter::Util::Call=>q[0], Test::More=>q[0], Test::Name::FromLine=>q[0] }
./MYMETA.yml: Test::Name::FromLine: '0'