Attempt to fix Travis build on 5.20 and 5.22
Aaron Crane [Thu, 11 May 2017 15:26:24 +0000 (16:26 +0100)]
AFAICT, what's happening here is as follows.

The Travis build starts by installing Catalyst::Devel, which depends on
Catalyst, which is in the Catalyst-Runtime dist. So the latest released
version of Catalyst::Runtime gets installed to make that happen. The
release in question has an unversioned dependency on List::Util (well,
Scalar::Util), so that dep is met by the Perl core. Then the Travis build
runs the Makefile.PL, which prompts the user to install a newer version of
List::Util. Nothing attempts to answer that prompt, so the Travis build
times out.

Newer versions of Perl satisfy the 1.45 List::Util dependency natively.
For older versions of Perl, it seems to be the case that something else in
the dependency graph requires a newer version of List::Util than is shipped
with that Perl, and the latest version is selected automatically. So only
5.20 and 5.22 are affected by this.

We therefore change the Travis build so that, once the Makefile.PL has been
run (thus creating MYMETA.json) we try again to install any missing deps
using cpanm. Hopefully this will work!

.travis.yml

index 9a04424..05fa29a 100644 (file)
@@ -24,6 +24,15 @@ install:
    - cpanm --notest --metacpan --skip-satisfied --installdeps .
    - echo y | perl Makefile.PL
 
+   # installing Catalyst::Devel above causes the latest release of
+   # Catalyst::Runtime to be installed, but the version we're testing might
+   # have additional deps that aren't yet satisfied. so we should try
+   # installing deps again now that the MYMETA has been created (and we'll also
+   # need to delete the now-unneeded cpanfile so that cpanm doesn't choose it
+   # in preference to the MYMETA)
+   - rm -f cpanfile
+   - cpanm --notest --metacpan --skip-satisfied --installdeps .
+
    # enable various test options, including parallel testing
    - export AUTOMATED_TESTING=1 HARNESS_OPTIONS=j10:c HARNESS_TIMER=1