Commit | Line | Data |
b58ecb01 |
1 | #!/bin/bash |
2 | |
3 | source maint/travis-ci_scripts/common.bash |
4 | if [[ -n "$SHORT_CIRCUIT_SMOKE" ]] ; then return ; fi |
5 | |
eed5492f |
6 | # poison the environment - basically look through lib, find all mentioned |
7 | # ENVvars and set them to true and see if anything explodes |
8 | if [[ "$POISON_ENV" = "true" ]] ; then |
9 | for var in $(grep -P '\$ENV\{' -r lib/ | grep -oP 'DBIC_\w+' | sort -u | grep -v DBIC_TRACE) ; do |
7c1a09fc |
10 | if [[ -z "${!var}" ]] ; then |
11 | export $var=1 |
12 | fi |
eed5492f |
13 | done |
fb88ca2c |
14 | |
444f799b |
15 | export DBI_DSN="dbi:ODBC:server=NonexistentServerAddress" |
16 | export DBI_DRIVER="ADO" |
17 | |
fb88ca2c |
18 | export DBICTEST_SQLITE_REVERSE_DEFAULT_ORDER=1 |
992a24f6 |
19 | fi |
20 | |
b58ecb01 |
21 | if [[ "$CLEANTEST" = "true" ]]; then |
22 | # get the last inc/ off cpan - we will get rid of MI |
23 | # soon enough, but till then this will do |
24 | # the point is to have a *really* clean perl (the ones |
25 | # we build are guaranteed to be clean, without side |
26 | # effects from travis preinstalls) |
27 | |
28 | # trick cpanm into executing true as shell - we just need the find+unpack |
29 | run_or_err "Downloading DBIC inc/ from CPAN" \ |
30 | "SHELL=/bin/true cpanm --look DBIx::Class" |
31 | |
32 | mv ~/.cpanm/latest-build/DBIx-Class-*/inc . |
33 | |
34 | # older perls do not have a CPAN which understands configure_requires |
35 | # properly and what is worse a `cpan Foo` run exits with 0 even if some |
36 | # modules failed to install |
37 | # The first CPAN which is somewhat sane is around 1.94_56 (perl 5.12) |
38 | # The problem is that the first sane version also brings a *lot* of |
39 | # deps with it, notably things like YAML and HTTP::Tiny |
40 | # The goal of CLEANTEST is to have as little extra stuff installed as |
41 | # possible, mainly to catch "but X is perl core" mistakes |
42 | # So instead we still use our stock (possibly old) CPAN, and add some |
43 | # handholding |
726501ac |
44 | if ! CPAN_is_sane ; then |
2b885e5f |
45 | for m in ExtUtils::MakeMaker ExtUtils::CBuilder R/RS/RSAVAGE/Tree-DAG_Node-1.13.tgz Module::Build ; do |
726501ac |
46 | run_or_err "Pre-installing $m" "cpan $m" |
2b8f2982 |
47 | if ! perl -e ' |
48 | |
49 | eval ( q{require } . ( |
50 | $ARGV[0] =~ m{ \/ .*? ([^\/]+) $ }x |
51 | ? do { my @p = split (/\-/, $1); pop @p; join "::", @p } |
52 | : $ARGV[0] |
53 | ) ) or ( print $@ and exit 1)' "$m" 2> /dev/null ; then |
54 | |
55 | echo_err -e "$m installation failed\n$LASTOUT" |
56 | exit 1 |
57 | fi |
726501ac |
58 | done |
59 | fi |
b58ecb01 |
60 | |
b58ecb01 |
61 | |
62 | # DBI has by far the longest test runtime - run less tests |
63 | # FIXME horrible horrible hack, need to implement in DBI itself |
64 | run_or_err "Downloading latest DBI distdir from CPAN" \ |
65 | "SHELL=/bin/true cpanm --look DBI" |
66 | cd ~/.cpanm/latest-build/DBI-*/ |
67 | perl -p -i -e 's/(create_.+?_tests) => 1/$1 => 0/' Makefile.PL |
68 | run_or_err "Pre-installing DBI, but running less tests" "perl Makefile.PL && make && make test && make install" |
69 | cd - &>/dev/null |
70 | |
71 | else |
72 | # we will be running all dbic tests - preinstall lots of stuff, run basic tests |
73 | # using SQLT and set up whatever databases necessary |
74 | export DBICTEST_SQLT_DEPLOY=1 |
75 | |
76 | # do the preinstall in several passes to minimize amount of cross-deps installing |
77 | # multiple times, and to avoid module re-architecture breaking another install |
91d48c58 |
78 | # (e.g. once Carp is upgraded there's no more Carp::Heavy, |
79 | # while a File::Path upgrade may cause a parallel EUMM run to fail) |
b58ecb01 |
80 | # |
2b885e5f |
81 | parallel_installdeps_notest ExtUtils::MakeMaker |
91d48c58 |
82 | parallel_installdeps_notest File::Path |
b58ecb01 |
83 | parallel_installdeps_notest Carp |
435f9f82 |
84 | parallel_installdeps_notest Module::Build ExtUtils::Depends |
85 | parallel_installdeps_notest Module::Runtime File::Spec Data::Dumper |
655d80dd |
86 | parallel_installdeps_notest Test::Exception Encode::Locale Test::Fatal R/RS/RSAVAGE/Tree-DAG_Node-1.13.tgz |
5f7ad019 |
87 | parallel_installdeps_notest Test::Warn bareword::filehandles B::Hooks::EndOfScope Test::Differences HTTP::Status |
f5616614 |
88 | parallel_installdeps_notest Test::Pod::Coverage Test::EOL Devel::GlobalDestruction Sub::Name MRO::Compat Class::XSAccessor URI::Escape HTML::Entities |
2cf93a3d |
89 | parallel_installdeps_notest YAML LWP Class::Trigger JSON::XS DBI DateTime::Format::Builder Class::Accessor::Grouped Package::Variant |
90 | parallel_installdeps_notest Moose Module::Install JSON SQL::Translator |
b58ecb01 |
91 | |
f5616614 |
92 | if [[ -n "DBICTEST_FIREBIRD_DSN" ]] ; then |
4e338f1b |
93 | # pull in patched unreleased copy with restored 5.8 compat |
b58ecb01 |
94 | run_or_err "Fetching patched DBD::Firebird" \ |
4e338f1b |
95 | "git clone https://github.com/mariuz/perl-dbd-firebird ~/dbd-firebird" |
b58ecb01 |
96 | |
97 | # the official version is very much outdated and does not compile on 5.14+ |
98 | # use this rather updated source tree (needs to go to PAUSE): |
99 | # https://github.com/pilcrow/perl-dbd-interbase |
100 | run_or_err "Fetching patched DBD::InterBase" \ |
101 | "git clone https://github.com/dbsrgits/perl-dbd-interbase ~/dbd-interbase" |
102 | |
4e338f1b |
103 | # Now part of DBD::Firebird configure_requires, which are not present |
104 | # in the cloned repo (no META.*) |
105 | # FIXME - need to get this off metacpan or something instead |
106 | parallel_installdeps_notest File::Which |
107 | |
b58ecb01 |
108 | parallel_installdeps_notest ~/dbd-interbase/ ~/dbd-firebird/ |
109 | fi |
110 | |
111 | fi |
112 | |
113 | # generate the makefile which will have different deps depending on |
114 | # the runmode and envvars set above |
115 | run_or_err "Configure on current branch" "perl Makefile.PL" |
116 | |
117 | # install (remaining) dependencies, sometimes with a gentle push |
118 | if [[ "$CLEANTEST" = "true" ]]; then |
119 | # we may need to prepend some stuff to that list |
120 | HARD_DEPS="$(echo $(make listdeps))" |
121 | |
4e338f1b |
122 | |
123 | ##### TEMPORARY WORKAROUNDS |
124 | |
b58ecb01 |
125 | # this is a fucked CPAN - won't understand configure_requires of |
126 | # various pieces we may run into |
4e338f1b |
127 | # FIXME - need to get these off metacpan or something instead |
b58ecb01 |
128 | CPAN_is_sane || HARD_DEPS="ExtUtils::Depends B::Hooks::OP::Check $HARD_DEPS" |
129 | |
71dd2ecc |
130 | # The unicode-in-yaml bug on older cpan clients |
131 | # FIXME there got to be a saner way to fix this... |
b58ecb01 |
132 | perl -M5.008008 -e 1 &> /dev/null || \ |
71dd2ecc |
133 | run_or_err "Installing multidimensional and bareword::filehandles via cpanm" \ |
134 | "cpanm multidimensional bareword::filehandles" |
b58ecb01 |
135 | |
136 | # work around Params::Validate not having a Makefile.PL so really old |
137 | # toolchains can not figure out what the prereqs are ;( |
138 | # Need to do more research before filing a bug requesting Makefile inclusion |
139 | perl -M5.008008 -e 1 &> /dev/null || \ |
140 | HARD_DEPS="$(extract_prereqs Params::Validate) $HARD_DEPS" |
141 | |
142 | ##### END TEMPORARY WORKAROUNDS |
143 | |
5cbe5b12 |
144 | run_or_err "Installing/testing dependencies (may take up to 3 minutes): $HARD_DEPS" "cpan $HARD_DEPS" |
b58ecb01 |
145 | |
146 | # this is a fucked CPAN - save the log as we may need it |
147 | CPAN_is_sane || INSTALLDEPS_OUT="$LASTOUT" |
148 | |
149 | else |
150 | # listalldeps is deliberate - will upgrade everything it can find |
151 | parallel_installdeps_notest $(make listalldeps) |
992a24f6 |
152 | |
153 | if [[ -n "$TEST_BUILDER_BETA_CPAN_TARBALL" ]] ; then |
154 | parallel_installdeps_notest $TEST_BUILDER_BETA_CPAN_TARBALL |
155 | fi |
b58ecb01 |
156 | fi |
157 | |
158 | echo_err "$(tstamp) Dependency configuration finished" |
159 | # this will display list of available versions |
160 | perl Makefile.PL |
161 | |
162 | # make sure we got everything we need |
163 | if [[ -n "$(make listdeps)" ]] ; then |
164 | echo_err "$(tstamp) Not all deps installed - something went wrong :(" |
165 | sleep 1 # without this the echo below confuses the console listener >.< |
166 | CPAN_is_sane || echo_err -e "Outdated CPAN.pm used - full logs follows\n$INSTALLDEPS_OUT\n\nSearch for 'NOT OK' in the text above\n\nDeps still missing:" |
167 | sleep 3 # without this the above echo confuses the console listener >.< |
168 | make listdeps |
169 | exit 1 |
170 | fi |
171 | |
172 | # announce what are we running |
173 | echo_err " |
174 | ===================== DEPENDENCY CONFIGURATION COMPLETE ===================== |
175 | $(tstamp) Configuration phase seems to have taken $(date -ud "@$SECONDS" '+%H:%M:%S') (@$SECONDS) |
176 | |
177 | = CPUinfo |
178 | $(perl -0777 -p -e 's/.+\n\n(?!\z)//s' < /proc/cpuinfo) |
179 | |
180 | = Meminfo |
181 | $(free -m -t) |
182 | |
183 | = Environment |
184 | $(env | grep -P 'TEST|TRAVIS|PERL|DBIC' | LC_ALL=C sort | cat -v) |
185 | |
186 | = Perl in use |
187 | $(perl -V) |
188 | =============================================================================" |