-#!/bin/sh -ex
-# This script is used by .travis.yml and build-in-docker
+#!/bin/sh
+#
+# This script is used by .travis.yml and build-in-docker.
-if [ -n "${SPECIAL}" ]; then
- sh ci/${SPECIAL}
+set -eu
+
+if [ -n "${VERBOSE:-}" ]; then
+ set -x
+fi
+
+if [ -n "${SPECIAL:-}" ]; then
+ exec "ci/$SPECIAL"
else
- mkdir -p ${BUILDDIR:-build}
- cd ${BUILDDIR:-build}
- ${CMAKE_PREFIX:-} cmake ${CCACHE_LOC:-..} ${CMAKE_PARAMS:-}
- # 4 threads seems a reasonable default for Travis
- ${CMAKE_PREFIX:-} cmake --build . ${BUILDEXTRAFLAGS:-} -- -j4
- # Warning: Rare random failures when running with j4.
- test "${RUN_TESTS:-1}" -eq "1" && ctest --output-on-failure -j1
+ mkdir -p ${BUILDDIR:-build}
+ cd ${BUILDDIR:-build}
+ ${CMAKE_PREFIX:-} cmake "${CCACHE_LOC:-..}" ${CMAKE_PARAMS:-}
+ # 4 jobs seem to be a reasonable default for Travis.
+ ${CMAKE_PREFIX:-} cmake --build . ${BUILDEXTRAFLAGS:-} -- -j4
+ # Warning: Rare random failures when running with -j4.
+ [ "${RUN_TESTS:-1}" -ne "1" ] || ctest --output-on-failure -j1
fi
-exit 0
-#!/bin/sh -ex
+#!/bin/sh
-echo "Warning: Binary package support is rather experimental\n"
+set -eu
+rm -rf build_package_dir_test
mkdir -p build_package_dir_test
cd build_package_dir_test
-rm -rf *
cmake ..
cmake --build . --target package
# get out of git directory just to be sure
tmp_dir=$(mktemp -d)
+trap "rm -rf $tmp_dir" EXIT
tar -xzf ccache-binary.tar.gz -C $tmp_dir
CCACHE=$tmp_dir/ccache-binary/bin/ccache ../test/run
-rm -rf $tmp_dir
-
-echo "\n\nbinary package is fine and can be used!\n\n"
+echo "Binary package is fine and can be used."
-#!/bin/sh -ex
+#!/bin/sh
-echo "Warning: Source package support is rather experimental\n"
+set -eu
+rm -rf build_package_source_dir_test
mkdir -p build_package_source_dir_test
cd build_package_source_dir_test
-rm -rf *
cmake ..
cmake --build . --target package_source
# get out of git directory
# Unfortunately this random name will prevent ccache from caching results...
-# ToDo: use '../../temp' instead?
+# TODO: use '../../temp' instead?
tmp_dir=$(mktemp -d)
+trap "rm -rf $tmp_dir" EXIT
-tar -xzf ccache-src.tar.gz -C $tmp_dir
-cd $tmp_dir
+tar -xf ccache-src.tar.gz -C $tmp_dir
+cd $tmp_dir/ccache-src
cmake .
cmake --build . -- -j4
ctest --output-on-failure -j4
-rm -rf $tmp_dir
-
-echo "\n\nsource package is fine and can be used!\n\n"
+echo "Source package is fine and can be used."
#!/bin/bash
-
-# This script runs ci/build in a Docker container.
-#
-# Usage:
-#
-# build-in-docker NAME [ARGUMENTS]
#
-# NAME: Sudirectory name in the dockerfiles directory.
-# ARGUMENTS: Arguments that will be passed to ci/build.
+# This script runs ci/build in a Docker container.
+
+if [ $# -eq 0 ] || [ ${1:-} = -h ] || [ ${1:-} = --help ]; then
+ cat <<EOF
+Usage: build-in-docker NAME [ARGUMENTS]
+
+NAME: Subdirectory name in the dockerfiles directory.
+ARGUMENTS: Arguments that will be passed to ci/build.
+EOF
+ exit 1
+fi
set -eu
+if [ -n "${VERBOSE:-}" ]; then
+ set -x
+fi
+
name=${1}
shift
mkdir -p build-in-docker/docker-ccache
docker run --rm \
- --volume "$PWD:/source" \
- --volume "$PWD/build-in-docker/docker-ccache:/ccache" \
- --tmpfs /builddir:rw,exec \
- --workdir /builddir \
- --env CC="${CC:-}" \
- --env CFLAGS="${CFLAGS:-}" \
- --env CXX="${CXX:-}" \
- --env CXXFLAGS="${CXXFLAGS:-}" \
- --env LDFLAGS="${LDFLAGS:-}" \
- --env ASAN_OPTIONS="${ASAN_OPTIONS:-}" \
- --env CCACHE_LOC="/source" \
- --env SPECIAL="${SPECIAL:-}" \
- --env SCAN_BUILD="${SCAN_BUILD:-}" \
- --env CMAKE_PARAMS="${CMAKE_PARAMS:-}" \
- --env BUILDEXTRAFLAGS="${BUILDEXTRAFLAGS:-}" \
- --env NO_TEST="${NO_TEST:-}" \
- --env CCACHE_DIR=/ccache \
- "$tag" \
- /source/ci/build "$@"
+ --volume "$PWD:/source" \
+ --volume "$PWD/build-in-docker/docker-ccache:/ccache" \
+ --tmpfs /builddir:rw,exec \
+ --workdir /builddir \
+ --env CC="${CC:-}" \
+ --env CFLAGS="${CFLAGS:-}" \
+ --env CXX="${CXX:-}" \
+ --env CXXFLAGS="${CXXFLAGS:-}" \
+ --env LDFLAGS="${LDFLAGS:-}" \
+ --env ASAN_OPTIONS="${ASAN_OPTIONS:-}" \
+ --env CCACHE_LOC="/source" \
+ --env SPECIAL="${SPECIAL:-}" \
+ --env SCAN_BUILD="${SCAN_BUILD:-}" \
+ --env CMAKE_PARAMS="${CMAKE_PARAMS:-}" \
+ --env BUILDEXTRAFLAGS="${BUILDEXTRAFLAGS:-}" \
+ --env NO_TEST="${NO_TEST:-}" \
+ --env CCACHE_DIR=/ccache \
+ "$tag" \
+ /source/ci/build "$@"
-#!/bin/sh -ex
+#!/bin/sh
-# While it's obviously quite impossible to support and test every single distribution,
-# this script enables easy checking of the most common standard distributions at least.
+set -eu
-# Runtime is roughly 1 minute per line (depending on system).
-# First run takes about 1 additional minute per docker image (depending on internet connection).
+# While it's obviously quite impossible to support and test every single
+# distribution, this script enables easy checking of the most common standard
+# distributions at least.
-# Note: Currently this is more a reference on how to run each instance,
-# instead of running this entire script at once. See next steps.
+# Note: Currently this is more a reference on how to run each instance, instead
+# of running this entire script at once. See next steps.
# Next steps:
-# * run compilation, tests and/or docker instances in parallel to improve runtime.
-
-echo "Warning: Docker support is rather experimental\n"
+# * Run compilation, tests and/or docker instances in parallel to improve
+# runtime.
build_in_docker=$(dirname $0)/build-in-docker
+# -------------------------------------------------------------------------------
# Debian
- # See https://github.com/ccache/ccache/issues/602
- #CC=gcc CXX=g++ $build_in_docker debian-9-stretch
- #CC=clang CXX=clang++ $build_in_docker debian-9-stretch
-
- CC=gcc CXX=g++ $build_in_docker debian-10-buster
- CC=clang CXX=clang++ $build_in_docker debian-10-buster
+# See https://github.com/ccache/ccache/issues/602
+#CC=gcc CXX=g++ $build_in_docker debian-9-stretch
+#CC=clang CXX=clang++ $build_in_docker debian-9-stretch
+CC=gcc CXX=g++ $build_in_docker debian-10-buster
+CC=clang CXX=clang++ $build_in_docker debian-10-buster
+# -------------------------------------------------------------------------------
# Ubuntu (ancient, old and latest)
- # zstd not available for Ubuntu 14.
- CC=gcc CXX=g++ CMAKE_PARAMS="-DZSTD_FROM_INTERNET=ON" $build_in_docker ubuntu-14-trusty
-
- # See https://github.com/ccache/ccache/issues/601
- #CC=clang CXX=clang++ CMAKE_PARAMS="-DZSTD_FROM_INTERNET=ON" $build_in_docker ubuntu-14-tusty
+# zstd not available for Ubuntu 14.
+CC=gcc CXX=g++ CMAKE_PARAMS="-DZSTD_FROM_INTERNET=ON" $build_in_docker ubuntu-14-trusty
- CC=gcc CXX=g++ $build_in_docker ubuntu-16-xenial
- CC=clang CXX=clang++ $build_in_docker ubuntu-16-xenial
+# See https://github.com/ccache/ccache/issues/601
+#CC=clang CXX=clang++ CMAKE_PARAMS="-DZSTD_FROM_INTERNET=ON" $build_in_docker ubuntu-14-tusty
- CC=gcc CXX=g++ CMAKE_PARAMS="-DZSTD_FROM_INTERNET=ON" $build_in_docker ubuntu-20-focal
- CC=clang CXX=clang++ CMAKE_PARAMS="-DZSTD_FROM_INTERNET=ON" $build_in_docker ubuntu-20-focal
+CC=gcc CXX=g++ $build_in_docker ubuntu-16-xenial
+CC=clang CXX=clang++ $build_in_docker ubuntu-16-xenial
+CC=gcc CXX=g++ CMAKE_PARAMS="-DZSTD_FROM_INTERNET=ON" $build_in_docker ubuntu-20-focal
+CC=clang CXX=clang++ CMAKE_PARAMS="-DZSTD_FROM_INTERNET=ON" $build_in_docker ubuntu-20-focal
+# -------------------------------------------------------------------------------
# Alpine (old and latest)
- CC=gcc CXX=g++ CMAKE_PARAMS="-DZSTD_FROM_INTERNET=ON" $build_in_docker alpine-3.4
- # Clang is not capable to compile libzstd from internet before alpine 3.12 (Some SSE2 error regarding missing file emmintrin.h)
- #CC=clang CXX=clang++ CMAKE_PARAMS="-DZSTD_FROM_INTERNET=ON" $build_in_docker alpine-3.4
- CC=clang CXX=clang++ CMAKE_PARAMS="-DZSTD_FROM_INTERNET=ON" $build_in_docker alpine-3.12
- CC=gcc CXX=g++ $build_in_docker alpine-3.12
- CC=clang CXX=clang++ $build_in_docker alpine-3.12
+CC=gcc CXX=g++ CMAKE_PARAMS="-DZSTD_FROM_INTERNET=ON" $build_in_docker alpine-3.4
+# Clang is not capable to compile libzstd from internet before alpine 3.12 (some
+# SSE2 error regarding missing file emmintrin.h)
+#CC=clang CXX=clang++ CMAKE_PARAMS="-DZSTD_FROM_INTERNET=ON" $build_in_docker alpine-3.4
+CC=clang CXX=clang++ CMAKE_PARAMS="-DZSTD_FROM_INTERNET=ON" $build_in_docker alpine-3.12
+CC=gcc CXX=g++ $build_in_docker alpine-3.12
+CC=clang CXX=clang++ $build_in_docker alpine-3.12