Skip to content

Commit b484daa

Browse files
gonewest818bbatsov
authored andcommitted
[#2120] Fix TLS related errors in Travis CI (#2128)
Fixes the Travis CI build errors reported in #2120. Diffs to .travis.yml are as follows: (1) I've added some explicit package dependencies into addons.apt.packages. This is basically the compiler toolchain needed to build gnutls from source (2) Configured $HOME/local to be cached by Travis between subsequent builds. This is done with the setting cache.directories. See Travis documentation for further information about the caching of data. Basically, the contents of that folder are rolled up into a tar ball and saved to an S3 bucket whenever the contents change. The tarball is retrieved and installed prior to the start of your CI job. (3) Added a utility script named travis-ci/travis-gnutls.sh which handles the downloading and compiling of the sources. The script is organized so that the version of gnutls can be easily updated whenever needed. Just edit the version numbers in that script and push the change. The script is able to detect when it doesn't have the specific version requested, and when that happens it deletes the cache and rebuilds gnutls. (4) While I was at it, I added emacs 25.3-travis and 26-pretest-travis to the build matrix. Note that git-snapshot-travis now reports itself as being version 27. (Also note, emacs 26 and 27 are still broken builds, but at least now it's not because of the build script itself.)
1 parent c1a500d commit b484daa

File tree

3 files changed

+87
-14
lines changed

3 files changed

+87
-14
lines changed

.travis.yml

Lines changed: 40 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,54 @@
11
sudo: false
22
language: emacs-lisp
3+
4+
addons:
5+
apt:
6+
packages:
7+
- autogen
8+
- ca-certificates
9+
- curl
10+
- gcc
11+
- libgmp-dev
12+
- m4
13+
- make
14+
- pkg-config
15+
- xz-utils
16+
17+
cache:
18+
directories:
19+
- $HOME/local
20+
321
env:
4-
- EMACS_BINARY=emacs-24.4-travis MAKE_TEST=test
5-
- EMACS_BINARY=emacs-24.4-travis MAKE_TEST=test-bytecomp
6-
- EMACS_BINARY=emacs-24.5-travis MAKE_TEST=test
7-
- EMACS_BINARY=emacs-24.5-travis MAKE_TEST=test-bytecomp
8-
- EMACS_BINARY=emacs-25.1-travis MAKE_TEST=test
9-
- EMACS_BINARY=emacs-25.1-travis MAKE_TEST=test-bytecomp
10-
- EMACS_BINARY=emacs-25.2-travis MAKE_TEST=test
11-
- EMACS_BINARY=emacs-25.2-travis MAKE_TEST=test-bytecomp
12-
- EMACS_BINARY=emacs-25.2-travis MAKE_TEST=test-checks
13-
- EMACS_BINARY=emacs-git-snapshot-travis MAKE_TEST=test
14-
- EMACS_BINARY=emacs-git-snapshot-travis MAKE_TEST=test-bytecomp
15-
- EMACS_BINARY=emacs-git-snapshot-travis MAKE_TEST=test-checks
22+
global:
23+
- PATH=$HOME/local/bin:$PATH
24+
matrix:
25+
- EMACS_BINARY=emacs-24.4-travis MAKE_TEST=test
26+
- EMACS_BINARY=emacs-24.4-travis MAKE_TEST=test-bytecomp
27+
- EMACS_BINARY=emacs-24.5-travis MAKE_TEST=test
28+
- EMACS_BINARY=emacs-24.5-travis MAKE_TEST=test-bytecomp
29+
- EMACS_BINARY=emacs-25.1-travis MAKE_TEST=test
30+
- EMACS_BINARY=emacs-25.1-travis MAKE_TEST=test-bytecomp
31+
- EMACS_BINARY=emacs-25.2-travis MAKE_TEST=test
32+
- EMACS_BINARY=emacs-25.2-travis MAKE_TEST=test-bytecomp
33+
- EMACS_BINARY=emacs-25.3-travis MAKE_TEST=test
34+
- EMACS_BINARY=emacs-25.3-travis MAKE_TEST=test-bytecomp
35+
- EMACS_BINARY=emacs-25.3-travis MAKE_TEST=test-checks
36+
- EMACS_BINARY=emacs-26-pretest-travis MAKE_TEST=test
37+
- EMACS_BINARY=emacs-26-pretest-travis MAKE_TEST=test-bytecomp
38+
- EMACS_BINARY=emacs-26-pretest-travis MAKE_TEST=test-checks
39+
- EMACS_BINARY=emacs-git-snapshot-travis MAKE_TEST=test
40+
- EMACS_BINARY=emacs-git-snapshot-travis MAKE_TEST=test-bytecomp
41+
- EMACS_BINARY=emacs-git-snapshot-travis MAKE_TEST=test-checks
1642

1743
before_script:
44+
- sudo sh travis-ci/travis-gnutls.sh
45+
- gnutls-cli -v
1846
- curl -fsSkL https://gist.github.com/rejeep/ebcd57c3af83b049833b/raw > x.sh && source ./x.sh
1947
- evm install $EMACS_BINARY --use --skip
2048
- make elpa
2149
script:
2250
- emacs --version
2351
- make $MAKE_TEST
24-
matrix:
25-
- env: EMACS_BINARY=emacs-git-snapshot-travis
2652

2753
notifications:
2854
webhooks:

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
* [#2088](https://github.com/clojure-emacs/cider/issues/2088): Fix functions defined with `def` being font-locked as vars instead of functions.
2121
* [#1651](https://github.com/clojure-emacs/cider/issues/1651), [cider-nrepl#445](https://github.com/clojure-emacs/cider-nrepl/pull/455): Fix `cider-expected-ns` returns `nil` on boot projects.
22+
* [#2120](https://github.com/clojure-emacs/cider/issues/2120): Fix Travis CI build errors for emacs versions >25.2.
2223

2324
## 0.15.1 (2017-09-13)
2425

travis-ci/travis-gnutls.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
3+
# Setup a newer gnutls-cli on Travis CI
4+
# We need this as long as the Travis workers are Ubuntu 14.04
5+
# and the TLS cert chain on elpa.gnu.org is out-of-order
6+
7+
set -x
8+
9+
# adjust these versions as needed
10+
export NETTLE_VERSION=3.4
11+
export GNUTLS_VERSION=3.5.16
12+
13+
export WORKDIR=${HOME}/local/
14+
export LD_LIBRARY_PATH=${WORKDIR}/lib/
15+
export PKG_CONFIG_PATH=${WORKDIR}/lib/pkgconfig/
16+
17+
# exit if the cache is valid and up-to-date
18+
if [ -f ${WORKDIR}/bin/gnutls-cli ] && \
19+
[ -f ${WORKDIR}/nettle-${NETTLE_VERSION}.tar.gz ] && \
20+
[ -f ${WORKDIR}/gnutls-${GNUTLS_VERSION}.tar.xz ]
21+
then
22+
exit 0
23+
fi
24+
25+
# delete cache and rebuild
26+
rm -rf $WORKDIR
27+
mkdir $WORKDIR
28+
cd $WORKDIR
29+
curl -O https://ftp.gnu.org/gnu/nettle/nettle-${NETTLE_VERSION}.tar.gz \
30+
&& tar xfz nettle-${NETTLE_VERSION}.tar.gz \
31+
&& cd nettle-${NETTLE_VERSION} \
32+
&& ./configure --prefix=${WORKDIR} \
33+
&& make -j4 install \
34+
&& make distclean
35+
36+
cd $WORKDIR
37+
curl -O https://www.gnupg.org/ftp/gcrypt/gnutls/v3.5/gnutls-${GNUTLS_VERSION}.tar.xz \
38+
&& xz -d -k gnutls-${GNUTLS_VERSION}.tar.xz \
39+
&& tar xf gnutls-${GNUTLS_VERSION}.tar \
40+
&& cd gnutls-${GNUTLS_VERSION} \
41+
&& ./configure --prefix=${WORKDIR} \
42+
--with-included-libtasn1 \
43+
--with-included-unistring \
44+
--without-p11-kit \
45+
&& make -j4 install \
46+
&& make distclean

0 commit comments

Comments
 (0)