From de76ed9fdc1b32e5080c1c4c87730e1097020135 Mon Sep 17 00:00:00 2001 From: Wolfgang Hess Date: Thu, 9 Jul 2020 14:54:16 +0200 Subject: [PATCH] Add Debian Buster to the install script and CI. (#1715) Signed-off-by: Wolfgang Hess --- .travis.yml | 1 + Dockerfile.bionic | 1 - Dockerfile.buster | 32 ++++++++++++++++++++++++++++++++ Dockerfile.focal | 1 - Dockerfile.xenial | 1 - scripts/install_debs_cmake.sh | 22 +++++++++------------- 6 files changed, 42 insertions(+), 16 deletions(-) create mode 100644 Dockerfile.buster diff --git a/.travis.yml b/.travis.yml index f6a4e96..987d35c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,6 +26,7 @@ env: - LSB_RELEASE=bionic DOCKER_CACHE_FILE=/home/travis/docker/bionic-cache.tar.gz CC=gcc CXX=g++ - LSB_RELEASE=focal DOCKER_CACHE_FILE=/home/travis/docker/focal-cache.tar.gz CC=gcc CXX=g++ - LSB_RELEASE=stretch DOCKER_CACHE_FILE=/home/travis/docker/stretch-cache.tar.gz CC=gcc CXX=g++ + - LSB_RELEASE=buster DOCKER_CACHE_FILE=/home/travis/docker/buster-cache.tar.gz CC=gcc CXX=g++ before_install: scripts/load_docker_cache.sh diff --git a/Dockerfile.bionic b/Dockerfile.bionic index e65606d..7066e6a 100644 --- a/Dockerfile.bionic +++ b/Dockerfile.bionic @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. - FROM ubuntu:bionic ARG cc diff --git a/Dockerfile.buster b/Dockerfile.buster new file mode 100644 index 0000000..f587e9e --- /dev/null +++ b/Dockerfile.buster @@ -0,0 +1,32 @@ +# Copyright 2020 The Cartographer Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM debian:buster + +ARG cc +ARG cxx + +# Set the preferred C/C++ compiler toolchain, if given (otherwise default). +ENV CC=$cc +ENV CXX=$cxx + +# This base image doesn't ship with sudo. +RUN apt-get update && apt-get install -y sudo && rm -rf /var/lib/apt/lists/* + +COPY scripts/install_debs_cmake.sh cartographer/scripts/ +RUN cartographer/scripts/install_debs_cmake.sh && rm -rf /var/lib/apt/lists/* +COPY scripts/install_abseil.sh cartographer/scripts/ +RUN cartographer/scripts/install_abseil.sh && rm -rf /var/lib/apt/lists/* +COPY . cartographer +RUN cartographer/scripts/install_cartographer_cmake.sh && rm -rf cartographer diff --git a/Dockerfile.focal b/Dockerfile.focal index a2f7aed..4abbe56 100644 --- a/Dockerfile.focal +++ b/Dockerfile.focal @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. - FROM ubuntu:focal ARG cc diff --git a/Dockerfile.xenial b/Dockerfile.xenial index 43231d5..83620f9 100644 --- a/Dockerfile.xenial +++ b/Dockerfile.xenial @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. - FROM ubuntu:xenial ARG cc diff --git a/scripts/install_debs_cmake.sh b/scripts/install_debs_cmake.sh index aed400f..7eda82a 100755 --- a/scripts/install_debs_cmake.sh +++ b/scripts/install_debs_cmake.sh @@ -37,21 +37,17 @@ sudo apt-get install -y \ ninja-build \ stow -if [[ "$(lsb_release -sc)" = "focal" ]] +# Install Ceres Solver and Protocol Buffers support if available. +# No need to build it ourselves. +if [[ "$(lsb_release -sc)" = "focal" || "$(lsb_release -sc)" = "buster" ]] then - sudo apt-get install -y python3-sphinx libgmock-dev + sudo apt-get install -y python3-sphinx libgmock-dev libceres-dev protobuf-compiler else - sudo apt-get install -y python-sphinx + sudo apt-get install -y python-sphinx + if [[ "$(lsb_release -sc)" = "bionic" ]] + then + sudo apt-get install -y libceres-dev + fi fi -# Install Ceres Solver on Ubuntu Bionic. No need to build it ourselves. -if [[ "$(lsb_release -sc)" = "bionic" ]] -then - sudo apt-get install -y libceres-dev -fi -# Install Ceres Solver and Protocol Buffers support on Ubuntu Focal. No need to build it ourselves. -if [[ "$(lsb_release -sc)" = "focal" ]] -then - sudo apt-get install -y libceres-dev protobuf-compiler -fi