THRIFT-4351: use travis build stages to optimize build,
avoiding duplicate rebuilds of the same image, and also
allow personal docker hub repositories for private fork
builds to be optimized. Move ubsan build to artful image
because it catches more stuff and fix what was found.
THRIFT-4345: solidify docker build strategy for maximum
coverage: trusty, xenial, artful as stock as they can be
THRIFT-4344: add top level language summary markdown and
update readme with a new image on the layered architecture
THRIFT-3847: remove VERSION macro from config.h which
was causing a conflict on artful builds.
THRIFT-4359: fix haxe map/set decode when key is binary,
as a missing break statement caused it to use an int
during decode
This closes #1389
diff --git a/build/docker/ubuntu-trusty/Dockerfile b/build/docker/ubuntu-trusty/Dockerfile
index 857384b..db2041a 100644
--- a/build/docker/ubuntu-trusty/Dockerfile
+++ b/build/docker/ubuntu-trusty/Dockerfile
@@ -10,62 +10,52 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# Apache Thrift Docker build environment for Ubuntu
#
-# Known missing client libraries:
-# - dotnetcore
+# Apache Thrift Docker build environment for Ubuntu Trusty
+# Using all stock Ubuntu Trusty packaging except for:
+# - d: does not come with Ubuntu so we're installing 2.070.0
+# - dart: does not come with Ubuntu so we're installing 1.20.1
+# - dotnetcore, disabled because netcore is for 1.0.0-preview and 2.0.0 is out
+# - haxe, disabled because the distro comes with 3.0.0 and it cores while installing
+# - node.js, disabled because it is at 0.10.0 in the distro which is too old (need 4+)
+# - ocaml, disabled because it fails to install properly
+#
FROM buildpack-deps:trusty-scm
MAINTAINER Apache Thrift <dev@thrift.apache.org>
-
ENV DEBIAN_FRONTEND noninteractive
-# Add apt sources
-# CMAKE
-RUN apt-get update && \
- apt-get install -y --no-install-recommends software-properties-common && \
- add-apt-repository -y ppa:george-edison55/cmake-3.x
-
-# Erlang
-RUN echo 'deb http://packages.erlang-solutions.com/debian trusty contrib' > /etc/apt/sources.list.d/erlang_solutions.list && \
- curl -sSL https://packages.erlang-solutions.com/debian/erlang_solutions.asc | apt-key add -
-
-# Dart
-RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
- curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list && \
- sed -i /etc/apt/sources.list.d/dart_stable.list -e 's/https:/http:/g'
-
-# Consider using mirror nearby when building locally
-# TODO: Provide option via --build-arg=...
-# RUN sed -i /etc/apt/sources.list -e 's!http://archive.ubuntu.com/ubuntu/!http://your/mirror/!g'
+RUN apt-get update && \
+ apt-get dist-upgrade -y && \
+ apt-get install -y --no-install-recommends \
+ apt \
+ apt-transport-https \
+ apt-utils \
+ curl \
+ dirmngr \
+ software-properties-common \
+ wget
RUN apt-get update && apt-get install -y --no-install-recommends \
`# General dependencies` \
+ bash-completion \
bison \
build-essential \
clang \
cmake \
debhelper \
flex \
+ gdb \
+ llvm \
ninja-build \
pkg-config \
-`# Included in buildpack-deps` \
-`# autoconf` \
-`# automake` \
-`# g++` \
-`# git` \
-`# libtool` \
-`# make`
+ valgrind \
+ vim
+ENV PATH /usr/lib/llvm-3.8/bin:$PATH
RUN apt-get install -y --no-install-recommends \
`# C++ dependencies` \
-`# libevent and OpenSSL are needed by D too` \
- libboost-dev \
- libboost-filesystem-dev \
- libboost-program-options-dev \
- libboost-system-dev \
- libboost-test-dev \
- libboost-thread-dev \
+ libboost-all-dev \
libevent-dev \
libssl-dev \
qt5-default \
@@ -73,6 +63,70 @@
qtbase5-dev-tools
RUN apt-get install -y --no-install-recommends \
+`# csharp (mono) dependencies` \
+ mono-devel
+
+RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EBCF975E5BA24D5E && \
+ wget http://master.dl.sourceforge.net/project/d-apt/files/d-apt.list -O /etc/apt/sources.list.d/d-apt.list && \
+ wget -qO - https://dlang.org/d-keyring.gpg | apt-key add - && \
+ apt-get update && \
+ apt-get install -y --no-install-recommends \
+`# D dependencies` \
+ dmd-bin=2.070.2-0 \
+ libphobos2-dev=2.070.2-0 \
+ dub \
+ dfmt \
+ dscanner \
+ xdg-utils
+# RUN mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
+# curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \
+# mv libevent-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
+# mv libevent-master/C/* /usr/include/dmd/druntime/import/C/ && \
+# rm -rf libevent-master
+# RUN curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/master.tar.gz| tar xz && \
+# mv openssl-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
+# mv openssl-master/C/* /usr/include/dmd/druntime/import/C/ && \
+# rm -rf openssl-master
+
+RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
+ curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list && \
+ apt-get update && \
+ apt-get install -y --no-install-recommends \
+`# Dart dependencies` \
+ dart=1.20.1-1
+ENV PATH /usr/lib/dart/bin:$PATH
+
+RUN apt-get install -y --no-install-recommends \
+`# Erlang dependencies` \
+ erlang-base \
+ erlang-eunit \
+ erlang-dev \
+ erlang-tools \
+ rebar
+
+RUN apt-get install -y --no-install-recommends \
+`# GlibC dependencies` \
+ libglib2.0-dev
+
+RUN apt-get install -y --no-install-recommends \
+`# golang (go) dependencies` \
+ golang-go
+
+RUN apt-get install -y --no-install-recommends \
+`# Haskell dependencies` \
+ ghc \
+ cabal-install
+
+# disabled because it cores while installing
+# RUN apt-get install -y --no-install-recommends \
+# `# Haxe dependencies` \
+# haxe \
+# neko \
+# neko-dev && \
+# haxelib setup /usr/share/haxe/lib && \
+# haxelib install hxcpp 3.2.102
+
+RUN apt-get install -y --no-install-recommends \
`# Java dependencies` \
ant \
ant-optional \
@@ -80,28 +134,25 @@
maven
RUN apt-get install -y --no-install-recommends \
-`# Python dependencies` \
-`# TODO:` \
-`# Install twisted and zope.interface via pip. we need twisted at ./configure time, otherwise` \
-`# py.twisted tests are skipped.` \
- python-all \
- python-all-dbg \
- python-all-dev \
- python-pip \
- python-setuptools \
- python-twisted \
- python-zope.interface \
- python3-all \
- python3-all-dbg \
- python3-all-dev \
- python3-setuptools \
- python3-pip
+`# Lua dependencies` \
+ lua5.1 \
+ lua5.1-dev
+
+# disabled because it is too old
+# RUN apt-get install -y --no-install-recommends \
+# `# Node.js dependencies` \
+# nodejs \
+# npm
+
+# disabled because it fails to install properly
+# RUN apt-get install -y --no-install-recommends \
+# `# OCaml dependencies` \
+# ocaml \
+# opam && \
+# opam init --yes && \
+# opam install --yes oasis
RUN apt-get install -y --no-install-recommends \
-`# Ruby dependencies` \
- ruby \
- ruby-dev \
- ruby-bundler \
`# Perl dependencies` \
libbit-vector-perl \
libclass-accessor-class-perl \
@@ -112,119 +163,60 @@
RUN apt-get install -y --no-install-recommends \
`# Php dependencies` \
php5 \
- php5-dev \
php5-cli \
+ php5-dev \
php-pear \
re2c \
- phpunit \
-`# GlibC dependencies` \
- libglib2.0-dev
-
-RUN apt-get update && apt-get install -y --no-install-recommends \
-`# Erlang dependencies` \
- erlang-base \
- erlang-eunit \
- erlang-dev \
- erlang-tools \
- rebar
+ phpunit
RUN apt-get install -y --no-install-recommends \
-`# Haskell dependencies` \
- ghc \
- cabal-install \
-`# Haxe dependencies` \
- neko \
- neko-dev \
- libneko0
-
-# Newer release of nodejs
-RUN curl -sL https://deb.nodesource.com/setup_4.x | bash
-RUN apt-get install -y --no-install-recommends \
-`# Node.js dependencies` \
- nodejs
-
-# Add mono package repository url to get latest version of mono
-RUN echo "deb http://download.mono-project.com/repo/debian trusty main" | tee /etc/apt/sources.list.d/mono.list
-RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A6A19B38D3D831EF
-RUN apt-get update && apt-get install -y --no-install-recommends \
-`# CSharp dependencies` \
- mono-devel
+`# Python dependencies` \
+ python-all \
+ python-all-dbg \
+ python-all-dev \
+ python-pip \
+ python-setuptools \
+ python-six \
+ python-twisted \
+ python-wheel \
+ python-zope.interface \
+ python3-all \
+ python3-all-dbg \
+ python3-all-dev \
+ python3-pip \
+ python3-setuptools \
+ python3-six \
+ python3-wheel \
+ python3-zope.interface && \
+ pip install -U ipaddress backports.ssl_match_hostname tornado && \
+ pip3 install -U backports.ssl_match_hostname tornado
+# installing tornado by pip/pip3 instead of debian package
+# if we install the debian package, the build fails in py2
RUN apt-get install -y --no-install-recommends \
-`# D dependencies` \
- xdg-utils \
-`# Dart dependencies` \
- dart \
-`# Lua dependencies` \
- lua5.2 \
- lua5.2-dev \
-`# MinGW dependencies` \
- mingw32 \
- mingw32-binutils \
- mingw32-runtime \
- nsis \
-`# Clean up` \
- && rm -rf /var/cache/apt/* && \
+`# Ruby dependencies` \
+ ruby \
+ ruby-dev \
+ ruby-bundler
+RUN gem install bundler --no-ri --no-rdoc
+
+RUN apt-get install -y --no-install-recommends \
+`# Rust dependencies` \
+ cargo \
+ rustc
+
+RUN apt-get install -y --no-install-recommends \
+`# Static Code Analysis dependencies` \
+ cppcheck \
+ sloccount && \
+ pip install flake8
+
+# Clean up
+RUN rm -rf /var/cache/apt/* && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /tmp/* && \
rm -rf /var/tmp/*
-# Ruby
-RUN gem install bundler --no-ri --no-rdoc
-
-# Python optional dependencies
-RUN pip2 install -U ipaddress backports.ssl_match_hostname tornado
-RUN pip3 install -U backports.ssl_match_hostname tornado
-
-# Go
-RUN curl -sSL https://storage.googleapis.com/golang/go1.4.3.linux-amd64.tar.gz | tar -C /usr/local/ -xz
-ENV PATH /usr/local/go/bin:$PATH
-
-# Haxe
-RUN mkdir -p /usr/lib/haxe && \
- wget -O - https://github.com/HaxeFoundation/haxe/releases/download/3.2.1/haxe-3.2.1-linux64.tar.gz | \
- tar -C /usr/lib/haxe --strip-components=1 -xz && \
- ln -s /usr/lib/haxe/haxe /usr/bin/haxe && \
- ln -s /usr/lib/haxe/haxelib /usr/bin/haxelib && \
- mkdir -p /usr/lib/haxe/lib && \
- chmod -R 777 /usr/lib/haxe/lib && \
- haxelib setup --always /usr/lib/haxe/lib && \
- haxelib install --always hxcpp 3.4.64
-
-# Node.js
-# temporarily removed since this breaks the build (and is not needed to test C# code)
-# RUN curl -sSL https://www.npmjs.com/install.sh | sh
-
-# D
-RUN curl -sSL http://downloads.dlang.org/releases/2.x/2.070.0/dmd_2.070.0-0_amd64.deb -o /tmp/dmd_2.070.0-0_amd64.deb && \
- dpkg -i /tmp/dmd_2.070.0-0_amd64.deb && \
- rm /tmp/dmd_2.070.0-0_amd64.deb && \
- curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/master.tar.gz| tar xz && \
- curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \
- mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
- mv libevent-master/deimos/* openssl-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
- mv libevent-master/C/* openssl-master/C/* /usr/include/dmd/druntime/import/C/ && \
- rm -rf libevent-master openssl-master && \
- echo 'gcc -Wl,--no-as-needed $*' > /usr/local/bin/gcc-dmd && \
- chmod 755 /usr/local/bin/gcc-dmd && \
- echo 'CC=/usr/local/bin/gcc-dmd' >> /etc/dmd.conf
-
-# Dart
-ENV PATH /usr/lib/dart/bin:$PATH
-
-# OCaml
-RUN echo 'deb http://ppa.launchpad.net/avsm/ppa/ubuntu trusty main' > /etc/apt/sources.list.d/avsm-official-ocaml.list && \
- gpg --keyserver keyserver.ubuntu.com --recv 61707B09 && \
- gpg --export --armor 61707B09 | apt-key add - && \
- apt-get update && \
- apt-get install -y ocaml opam && \
- opam init && \
- opam install oasis
-
-# Rust
-RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.17.0
-ENV PATH /root/.cargo/bin:$PATH
-
ENV THRIFT_ROOT /thrift
RUN mkdir -p $THRIFT_ROOT/src
COPY Dockerfile $THRIFT_ROOT/