]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Docker: add Alpine to new docker setup (#606)
authorAlexander Lanin <alex@lanin.de>
Wed, 17 Jun 2020 06:26:28 +0000 (08:26 +0200)
committerGitHub <noreply@github.com>
Wed, 17 Jun 2020 06:26:28 +0000 (08:26 +0200)
buildenv/alpine-3.12/Dockerfile [new file with mode: 0644]
buildenv/alpine-3.4/Dockerfile [new file with mode: 0644]
buildenv/alpine/Dockerfile [deleted file]
cmake/StandardWarnings.cmake
test-all-systems.sh

diff --git a/buildenv/alpine-3.12/Dockerfile b/buildenv/alpine-3.12/Dockerfile
new file mode 100644 (file)
index 0000000..b90d7c2
--- /dev/null
@@ -0,0 +1,18 @@
+FROM alpine:3.12
+
+RUN apk add --no-cache \
+                asciidoc \
+                bash \
+                ccache \
+                clang \
+                cmake \
+                elfutils \
+                g++ \
+                gcc \
+                libc-dev \
+                make \
+                perl \
+                zstd-dev
+
+# redirect all compilers to ccache
+RUN for t in gcc g++ cc c++ clang clang++; do ln -vs /usr/bin/ccache /usr/local/bin/$t;  done
diff --git a/buildenv/alpine-3.4/Dockerfile b/buildenv/alpine-3.4/Dockerfile
new file mode 100644 (file)
index 0000000..8c5d0ab
--- /dev/null
@@ -0,0 +1,22 @@
+# Released 2016, this is the first release to contain cmake >= 3.4.3
+
+# Note: While alpine 3.4 runs fine, cmake 3.8.1 reports skipped tests as failures while cmake 3.9.5 reports them as skipped.
+# So alpine 3.7 is the first version to report exit code 0. Maybe install new cmake manually here?
+
+FROM alpine:3.4
+
+RUN apk add --no-cache \
+                asciidoc \
+                bash \
+                ccache \
+                # clang \
+                cmake \
+                # elfutils \ (available since Alpine 3.7)
+                g++ \
+                gcc \
+                libc-dev \
+                make \
+                perl
+
+# redirect all compilers to ccache
+RUN for t in gcc g++ cc c++ clang clang++; do ln -vs /usr/bin/ccache /usr/local/bin/$t;  done
diff --git a/buildenv/alpine/Dockerfile b/buildenv/alpine/Dockerfile
deleted file mode 100644 (file)
index 66f8a44..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-FROM alpine:latest
-
-RUN apk add --no-cache \
-                gcc libc-dev \
-                make \
-                bash \
-                build-essential \
-                cmake \
-                asciidoc \
-                autoconf \
-                zstd-dev \
-        ##
index 643164867712d0c39c469ee7d865328db8bd4f67..0edf577969cf411ba3d039aab39d52287209f35c 100644 (file)
@@ -75,10 +75,8 @@ if(WARNINGS_AS_ERRORS)
 endif()
 
 if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
-  # Exact version or reason unknown, discovered in Ubuntu 14 docker test with clang 3.4
   if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.0)
-    # reserved-id-macro issued by clang 3.6 - 3.9 for libb2 blake2.h
-    set(CLANG_GCC_WARNINGS ${CLANG_GCC_WARNINGS}  -Qunused-arguments -Wno-error=unreachable-code -Wno-error=reserved-id-macro)
+    set(CLANG_GCC_WARNINGS ${CLANG_GCC_WARNINGS}  -Qunused-arguments -Wno-error=unreachable-code)
   endif()
 
   target_compile_options(
@@ -91,6 +89,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
               -Wno-conversion
               -Wno-disabled-macro-expansion
               -Wno-documentation-unknown-command
+              -Wno-error=reserved-id-macro # libb2 blake2.h
               -Wno-exit-time-destructors
               -Wno-format-nonliteral
               -Wno-global-constructors
index 45f234431807cf2ae86c82338db31cde7ecad47b..7137d3fa24021c57ef1659bbb9d68e595f06f67e 100755 (executable)
@@ -6,26 +6,46 @@
 # Runtime is roughly 1 minute per line (depending on system).
 # First run takes about 1 additional minute per docker image (depending on internet connection).
 
-# TODO: store docker images in (public) repository.
-# TODO: use ccache within docker and preserve the cache.
-#       That would make this script really fast and usable for small iterations!
+# 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.
+# * improve detection of failures so this script can be executed as a whole (see Note in alpine 3.4 Dockerfile).
 
 echo "Warning: Docker support is rather experimental\n"
 
-#CC=gcc   CXX=g++     ./docker.sh debian-9-stretch
-#CC=clang CXX=clang++ ./docker.sh debian-9-stretch
 
-CC=gcc   CXX=g++     ./docker.sh debian-10-buster
-CC=clang CXX=clang++ ./docker.sh debian-10-buster
+# Debian
+
+  # See https://github.com/ccache/ccache/issues/602
+  #CC=gcc   CXX=g++     ./docker.sh debian-9-stretch
+  #CC=clang CXX=clang++ ./docker.sh debian-9-stretch
+
+  CC=gcc   CXX=g++     ./docker.sh debian-10-buster
+  CC=clang CXX=clang++ ./docker.sh debian-10-buster
+
+
+# Ubuntu (ancient, old and latest)
+
+  # zstd and libb2 not available for Ubuntu 14.
+  CC=gcc   CXX=g++     CMAKE_PARAMS="-DUSE_LIBZSTD_FROM_INTERNET=ON -DUSE_LIBB2_FROM_INTERNET=ON" ./docker.sh ubuntu-14-trusty
+
+  # See https://github.com/ccache/ccache/issues/601
+  #CC=clang CXX=clang++ CMAKE_PARAMS="-DUSE_LIBZSTD_FROM_INTERNET=ON -DUSE_LIBB2_FROM_INTERNET=ON" ./docker.sh ubuntu-14-tusty
+
+  CC=gcc   CXX=g++     ./docker.sh ubuntu-16-xenial
+  CC=clang CXX=clang++ ./docker.sh ubuntu-16-xenial
 
-# zstd and libb2 not available for Ubuntu 14.
-CC=gcc   CXX=g++     CMAKE_PARAMS="-DUSE_LIBZSTD_FROM_INTERNET=ON -DUSE_LIBB2_FROM_INTERNET=ON" ./docker.sh ubuntu-14-trusty
+  CC=gcc   CXX=g++     CMAKE_PARAMS="-DUSE_LIBZSTD_FROM_INTERNET=ON" ./docker.sh ubuntu-20-focal
+  CC=clang CXX=clang++ CMAKE_PARAMS="-DUSE_LIBZSTD_FROM_INTERNET=ON" ./docker.sh ubuntu-20-focal
 
-# See https://github.com/ccache/ccache/issues/601
-#CC=clang CXX=clang++ CMAKE_PARAMS="-DUSE_LIBZSTD_FROM_INTERNET=ON -DUSE_LIBB2_FROM_INTERNET=ON" ./docker.sh ubuntu-14-tusty
 
-CC=gcc   CXX=g++     ./docker.sh ubuntu-16-xenial
-CC=clang CXX=clang++ ./docker.sh ubuntu-16-xenial
+# Alpine (old and latest)
 
-CC=gcc   CXX=g++     CMAKE_PARAMS="-DUSE_LIBZSTD_FROM_INTERNET=ON" ./docker.sh ubuntu-20-focal
-CC=clang CXX=clang++ CMAKE_PARAMS="-DUSE_LIBZSTD_FROM_INTERNET=ON" ./docker.sh ubuntu-20-focal
+  CC=gcc   CXX=g++     CMAKE_PARAMS="-DUSE_LIBZSTD_FROM_INTERNET=ON -DUSE_LIBB2_FROM_INTERNET=ON" ./docker.sh 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="-DUSE_LIBZSTD_FROM_INTERNET=ON -DUSE_LIBB2_FROM_INTERNET=ON" ./docker.sh alpine-3.4
+  CC=clang CXX=clang++ CMAKE_PARAMS="-DUSE_LIBZSTD_FROM_INTERNET=ON -DUSE_LIBB2_FROM_INTERNET=ON" ./docker.sh alpine-3.12
+  CC=gcc   CXX=g++     CMAKE_PARAMS="-DUSE_LIBB2_FROM_INTERNET=ON" ./docker.sh alpine-3.12
+  CC=clang CXX=clang++ CMAKE_PARAMS="-DUSE_LIBB2_FROM_INTERNET=ON" ./docker.sh alpine-3.12