(travis) Work around RT#116788
[dbsrgits/DBIx-Class.git] / maint / travis-ci_scripts / 50_after_success.bash
1 #!/bin/bash
2
3 # this file is executed in a subshell - set up the common stuff
4 source maint/travis-ci_scripts/common.bash
5
6 if [[ -n "$SHORT_CIRCUIT_SMOKE" ]] || [[ "$TRAVIS_PULL_REQUEST" != "false" ]] ; then exit 0 ; fi
7
8 # this part needs to run in parallel unconditionally
9 export VCPU_USE="$VCPU_AVAILABLE"
10 export HARNESS_OPTIONS="j$VCPU_USE"
11
12
13 if [[ "$DEVREL_DEPS" == "true" ]] && perl -M5.008003 -e1 &>/dev/null ; then
14
15   [[ "$BREAK_CC" == "true" ]] && run_or_err "Unbreaking previously broken ~/bin/cc" "rm $HOME/bin/cc"
16
17   # FIXME - Devel::Cover (brought by Test::Strict, but soon needed anyway)
18   # does not test cleanly on 5.8.7 - just get it directly
19   if perl -M5.008007 -e1 &>/dev/null && ! perl -M5.008008 -e1 &>/dev/null; then
20     parallel_installdeps_notest Devel::Cover
21   fi
22
23   # FIXME - workaround for YAML/RT#81120 and L::SRH/RT#107681
24   # We don't actually need these modules, only there because of SQLT (which will be fixed)
25   # does not test cleanly on 5.8.7 - just get them directly
26   if ! perl -M5.008008 -e1 &>/dev/null; then
27     parallel_installdeps_notest YAML Lexical::SealRequireHints
28   fi
29
30   # FIXME - workaround for RT#116788
31   # ( two instances, see below )
32   if ! perl -M5.008007 -e1 &>/dev/null; then
33     parallel_installdeps_notest 'Encode~!=2.85'
34   fi
35
36   # FIXME Change when Moose goes away
37   installdeps Moose $(perl -Ilib -MDBIx::Class::Optional::Dependencies=-list_missing,dist_dir)
38
39   run_or_err "Attempt to build a dist" "rm -rf inc/ && perl Makefile.PL && make dist"
40   tarball_assembled=1
41
42 elif [[ "$CLEANTEST" != "true" ]] ; then
43
44   # FIXME - workaround for RT#116788
45   # ( two instances, see above )
46   if ! perl -M5.008007 -e1 &>/dev/null; then
47     parallel_installdeps_notest 'Encode~!=2.85'
48   fi
49
50   parallel_installdeps_notest $(perl -Ilib -MDBIx::Class::Optional::Dependencies=-list_missing,dist_dir)
51
52   run_or_err "Attempt to build a dist from original checkout" "make dist"
53   tarball_assembled=1
54 fi
55
56
57 if [[ -n "$tarball_assembled" ]] ; then
58
59   echo "Contents of the resulting dist tarball:"
60   echo "==========================================="
61   tar -vzxf DBIx-Class-*.tar.gz
62   echo "==========================================="
63
64   # kill as much as possible with fire
65   purge_sitelib
66
67
68   # undo some of the pollution (if any) affecting the plain install deps
69   # FIXME - this will go away once we move off Moose, and a new SQLT
70   # with much less recommends ships
71   export DBICTEST_SQLT_DEPLOY=""
72   export DBICTEST_VIA_REPLICATED=""
73
74
75   # make sure we are retrying with newest CPAN possible
76   #
77   # not running tests on CPAN.pm - they are not terribly slow,
78   # but https://rt.cpan.org/Ticket/Display.html?id=96437 sucks
79   parallel_installdeps_notest CPAN
80   run_or_err "Make sure CPAN was upgraded to at least 2.10" "perl -M'CPAN 2.010' -e1"
81
82   run_or_err "Re-Configuring CPAN.pm" "perl -MCPAN -e '\
83     CPAN::Config->load;
84
85     # For the time being smoking with this setting is not realistic
86     # https://rt.cpan.org/Ticket/Display.html?id=103280
87     # https://rt.cpan.org/Ticket/Display.html?id=37641
88     # https://rt.cpan.org/Ticket/Display.html?id=77708
89     # https://rt.cpan.org/Ticket/Display.html?id=87474
90     #\$CPAN::Config->{build_requires_install_policy} = q{no};
91
92     \$CPAN::Config->{recommends_policy} = q{yes};
93     CPAN::Config->commit;
94   '"
95
96   cd "$(find DBIx-Class-* -maxdepth 0 -type d | head -n 1)"
97
98   # only run a full test cycle on devrel_deps, as they are all marked
99   # as "allow fails" in the travis matrix
100   if [[ "$DEVREL_DEPS" == "true" ]] ; then
101
102     for e in $( env | grep 'DBICTEST.*DSN' | cut -f 1 -d '=' ) ; do
103       echo "Unsetting $e"
104       export $e=""
105     done
106
107     # FIXME - for some reason a plain `cpan .` does not work in this case
108     # no time to investigate
109     run_or_err \
110       "Attempt to configure/test/build/install dist using latest CPAN@$(perl -MCPAN -e 'print CPAN->VERSION')" \
111       "perl -MCPAN -e 'install( q{.} )'"
112
113   else
114     run_or_err \
115       "Attempt to configure/build/install dist using latest CPAN@$(perl -MCPAN -e 'print CPAN->VERSION')" \
116       "perl -MCPAN -e 'notest( install => q{.} )'"
117   fi
118 fi