]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Diverse CMake preparations (#580)
authorAlexander Lanin <alex@lanin.de>
Tue, 21 Apr 2020 18:41:48 +0000 (20:41 +0200)
committerGitHub <noreply@github.com>
Tue, 21 Apr 2020 18:41:48 +0000 (20:41 +0200)
* Prepare gitignore for builds in subdirectory
* Ignore to be generated Version.cpp
* Move travis to buildenv as it's just another image
* Move install_cuda out of .travis as it's not travis specific
* Prepare docker images for C++ and CMake
* Update authors + add script to do so
* Fix required C compiler
* Fix some formatting issues with clang-format 10

17 files changed:
.gitignore
.travis.yml
buildenv/alpine/Dockerfile
buildenv/centos/Dockerfile
buildenv/debian-10-buster/Dockerfile [new file with mode: 0644]
buildenv/debian-9-stretch/Dockerfile [new file with mode: 0644]
buildenv/debian/Dockerfile [deleted file]
buildenv/fedora/Dockerfile
buildenv/travis/Dockerfile [moved from .travis/Dockerfile with 96% similarity]
buildenv/ubuntu-16-xenial/Dockerfile [new file with mode: 0644]
buildenv/ubuntu/Dockerfile [deleted file]
doc/AUTHORS.adoc
doc/INSTALL.md
misc/install_cuda.sh [moved from .travis/install_cuda.sh with 88% similarity]
misc/update_authors.sh [new file with mode: 0755]
src/Args.cpp
src/Args.hpp

index cbdb960e4ca6ce03cb9394a7d2b83096d72f84d5..e2cc6e565b14bcad6ed0ce8b8990a40345718c6b 100644 (file)
@@ -30,8 +30,16 @@ testdir.*
 unittest/run
 zstd-*.tar.gz
 
+# Version is generated into src, because it should be included into src packages
+/src/Version.cpp
+
+# Typical build directories
+/build/
+/build-*
+/build_*
+
 # Visual Studio
-.vs/
+/.vs/
 
 # Visual Studio Code
-.vscode/
+/.vscode/
index da96534e35c80c9cc446068d0ca8bd6a946ea73e..e9f7e7aa1aca3fc998bc3466db5a78597e6843fb 100644 (file)
@@ -55,7 +55,7 @@ matrix:
         - libzstd1-dev
         - libb2-dev
     before_install:
-    - source ./.travis/install_cuda.sh
+    - source ./misc/install_cuda.sh
 
   # Job 5: Build on Linux with 32-bit MinGW cross-compiler
   - os: linux
index 2aa21fb02641271af5d313e135e023afe35af6f9..66f8a4446678787ecef75b0173faaf967eaa9836 100644 (file)
@@ -4,6 +4,8 @@ RUN apk add --no-cache \
                 gcc libc-dev \
                 make \
                 bash \
+                build-essential \
+                cmake \
                 asciidoc \
                 autoconf \
                 zstd-dev \
index 1bb01ff74687f67e6f890598cdff11c77615e030..66e06946883253f6a305d15610c5a4150d3c3eb8 100644 (file)
@@ -6,6 +6,8 @@ RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.n
                 gcc \
                 make \
                 bash \
+                build-essential \
+                cmake \
                 asciidoc \
                 autoconf \
                 libzstd-devel \
diff --git a/buildenv/debian-10-buster/Dockerfile b/buildenv/debian-10-buster/Dockerfile
new file mode 100644 (file)
index 0000000..ed10826
--- /dev/null
@@ -0,0 +1,14 @@
+FROM debian:10
+
+RUN apt-get update && apt-get install -y --no-install-recommends \
+                asciidoc \
+                bash \
+                build-essential \
+                clang \
+                cmake \
+                elfutils \
+                gcc-multilib \
+                libb2-dev \
+                libzstd-dev \
+                xsltproc \
+        && rm -rf /var/lib/apt/lists/*
diff --git a/buildenv/debian-9-stretch/Dockerfile b/buildenv/debian-9-stretch/Dockerfile
new file mode 100644 (file)
index 0000000..4cbb043
--- /dev/null
@@ -0,0 +1,14 @@
+FROM debian:9
+
+RUN apt-get update && apt-get install -y --no-install-recommends \
+                asciidoc \
+                bash \
+                build-essential \
+                clang \
+                cmake \
+                elfutils \
+                gcc-multilib \
+                libb2-dev \
+                libzstd-dev \
+                xsltproc \
+        && rm -rf /var/lib/apt/lists/*
diff --git a/buildenv/debian/Dockerfile b/buildenv/debian/Dockerfile
deleted file mode 100644 (file)
index 28725f8..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-FROM debian:latest
-
-RUN apt-get update && apt-get install -y --no-install-recommends \
-                gcc-multilib \
-                make \
-                bash \
-                asciidoc xsltproc docbook-xml docbook-xsl \
-                autoconf \
-                libzstd-dev \
-        && rm -rf /var/lib/apt/lists/*
index e969b13c8050683c6b4cf44c500253b30cb5f410..037fb6a7c75c59ed1cf7532fed94211dcdefd3f2 100644 (file)
@@ -7,6 +7,8 @@ RUN dnf install -y \
                 bash \
                 asciidoc \
                 autoconf \
+                build-essential \
+                cmake \
                 libzstd-devel \
         && rpm -e --nodeps graphviz \
         && dnf autoremove -y \
similarity index 96%
rename from .travis/Dockerfile
rename to buildenv/travis/Dockerfile
index 118aed5f9ecfd5a27426100443e4bf21ee2dbe24..b71ce4ce37cf381daab5b6d1358c00860eb0c098 100644 (file)
@@ -12,7 +12,9 @@ ENTRYPOINT ["/usr/bin/dumb-init", "--"]
 RUN apt-get -qq update && apt-get install -y --no-install-recommends \
                 libc6-dev \
                 gcc \
+                build-essential \
                 clang \
+                cmake \
                 libc6-dev-i386 \
                 gcc-multilib \
                 gcc-mingw-w64 \
diff --git a/buildenv/ubuntu-16-xenial/Dockerfile b/buildenv/ubuntu-16-xenial/Dockerfile
new file mode 100644 (file)
index 0000000..1a3f5f0
--- /dev/null
@@ -0,0 +1,14 @@
+FROM ubuntu:xenial
+
+RUN apt-get update && apt-get install -y --no-install-recommends \
+                asciidoc \
+                bash \
+                build-essential \
+                clang \
+                cmake \
+                elfutils \
+                gcc-multilib \
+                libb2-dev \
+                libzstd1-dev \
+                xsltproc \
+        && rm -rf /var/lib/apt/lists/*
diff --git a/buildenv/ubuntu/Dockerfile b/buildenv/ubuntu/Dockerfile
deleted file mode 100644 (file)
index 27c7863..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-FROM ubuntu:latest
-
-RUN apt-get update && apt-get install -y --no-install-recommends \
-                gcc-multilib \
-                make \
-                bash \
-                asciidoc xsltproc docbook-xml docbook-xsl \
-                autoconf \
-                libzstd-dev \
-        && rm -rf /var/lib/apt/lists/*
index 1f1d4e2bcb020d3cacd59b21f77e26819fe0026f..a7b993de1df69fb7b47d6639bda11dd511bf0778 100644 (file)
@@ -7,6 +7,7 @@ maintained by Joel Rosdahl.
 ccache is a collective work with contributions from many people, including:
 
 * Alexander Korsunsky
+* Alexander Lanin
 * Alexey Tourbin
 * Alfred Landrum
 * Anders F Björklund
@@ -18,6 +19,7 @@ ccache is a collective work with contributions from many people, including:
 * Andrew Tridgell
 * Bernhard Bauer
 * Björn Jacke
+* Breno Guimaraes
 * Chiaki Ishikawa
 * Chris AtLee
 * Clemens Rabe
@@ -25,14 +27,17 @@ ccache is a collective work with contributions from many people, including:
 * David Givone
 * Doug Anderson
 * Edward Z. Yang
+* Enrico Sorichetti
 * Erik Johansson
 * Francois Marier
 * Gabriel Scherer
 * Geert Bosch
 * Geert Kloosterman
 * Grigory Entin
+* Harsh Shandilya
 * Havard Graff
 * Hongli Lai
+* Igor Pylypiv
 * Ivan Vaigult
 * Ivan Volnov
 * Jiang Jiang
@@ -85,16 +90,15 @@ ccache is a collective work with contributions from many people, including:
 * Per Nordlöw
 * Peter Budai
 * Philippe Proulx
+* Philipp Storz
 * Rafael Kitover
 * Ramiro Polla
 * Robert Yang
 * Robin H. Johnson
 * Rolf Bjarne Kvinge
-* Russell King
 * RW
 * Ryan Brown
 * Sam Gross
-* Steffen Dettmer
 * Thomas Otto
 * Thomas Röfer
 * Timofei Kushnir
index 70afb9f9dd2d0fdb65e1282610c1ddc9aae3bbba..6599645f76240f6177cd3890907180b3510f0b68 100644 (file)
@@ -7,7 +7,7 @@ Prerequisites
 To build ccache from a source repository, you need:
 
 - A C++11 compiler.
-- A C89 compiler.
+- A C99 compiler.
 - GNU Bourne Again SHell (bash) for tests.
 - [AsciiDoc](https://www.methods.co.nz/asciidoc/) to build the HTML
   documentation.
similarity index 88%
rename from .travis/install_cuda.sh
rename to misc/install_cuda.sh
index 6b774c7b7b7aee839688a438b99e3baa85e34f4d..1339d23837cc4fc097afbdfc6bfbf6fe597cb384 100644 (file)
@@ -10,6 +10,7 @@ if [ -n "$CUDA" ]; then
     echo "Installing CUDA support"
     travis_retry wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_${CUDA}_amd64.deb
     travis_retry sudo dpkg -i cuda-repo-ubuntu1604_${CUDA}_amd64.deb
+    # sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
     travis_retry sudo apt-get update -qq
     export CUDA_APT=${CUDA:0:4}
     export CUDA_APT=${CUDA_APT/./-}
diff --git a/misc/update_authors.sh b/misc/update_authors.sh
new file mode 100755 (executable)
index 0000000..3c0e3ab
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh -ex
+
+if [ -d .git ]; then
+  echo "Updating authors...\n"
+
+  # Full git history is needed for this to work
+  # (hide stderr and return code since this fails in case full history is already available)
+  git fetch --unshallow 2> /dev/null || true
+
+  # collect "Co-authored-by" and Authors and update doc/AUTHORS.adoc
+  { git log --pretty=format:"%(trailers)" | grep -Po "(?<=Co-authored-by: )(.*)(?= <)"; git log --format="%aN"; } | sed -e 's/^/* /' | LANG=en_US.utf8 sort -uf | perl -00 -p -i -e 's/^\*.*/<STDIN> . "\n"/es' doc/AUTHORS.adoc
+fi
index dc0b19bfddc367184b46206f63e531aa58cc883a..d1240995ee19cdbf48bb5f477a37c557c2ca4dc4 100644 (file)
@@ -233,7 +233,10 @@ Args::ArgvAccessWrapper::ArgvAccessWrapper(const std::deque<std::string>& args)
 {
 }
 
-const char* Args::ArgvAccessWrapper::operator[](size_t i) const
+// clang-format off
+const char*
+Args::ArgvAccessWrapper::operator[](size_t i) const
+// clang-format on
 {
   return i == m_args->size() ? nullptr : m_args->at(i).c_str();
 }
index b87424fe6c07e9131420922cd1c6e2aa52f9a9a1..7642a289d2ff4e076aae87feafffdc4495c14561 100644 (file)
@@ -126,22 +126,34 @@ Args::size() const
   return m_args.size();
 }
 
-inline const std::string& Args::operator[](size_t i) const
+// clang-format off
+inline const std::string&
+Args::operator[](size_t i) const
+// clang-format on
 {
   return m_args[i];
 }
 
-inline std::string& Args::operator[](size_t i)
+// clang-format off
+inline std::string&
+Args::operator[](size_t i)
+// clang-format on
 {
   return m_args[i];
 }
 
-inline Args& Args::operator*()
+// clang-format off
+inline Args&
+Args::operator*()
+// clang-format on
 {
   return *this;
 }
 
-inline const Args* Args::operator->() const
+// clang-format off
+inline const Args*
+Args::operator->() const
+// clang-format on
 {
   return this;
 }