Skip Menu |

This queue is for tickets about the Net-Amazon CPAN distribution.

Report information
The Basics
Id: 121476
Status: new
Priority: 0/
Queue: Net-Amazon

Owner: Nobody in particular
Requestors: KENTNL [...]

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

Subject: Tests fail when no '.' in @INC (Can't locate t/ )
Note: templated response follows

Perl 5.25.11 removes '.' from the default @INC, and this breaks `require "$TESTDIR/";` due to not being able to assume ./$TESTDIR/ is in the @INC load path.

This is not a complete end-of-the-world problem, as Perl provides a temporary workaround variable (PERL_USE_UNSAFE_INC=1) affected users can set that restores '.' in @INC temporarily to "just work", and for end users convenience,, cpanm, prove and TAP::Harness ( called in `make test` ) set this variable, creating an illusion during installation that this problem is not there

However, this should still be considered a serious issue, as many types of end users don't get the luxury afforded by the CPAN-and-friends hacks ( vendors, hand installers, people running `perl t/foo.t` ), and this workaround is scheduled to be removed in the future.

And due to aforementioned temporary conveniences and hacks, you should intentionally defeat said hacks when testing you've fixed this, by explicitly setting PERL_USE_UNSAFE_INC=0 in your environment prior to running Makefile.PL and tests, and ensuring to perform said tests on Perl 5.25.11 or newer

Two primary solutions are recommended for tests:

1. Re-organise test dependencies into a dedicated directory such as `t/lib` and load that path into @INC with `use lib 't/lib'`

2. Rewrite calls to `do` and `require` to have either absolute paths ( via `File::Spec rel2abs` ) or have explicit `./` prefixes, both of which disable @INC lookup

Both of these suggestions intentionally avoid the easier option of just reinserting `.` on purpose, as some proportion of runtime code also is subject to these cwd-implied bugs, and it is desirable to expose such cases as the errors they are, not silently suppress their failures

For more details, check


Raw Error Observed:

 perl -Mblib=blib t/010Artist.t
ok 1 - use Net::Amazon;
Can't locate t/ in @INC (@INC contains: blib/arch blib/lib /home/kent/perl5/perlbrew/perls/5.25.12-nossp-sip13-nopmc-nodot/lib/site_perl/5.25.12/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.12-nossp-sip13-nopmc-nodot/lib/site_perl/5.25.12 /home/kent/perl5/perlbrew/perls/5.25.12-nossp-sip13-nopmc-nodot/lib/5.25.12/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.12-nossp-sip13-nopmc-nodot/lib/5.25.12) at t/010Artist.t line 20.
# Looks like your test exited with 2 just after 1.

- Gentoo Perl Maintainer ( )
Subject: build.log
Download build.log
text/plain 68.5k

Message body is not shown because it is too large.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to