From e89340c25845968ad3bff266af36a7d88641bbf1 Mon Sep 17 00:00:00 2001 From: Sam Brightman Date: Sat, 21 Sep 2019 18:08:25 +0100 Subject: [PATCH 1/6] Remove Emacs build dependencies, since we do not test source builds --- .travis.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index be1bbd1..3c1b1ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,11 +5,6 @@ before_install: - sudo mkdir /usr/local/evm - sudo chown travis:travis /usr/local/evm - - sudo add-apt-repository -y ppa:cassou/emacs - - sudo apt-get update -qq - - sudo apt-get build-dep -qq emacs23 - - sudo apt-get build-dep -qq emacs24 - - bin/evm config path /tmp - bin/evm install $EVM_EMACS - bin/evm use $EVM_EMACS From 53c0f55ac632fb528895f584488d7775f3fb4822 Mon Sep 17 00:00:00 2001 From: Sam Brightman Date: Sun, 22 Sep 2019 11:55:43 +0100 Subject: [PATCH 2/6] Allow releases per-distribution, add Xenial Dockerfile --- docker/build-emacs.sh | 4 ++-- docker/build-release.sh | 25 ++++++++++++-------- Dockerfile => docker/linux-trusty.Dockerfile | 2 +- docker/linux-xenial.Dockerfile | 21 ++++++++++++++++ 4 files changed, 39 insertions(+), 13 deletions(-) rename Dockerfile => docker/linux-trusty.Dockerfile (91%) create mode 100644 docker/linux-xenial.Dockerfile diff --git a/docker/build-emacs.sh b/docker/build-emacs.sh index 02f7dd0..217f597 100755 --- a/docker/build-emacs.sh +++ b/docker/build-emacs.sh @@ -18,10 +18,10 @@ function build_emacs() { --without-x \ --without-all \ --with-gnutls \ - --prefix="/tmp/emacs-${VERSION}-travis" && \ + --prefix="/tmp/${RELEASE}" && \ make bootstrap && \ make install && \ - tar -C /tmp -czf "/tmp/emacs-${VERSION}-travis.tar.gz" "emacs-${VERSION}-travis" + tar -C /tmp -czf "/tmp/${RELEASE}.tar.gz" "${RELEASE}" } build_emacs diff --git a/docker/build-release.sh b/docker/build-release.sh index 5cac6b0..babb58d 100755 --- a/docker/build-release.sh +++ b/docker/build-release.sh @@ -4,11 +4,12 @@ set -o errexit set -o nounset function usage() { - echo "$(basename "$0") [OPTIONS] VERSION" + echo "$(basename "$0") [OPTIONS] VERSION DIST" echo echo "Build Emacs for execution in Travis CI." echo - echo " VERSION Emacs version to build" + echo " VERSION Emacs version to build (e.g. 26.3)" + echo " DIST Distribution to build from (e.g. linux-xenial)" echo echo "Options:" echo " -h Show help" @@ -32,9 +33,10 @@ function parse_args() { done shift $((OPTIND - 1)) - VERSION=${1:-} && shift - if [ -z "${VERSION}" ]; then - echo "VERSION is required!" + VERSION=${1:-} && shift || true + DIST=${1:-} && shift || true + if [ -z "${VERSION}" ] || [ -z "${DIST}" ]; then + echo "VERSION and DIST are required!" usage exit 2 fi @@ -42,18 +44,21 @@ function parse_args() { # see http://stackoverflow.com/questions/37544423/how-to-build-emacs-from-source-in-docker-hub-gap-between-bss-and-heap#37561793 function build_release() { - cd "$(dirname "$(dirname "${BASH_SOURCE[0]}")")" || exit 3 + local script_dir + script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" || exit 3 - local image="evm-travis-builder:latest" - local container="build-emacs-${VERSION}-travis" + local image="evm-travis-${DIST}-builder:latest" + local release="emacs-${VERSION}-travis-${DIST}" + local container="build-${release}" - docker build -t ${image} . + docker build -t ${image} -f "${script_dir}/${DIST}.Dockerfile" "${script_dir}" docker run \ --name "${container}" \ --env VERSION="${VERSION}" \ + --env RELEASE="${release}" \ --security-opt seccomp=unconfined \ ${image} - docker cp "${container}:/tmp/emacs-${VERSION}-travis.tar.gz" . + docker cp "${container}:/tmp/${release}.tar.gz" . ${KEEP_CONTAINER} || docker rm "${container}" } diff --git a/Dockerfile b/docker/linux-trusty.Dockerfile similarity index 91% rename from Dockerfile rename to docker/linux-trusty.Dockerfile index 8b99d44..49e2151 100644 --- a/Dockerfile +++ b/docker/linux-trusty.Dockerfile @@ -16,5 +16,5 @@ RUN apt-get update -y \ USER travis WORKDIR /home/travis -COPY docker/build-emacs.sh /home/travis/ +COPY build-emacs.sh /home/travis/ CMD ["./build-emacs.sh"] diff --git a/docker/linux-xenial.Dockerfile b/docker/linux-xenial.Dockerfile new file mode 100644 index 0000000..4557308 --- /dev/null +++ b/docker/linux-xenial.Dockerfile @@ -0,0 +1,21 @@ +FROM travisci/ci-sardonyx:packer-1564753982-0c06deb6 + +# hadolint ignore=DL3008 +RUN apt-get update -y \ + && apt-get install --no-install-recommends -y \ + autoconf \ + autogen \ + automake \ + build-essential \ + git \ + libgnutls-dev \ + libncurses-dev \ + libtool \ + texinfo \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +USER travis +WORKDIR /home/travis +COPY build-emacs.sh /home/travis/ +CMD ["./build-emacs.sh"] From c05465733afa59d492ed07a3646f601dc1d799ef Mon Sep 17 00:00:00 2001 From: Sam Brightman Date: Sun, 22 Sep 2019 12:32:55 +0100 Subject: [PATCH 3/6] Add Xenial recipes --- recipes/emacs-26.1-travis-linux-xenial.rb | 7 +++++++ recipes/emacs-26.2-travis-linux-xenial.rb | 7 +++++++ recipes/emacs-26.3-travis-linux-xenial.rb | 7 +++++++ 3 files changed, 21 insertions(+) create mode 100644 recipes/emacs-26.1-travis-linux-xenial.rb create mode 100644 recipes/emacs-26.2-travis-linux-xenial.rb create mode 100644 recipes/emacs-26.3-travis-linux-xenial.rb diff --git a/recipes/emacs-26.1-travis-linux-xenial.rb b/recipes/emacs-26.1-travis-linux-xenial.rb new file mode 100644 index 0000000..7fb3dfd --- /dev/null +++ b/recipes/emacs-26.1-travis-linux-xenial.rb @@ -0,0 +1,7 @@ +recipe 'emacs-26.1-travis-linux-xenial' do + tar_gz 'https://www.dropbox.com/s/w8skjn8dts24be6/emacs-26.1-travis-linux-xenial.tar.gz?dl=1' + + install do + copy build_path, installations_path + end +end diff --git a/recipes/emacs-26.2-travis-linux-xenial.rb b/recipes/emacs-26.2-travis-linux-xenial.rb new file mode 100644 index 0000000..0d8d2a4 --- /dev/null +++ b/recipes/emacs-26.2-travis-linux-xenial.rb @@ -0,0 +1,7 @@ +recipe 'emacs-26.2-travis-linux-xenial' do + tar_gz 'https://www.dropbox.com/s/vk3lhjy82462zlh/emacs-26.2-travis-linux-xenial.tar.gz?dl=1' + + install do + copy build_path, installations_path + end +end diff --git a/recipes/emacs-26.3-travis-linux-xenial.rb b/recipes/emacs-26.3-travis-linux-xenial.rb new file mode 100644 index 0000000..5bf3010 --- /dev/null +++ b/recipes/emacs-26.3-travis-linux-xenial.rb @@ -0,0 +1,7 @@ +recipe 'emacs-26.3-travis-linux-xenial' do + tar_gz 'https://www.dropbox.com/s/xd28wgjtlfvgrlj/emacs-26.3-travis-linux-xenial.tar.gz?dl=1' + + install do + copy build_path, installations_path + end +end From 22eb41172818e9b223f9246392dd9308fef43033 Mon Sep 17 00:00:00 2001 From: Sam Brightman Date: Sat, 21 Sep 2019 18:17:27 +0100 Subject: [PATCH 4/6] Add Xenial testing Travis seems to lack a way to express heterogeneous matrices, so we need to explicitly list every combination. --- .travis.yml | 94 ++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 75 insertions(+), 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3c1b1ea..bab17ac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,75 @@ -os: linux -dist: trusty language: ruby +matrix: + include: + - os: linux + dist: trusty + env: EVM_EMACS=emacs-24.1-travis + - os: linux + dist: trusty + env: EVM_EMACS=emacs-24.2-travis + - os: linux + dist: trusty + env: EVM_EMACS=emacs-24.3-travis + - os: linux + dist: trusty + env: EVM_EMACS=emacs-24.4-travis + - os: linux + dist: trusty + env: EVM_EMACS=emacs-24.5-travis + - os: linux + dist: trusty + env: EVM_EMACS=emacs-25.1-travis + - os: linux + dist: trusty + env: EVM_EMACS=emacs-25.2-travis + - os: linux + dist: trusty + env: EVM_EMACS=emacs-25.3-travis + - os: linux + dist: trusty + env: EVM_EMACS=emacs-26.1-travis + - os: linux + dist: trusty + env: EVM_EMACS=emacs-26.2-travis + - os: linux + dist: trusty + env: EVM_EMACS=emacs-26.3-travis + - os: linux + dist: trusty + env: EVM_EMACS=emacs-git-snapshot-travis + - os: linux + dist: xenial + env: EVM_EMACS=emacs-24.1-travis + - os: linux + dist: xenial + env: EVM_EMACS=emacs-24.2-travis + - os: linux + dist: xenial + env: EVM_EMACS=emacs-24.3-travis + - os: linux + dist: xenial + env: EVM_EMACS=emacs-24.4-travis + - os: linux + dist: xenial + env: EVM_EMACS=emacs-24.5-travis + - os: linux + dist: xenial + env: EVM_EMACS=emacs-25.1-travis + - os: linux + dist: xenial + env: EVM_EMACS=emacs-25.2-travis + - os: linux + dist: xenial + env: EVM_EMACS=emacs-25.3-travis + - os: linux + dist: xenial + env: EVM_EMACS=emacs-26.1-travis-linux-xenial + - os: linux + dist: xenial + env: EVM_EMACS=emacs-26.2-travis-linux-xenial + - os: linux + dist: xenial + env: EVM_EMACS=emacs-26.3-travis-linux-xenial before_install: - sudo mkdir /usr/local/evm - sudo chown travis:travis /usr/local/evm @@ -13,10 +82,10 @@ script: - bundle exec rspec spec - bin/emacs --version - bin/emacs -Q --batch --eval - '(unless (or (string= (getenv "EVM_EMACS") - (format "emacs-%d.%d-travis" - emacs-major-version - emacs-minor-version)) + '(unless (or (string-prefix-p (format "emacs-%d.%d-travis" + emacs-major-version + emacs-minor-version) + (getenv "EVM_EMACS")) (and (string= (getenv "EVM_EMACS") "emacs-git-snapshot-travis") (= emacs-major-version 27))) (kill-emacs 1))' @@ -26,16 +95,3 @@ rvm: - 2.5.5 - 2.6.3 - ruby-head -env: - - EVM_EMACS=emacs-24.1-travis - - EVM_EMACS=emacs-24.2-travis - - EVM_EMACS=emacs-24.3-travis - - EVM_EMACS=emacs-24.4-travis - - EVM_EMACS=emacs-24.5-travis - - EVM_EMACS=emacs-25.1-travis - - EVM_EMACS=emacs-25.2-travis - - EVM_EMACS=emacs-25.3-travis - - EVM_EMACS=emacs-26.1-travis - - EVM_EMACS=emacs-26.2-travis - - EVM_EMACS=emacs-26.3-travis - - EVM_EMACS=emacs-git-snapshot-travis From 104b9ba63dce9ff20084084388256361c02905da Mon Sep 17 00:00:00 2001 From: Sam Brightman Date: Sun, 22 Sep 2019 14:00:54 +0100 Subject: [PATCH 5/6] Only use default Ruby version We should aim to support older/newer versions but: * 2.3 and 2.4 are EOL and close to EOL respectively. * Travis' matrix specification currently requires duplicating a lot of entries. * The size of the matrix is growing more now with different OS testing. --- .travis.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index bab17ac..99ea499 100644 --- a/.travis.yml +++ b/.travis.yml @@ -89,9 +89,3 @@ script: (and (string= (getenv "EVM_EMACS") "emacs-git-snapshot-travis") (= emacs-major-version 27))) (kill-emacs 1))' -rvm: - - 2.3.8 - - 2.4.6 - - 2.5.5 - - 2.6.3 - - ruby-head From a824dd3c645532eff6dcd8ade4e3950d8950a9f8 Mon Sep 17 00:00:00 2001 From: Sam Brightman Date: Mon, 23 Sep 2019 21:03:30 +0100 Subject: [PATCH 6/6] Update URLs to point at official release --- recipes/emacs-26.1-travis-linux-xenial.rb | 2 +- recipes/emacs-26.2-travis-linux-xenial.rb | 2 +- recipes/emacs-26.3-travis-linux-xenial.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/emacs-26.1-travis-linux-xenial.rb b/recipes/emacs-26.1-travis-linux-xenial.rb index 7fb3dfd..1d78d96 100644 --- a/recipes/emacs-26.1-travis-linux-xenial.rb +++ b/recipes/emacs-26.1-travis-linux-xenial.rb @@ -1,5 +1,5 @@ recipe 'emacs-26.1-travis-linux-xenial' do - tar_gz 'https://www.dropbox.com/s/w8skjn8dts24be6/emacs-26.1-travis-linux-xenial.tar.gz?dl=1' + tar_gz 'https://github.com/rejeep/evm/releases/download/v0.18.0/emacs-26.1-travis.tar.gz' install do copy build_path, installations_path diff --git a/recipes/emacs-26.2-travis-linux-xenial.rb b/recipes/emacs-26.2-travis-linux-xenial.rb index 0d8d2a4..71fd176 100644 --- a/recipes/emacs-26.2-travis-linux-xenial.rb +++ b/recipes/emacs-26.2-travis-linux-xenial.rb @@ -1,5 +1,5 @@ recipe 'emacs-26.2-travis-linux-xenial' do - tar_gz 'https://www.dropbox.com/s/vk3lhjy82462zlh/emacs-26.2-travis-linux-xenial.tar.gz?dl=1' + tar_gz 'https://github.com/rejeep/evm/releases/download/v0.18.0/emacs-26.2-travis.tar.gz' install do copy build_path, installations_path diff --git a/recipes/emacs-26.3-travis-linux-xenial.rb b/recipes/emacs-26.3-travis-linux-xenial.rb index 5bf3010..5a100e5 100644 --- a/recipes/emacs-26.3-travis-linux-xenial.rb +++ b/recipes/emacs-26.3-travis-linux-xenial.rb @@ -1,5 +1,5 @@ recipe 'emacs-26.3-travis-linux-xenial' do - tar_gz 'https://www.dropbox.com/s/xd28wgjtlfvgrlj/emacs-26.3-travis-linux-xenial.tar.gz?dl=1' + tar_gz 'https://github.com/rejeep/evm/releases/download/v0.18.0/emacs-26.3-travis.tar.gz' install do copy build_path, installations_path