Accessing old versions of Perl in a C-language build

I co-maintain a library written in C which uses a bunch of Perl scripts during its build. We would like to test the build with the version of Perl that we document as the oldest one we support, namely 5.14.

According to https://docs.travis-ci.com/user/reference/trusty/#perl-images, 5.14 is the version you get with dist: trusty, but that’s wrong. As best I can tell by instrumenting one of my builds, the only available version of Perl in a language: c, dist: trusty VM is 5.18:

PATH=/home/travis/.rvm/gems/ruby-2.4.1/bin:/home/travis/.rvm/gems/ruby-2.4.1@global/bin:/home/travis/.rvm/rubies/ruby-2.4.1/bin:/home/travis/.rvm/bin:/usr/lib/ccache:/home/travis/bin:/home/travis/.local/bin:/opt/pyenv/shims:/home/travis/.phpenv/shims:/home/travis/perl5/perlbrew/bin:/home/travis/.nvm/versions/node/v8.9.1/bin:/home/travis/.kiex/elixirs/elixir-1.4.5/bin:/home/travis/.kiex/bin:/home/travis/gopath/bin:/home/travis/.gimme/versions/go1.7.4.linux.amd64/bin:/usr/local/phantomjs/bin:/usr/local/phantomjs:/usr/local/neo4j-3.2.7/bin:/usr/local/maven-3.5.2/bin:/usr/local/cmake-3.9.2/bin:/usr/local/clang-5.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/travis/.phpenv/bin:/opt/pyenv/bin:/home/travis/.yarn/bin
PERLBREW_ROOT=/home/travis/perl5/perlbrew
PERLBREW_HOME=/home/travis/.perlbrew
+ ls /usr/bin/perl /usr/bin/perl5.18.2 /usr/bin/perlbug /usr/bin/perldoc /usr/bin/perlivp /usr/bin/perlthanks
/usr/bin/perl
/usr/bin/perl5.18.2
/usr/bin/perlbug
/usr/bin/perldoc
/usr/bin/perlivp
/usr/bin/perlthanks

/home/travis/perl5/perlbrew:
total 20
drwxr-xr-x 2 travis travis 4096 Dec  5  2017 bin
drwxr-xr-x 2 travis travis 4096 Dec  5  2017 build
drwxr-xr-x 2 travis travis 4096 Dec  5  2017 dists
drwxr-xr-x 2 travis travis 4096 Dec  5  2017 etc
drwxr-xr-x 2 travis travis 4096 Dec  5  2017 perls

/home/travis/perl5/perlbrew/bin:
total 1748
-rwxr-xr-x 1 travis travis  305338 Dec  5  2017 cpanm
-rwxr-xr-x 1 travis travis 1266202 Dec  5  2017 patchperl
-rwxr-xr-x 1 travis travis  211020 Dec  5  2017 perlbrew

/home/travis/perl5/perlbrew/perls:
total 0

(quoted from the “build-aux/travis-install” section of this build log)

I tried adding perl: "5.14" to the build configuration for this job, but that gave me an error message about an unrecognized key. I presume that this knob is only supported in language:perl builds. I also tried adding perlbrew install 5.14 to my install script, but that tried to compile perl 5.14 from source, which is unacceptably slow.

How can I use one of the precompiled old perl versions that are made available to language:perl builds, in a language:c build?


N.B. The rationale for us selecting 5.14 as our oldest supported Perl is that that’s the oldest version where use feature 'unicode_strings' was fully implemented. I would consider bumping it to 5.16 if that made this task easier, but I don’t want to go to 5.18 because I do not want to introduce an accidental dependency on the hash-ordering changes in 5.18. Xenial’s 2.22 is Right Out.