From: Peter Rabbitson Date: Tue, 19 May 2015 03:49:48 +0000 (+0200) Subject: Make sure tests pass without a compiler present (another step to RT#74706) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=59effb9d8b9d9b0054a2ac1d9fffe0d1933d6c5b;p=dbsrgits%2FDBIx-Class.git Make sure tests pass without a compiler present (another step to RT#74706) --- diff --git a/.travis.yml b/.travis.yml index e7d1fa7..8b6e51a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -84,6 +84,7 @@ matrix: - perl: 5.8.3_nt_mb env: - CLEANTEST=true + - POISON_ENV=true - DBIC_TRACE_PROFILE=console_monochrome - BREWVER=5.8.3 - BREWOPTS="-Dusemorebits" @@ -119,10 +120,11 @@ matrix: - BREWVER=5.8.8 - BREWOPTS="-Duseithreads -Dusemorebits" - # CLEANTEST: this is the perl suse ships + # CLEANTEST: this is the perl suse ships, with env poisoning - perl: 5.10.0_thr_dbg env: - CLEANTEST=true + - POISON_ENV=true - BREWVER=5.10.0 - BREWOPTS="-DDEBUGGING -Duseithreads" @@ -139,10 +141,10 @@ matrix: - perl: 5.12.3_thr env: - CLEANTEST=true + - POISON_ENV=true - DBIC_TRACE=1 - DBIC_MULTICREATE_DEBUG=1 - DBIC_STORAGE_RETRY_DEBUG=1 - - POISON_ENV=true - DBIC_TRACE_PROFILE=console - BREWVER=5.12.3 - BREWOPTS="-Duseithreads" @@ -150,38 +152,45 @@ matrix: - perl: 5.16.3_thr_mb env: - CLEANTEST=false - - DBIC_TRACE=1 - POISON_ENV=true + - DBIC_TRACE=1 - BREWVER=5.16.3 - BREWOPTS="-Duseithreads -Dusemorebits" - perl: 5.18-extras env: - CLEANTEST=false - - DBIC_TRACE=1 - POISON_ENV=true + - DBIC_TRACE=1 - DBIC_TRACE_PROFILE=console_monochrome - DBICTEST_VIA_REPLICATED=0 ### # Start of the allow_failures block - # threaded oldest possible with blead CPAN with non-tracing poisoning + # threaded oldest possible with blead CPAN - perl: devcpan_5.8.1_thr_mb env: - CLEANTEST=true - DEVREL_DEPS=true - - POISON_ENV=true - BREWVER=5.8.1 - BREWOPTS="-Duseithreads -Dusemorebits" - # 5.8.4 threaded with blead CPAN with non-tracing poisoning - - perl: devcpan_5.8.4_thr + # oldest possible with blead CPAN with poisoning + - perl: devcpan_5.8.1 env: - CLEANTEST=true - DEVREL_DEPS=true - POISON_ENV=true - - BREWVER=5.8.4 + - BREWVER=5.8.1 + + # 5.8.7 threaded with blead CPAN with non-tracing poisoning + - perl: devcpan_5.8.7_thr + env: + - CLEANTEST=true + - DEVREL_DEPS=true + - POISON_ENV=true + - BREWVER=5.8.7 - BREWOPTS="-Duseithreads" # 5.10.0 threaded with blead CPAN @@ -207,12 +216,11 @@ matrix: - POISON_ENV=true - BREWVER=blead - # bleadperl with blead CPAN with non-tracing poisoning + # bleadperl with blead CPAN - perl: devcpan_bleadperl_thr_mb env: - CLEANTEST=false - DEVREL_DEPS=true - - POISON_ENV=true - BREWVER=blead - BREWOPTS="-Duseithreads -Dusemorebits" @@ -222,7 +230,8 @@ matrix: # these run with various dev snapshots - allowed to fail - perl: devcpan_5.8.1_thr_mb - - perl: devcpan_5.8.4_thr + - perl: devcpan_5.8.1 + - perl: devcpan_5.8.7_thr - perl: devcpan_5.10.0_thr_mb - perl: devcpan_5.12.1_thr - perl: bleadperl diff --git a/Changes b/Changes index 909894c..8fe9a0a 100644 --- a/Changes +++ b/Changes @@ -10,6 +10,7 @@ Revision history for DBIx::Class notably on_connect* failures now properly abort the entire connect - Fix corner case of stringify-only overloaded objects being used in create()/populate() + - Fix t/52leaks.t failures on compilerless systems (RT#104429) * Misc - Skip tests in a way more intelligent and speedy manner when optional diff --git a/maint/travis-ci_scripts/30_before_script.bash b/maint/travis-ci_scripts/30_before_script.bash index 4f5007d..513e3d3 100755 --- a/maint/travis-ci_scripts/30_before_script.bash +++ b/maint/travis-ci_scripts/30_before_script.bash @@ -33,6 +33,21 @@ if [[ "$POISON_ENV" = "true" ]] ; then parallel_installdeps_notest DBD::SQLite@1.29 fi + # also try minimal tested installs *without* a compiler + if [[ "$CLEANTEST" = "true" ]]; then + + # Clone and P::S::XS are both bugs + # File::Spec can go away as soon as I dump Path::Class + # List::Util can be excised after that as well (need to make my own max() routine for older perls) + + installdeps Sub::Name Clone Package::Stash::XS \ + $( perl -MFile::Spec\ 3.26 -e1 &>/dev/null || echo "File::Spec" ) \ + $( perl -MList::Util\ 1.16 -e1 &>/dev/null || echo "List::Util" ) + + mkdir -p "$HOME/bin" # this is already in $PATH, just doesn't exist + run_or_err "Linking ~/bin/cc to /bin/false - thus essentially BREAKING the C compiler" \ + "ln -s /bin/false $HOME/bin/cc" + fi fi if [[ "$CLEANTEST" = "true" ]]; then diff --git a/t/52leaks.t b/t/52leaks.t index 6ed7b41..b427175 100644 --- a/t/52leaks.t +++ b/t/52leaks.t @@ -446,6 +446,14 @@ for my $addr (keys %$weak_registry) { delete $weak_registry->{$addr} unless $cleared->{hash_merge_singleton}{$weak_registry->{$addr}{weakref}{behavior}}++; } + elsif ($names =~ /^B::Hooks::EndOfScope::PP::_TieHintHashFieldHash/m) { + # there is one tied lexical which stays alive until GC time + # https://metacpan.org/source/ETHER/B-Hooks-EndOfScope-0.15/lib/B/Hooks/EndOfScope/PP/FieldHash.pm#L24 + # simply ignore it here, instead of teaching the leaktracer to examine ties + # the latter is possible yet terrible: https://github.com/dbsrgits/dbix-class/blob/v0.082820/t/lib/DBICTest/Util/LeakTracer.pm#L113-L117 + delete $weak_registry->{$addr} + unless $cleared->{bheos_pptiehinthashfieldhash}++; + } elsif ($names =~ /^DateTime::TimeZone::UTC/m) { # DT is going through a refactor it seems - let it leak zones for now delete $weak_registry->{$addr};