Skip to content

Commit

Permalink
Fix building on perls with no . in @inc
Browse files Browse the repository at this point in the history
Perl 5.26 will be able to be built with no . in @inc,
and Debian are already building their 5.24 without it.

To cope with this, do -It/lib -MFoo instead of -Mt::lib::Foo.
  • Loading branch information
ilmari committed Sep 28, 2016
1 parent 89d5e36 commit 8aae794
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion maint/Makefile.PL.inc/56_autogen_schema_files.pl
@@ -1,5 +1,5 @@
my $test_ddl_fn = 't/lib/sqlite.sql';
my @test_ddl_cmd = qw( -I lib -Mt::lib::ANFANG -- maint/gen_sqlite_schema_files --schema-class DBICTest::Schema );
my @test_ddl_cmd = qw( -I lib -I t/lib -MANFANG -- maint/gen_sqlite_schema_files --schema-class DBICTest::Schema );

my $example_ddl_fn = 'examples/Schema/db/example.sql';
my $example_db_fn = 'examples/Schema/db/example.db';
Expand Down
2 changes: 1 addition & 1 deletion t/lib/ANFANG.pm
Expand Up @@ -16,7 +16,7 @@ our $anfang_loaded;

# this allows the obscure but possible call case to behave correctly:
#
# perl -Mt::lib::ANFANG -e 'do "./t/lib/ANFANG.pm" or die ( $@ || $! )'
# perl -It/lib -MANFANG -e 'do "./t/lib/ANFANG.pm" or die ( $@ || $! )'
#
return 1 if $anfang_loaded;

Expand Down
2 changes: 1 addition & 1 deletion t/lib/DBICTest/Util.pm
Expand Up @@ -376,7 +376,7 @@ sub can_alloc_MB ($) {

local ( $!, $^E, $?, $@ );

system( $perl, qw( -Mt::lib::ANFANG -e ), <<'EOS', $arg );
system( $perl, qw( -It/lib -MANFANG -e ), <<'EOS', $arg );
$0 = 'malloc_canary';
my $tail_character_of_reified_megastring = substr( ( join '', map chr, 0..255 ) x (4 * 1024 * $ARGV[0]), -1 );
EOS
Expand Down
4 changes: 2 additions & 2 deletions xt/extra/taint.t
Expand Up @@ -20,7 +20,7 @@ use warnings;

# there is talk of possible perl compilations where -T is fatal or just
# doesn't work. We don't want to have the user deal with that.
BEGIN { unless ($INC{'t/lib/DBICTest/WithTaint.pm'}) {
BEGIN { unless ($INC{'DBICTest/WithTaint.pm'}) {

if ( $^O eq 'MSWin32' and $^X =~ /\x20/ ) {
print "1..0 # SKIP Running this test on Windows with spaces within the perl executable path (\$^X) is not possible due to https://rt.perl.org/Ticket/Display.html?id=123907\n";
Expand Down Expand Up @@ -56,7 +56,7 @@ BEGIN { unless ($INC{'t/lib/DBICTest/WithTaint.pm'}) {
exit 0;
}

exec( $perl, qw( -I. -Mt::lib::DBICTest::WithTaint -T ), __FILE__ );
exec( $perl, qw( -It/lib -MDBICTest::WithTaint -T ), __FILE__ );
}}

# We need to specify 'lib' here as well because even if it was already in
Expand Down

0 comments on commit 8aae794

Please sign in to comment.