diff options
author | Zack Weinberg <zackw@panix.com> | 2021-01-02 11:17:08 -0500 |
---|---|---|
committer | Björn Esser <besser82@fedoraproject.org> | 2021-02-20 20:28:29 +0100 |
commit | 05239fc98a293beba7edb05d93f570c3209dcdd3 (patch) | |
tree | c13d8ad50e47530eb377c9e1c2b282f2ec735a32 /build-aux | |
parent | c7bf2cf8e610bb26bece7f3a2bc5b47d7c659c7d (diff) | |
download | libxcrypt-05239fc98a293beba7edb05d93f570c3209dcdd3.tar.gz libxcrypt-05239fc98a293beba7edb05d93f570c3209dcdd3.tar.bz2 libxcrypt-05239fc98a293beba7edb05d93f570c3209dcdd3.zip |
Add a build using Ubuntu 14.04 (Trusty).
This is to validate that our build scripts work with our documented
minimum version of Perl (5.14). This is the newest version of Ubuntu
on which Travis supports use of perl this old.
Contra the documentation, Trusty-based build workers’ default perl is
5.18, not 5.14. Travis doesn’t support use of the `perl: VERSION`
build matrix parameter in a `language:c` build, and it doesn’t support
use of the `compiler:` parameter in a `language:perl` build.
The least terrible kludge I can come up with is to continue using
`language:c`, manually download and install the precompiled perl 5.14
binaries that Travis _would_ use for `perl:5.14`, and then manually
activate the appropriate perlbrew environment. (We can’t use
$PERLBREW_ROOT/etc/bashrc because it’s, well, a bash script,
and our build scripts are _sh_ scripts.)
There is a pretty strong argument that no one should be using
perl < 5.18 anymore: 5.18 is the oldest version with randomized
hashes, which are a critical security fix for anyone processing
untrusted input with Perl. But the input to all our Perl scripts
is our own source or object code, so that’s not an issue for us.
In fact, we could go even earlier, since we’re not actually _using_
the Unicode support that motivated my selection of 5.14 as the
minimum. Opinions solicited.
Since this means we have to have an install script again, also use it
to install perltidy and perlcritic when DISTCHECK=1, add configuration
files for both tools, and run perlcritic from the distcheck-hook.
(This doesn’t *do* anything yet, of course, since there aren’t any
Perl scripts yet.) Quibbles with my formatting and linting choices
are also solicited.
Diffstat (limited to 'build-aux')
-rwxr-xr-x | build-aux/travis-after-success | 11 | ||||
-rwxr-xr-x | build-aux/travis-before | 12 | ||||
-rwxr-xr-x | build-aux/travis-build | 11 | ||||
-rwxr-xr-x | build-aux/travis-install | 36 |
4 files changed, 70 insertions, 0 deletions
diff --git a/build-aux/travis-after-success b/build-aux/travis-after-success index 149119c..efb0ab3 100755 --- a/build-aux/travis-after-success +++ b/build-aux/travis-after-success @@ -5,6 +5,17 @@ if [ "$PERFORM_COVERITY_SCAN" = 1 ] || [ "$DISTCHECK" = 1 ]; then exit 0 fi +# All travis-* scripts must begin by initializing perlbrew if +# possible; travis does not do this for us. Unfortunately, the +# code in $PERLBREW_ROOT/etc/bashrc is crawling with bashisms, +# and the only alternatives offered are for fish and csh, not +# portable sh. Fortunately, what we need to do is simple +# enough to open-code. +if [ -f "$PERLBREW_HOME/init" ]; then + . "$PERLBREW_HOME/init" + PATH="$(echo $PATH | sed "s%:$PERLBREW_ROOT/bin:%:$PERLBREW_PATH:%")" +fi + GCOV=gcov if [ "$TRAVIS_OS_NAME" = osx ]; then diff --git a/build-aux/travis-before b/build-aux/travis-before index abe48e5..13584f7 100755 --- a/build-aux/travis-before +++ b/build-aux/travis-before @@ -1,9 +1,21 @@ #! /bin/sh set -e +# All travis-* scripts must begin by initializing perlbrew if +# possible; travis does not do this for us. Unfortunately, the +# code in $PERLBREW_ROOT/etc/bashrc is crawling with bashisms, +# and the only alternatives offered are for fish and csh, not +# portable sh. Fortunately, what we need to do is simple +# enough to open-code. +if [ -f "$PERLBREW_HOME/init" ]; then + . "$PERLBREW_HOME/init" + PATH="$(echo $PATH | sed "s%:$PERLBREW_ROOT/bin:%:$PERLBREW_PATH:%")" +fi + # Log the identities and versions of the build tools. for tool in \ "${CC-cc}" \ + "${NM-nm}" \ "${AUTOCONF-autoconf}" \ "${AUTOMAKE-automake}" \ "${LIBTOOLIZE-libtoolize}" \ diff --git a/build-aux/travis-build b/build-aux/travis-build index e735511..9d80aab 100755 --- a/build-aux/travis-build +++ b/build-aux/travis-build @@ -78,6 +78,17 @@ travis_wait () { return "$result" } +# All travis-* scripts must begin by initializing perlbrew if +# possible; travis does not do this for us. Unfortunately, the +# code in $PERLBREW_ROOT/etc/bashrc is crawling with bashisms, +# and the only alternatives offered are for fish and csh, not +# portable sh. Fortunately, what we need to do is simple +# enough to open-code. +if [ -f "$PERLBREW_HOME/init" ]; then + . "$PERLBREW_HOME/init" + PATH="$(echo $PATH | sed "s%:$PERLBREW_ROOT/bin:%:$PERLBREW_PATH:%")" +fi + export NPROCS="$((`nproc --all 2>/dev/null || sysctl -n hw.ncpu` * 2))" echo paralleism is $NPROCS diff --git a/build-aux/travis-install b/build-aux/travis-install new file mode 100755 index 0000000..d818ab2 --- /dev/null +++ b/build-aux/travis-install @@ -0,0 +1,36 @@ +#! /bin/sh + +set -e + +if [ "$OLDEST_SUPPORTED_PERL" = 1 ]; then + command -V perlbrew + command -V lsb_release + + PERLV=5.14 + URL=https://storage.googleapis.com/travis-ci-language-archives/perl/binaries + URL="$URL/$(lsb_release -is | tr A-Z a-z)/$(lsb_release -rs)/$(uname -m)" + URL="$URL/perl-${PERLV}.tar.bz2" + set -x + wget -nv $URL + sudo tar xjf perl-${PERLV}.tar.bz2 --directory / + rm perl-${PERLV}.tar.bz2 + perlbrew list + perlbrew switch ${PERLV} + [ -f "$PERLBREW_HOME/init" ] || { ls -l "$PERLBREW_HOME"; exit 1; } + + . "$PERLBREW_HOME/init" + PATH="$(echo $PATH | sed "s%:$PERLBREW_ROOT/bin:%:$PERLBREW_PATH:%")" + command -v perl +fi + +if [ "$DISTCHECK" = 1 ]; then + set -x + cpanm -S -i \ + Perl::Critic \ + Perl::Critic::Freenode \ + Perl::Critic::Pulp \ + Perl::Critic::TooMuchCode \ + Perl::Tidy + perltidy --version + perlcritic --version +fi |