From 84d19f30c70449059024e737e4192d465ddb86ec Mon Sep 17 00:00:00 2001 From: Daniel Bang Date: Fri, 24 Jul 2020 13:43:43 -0500 Subject: [PATCH] Supporting C++20 --- ci/Dockerfile | 12 ++++++++++-- ci/do_ci.sh | 1 + ci/run_docker.sh | 13 +++++++++---- ci/setup_ci_environment.sh | 3 ++- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/ci/Dockerfile b/ci/Dockerfile index a1f43af928..a758209a54 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 WORKDIR /setup-ci @@ -9,9 +9,17 @@ ADD install_bazelisk.sh /setup-ci ADD install_protobuf.sh /setup-ci ADD install_format_tools.sh /setup-ci +ENV DEBIAN_FRONTEND noninteractive +ENV DEBCONF_NONINTERACTIVE_SEEN true + +RUN echo "tzdata tzdata/Areas select US" > /tmp/preseed.txt; \ + echo "tzdata tzdata/Zones/Europe select Chicago" >> /tmp/preseed.txt; \ + debconf-set-selections /tmp/preseed.txt && \ + apt-get update && \ + apt-get install -y tzdata + RUN /setup-ci/setup_ci_environment.sh \ && /setup-ci/setup_cmake.sh \ - && /setup-ci/install_gcc48.sh \ && /setup-ci/install_bazelisk.sh \ && /setup-ci/install_protobuf.sh \ && /setup-ci/install_format_tools.sh diff --git a/ci/do_ci.sh b/ci/do_ci.sh index b6d23f763f..46cd5dab70 100755 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -21,6 +21,7 @@ if [[ "$1" == "cmake.test" ]]; then make test exit 0 elif [[ "$1" == "cmake.c++20.test" ]]; then + echo "${BUILD_DIR}" cd "${BUILD_DIR}" rm -rf * cmake -DCMAKE_BUILD_TYPE=Debug \ diff --git a/ci/run_docker.sh b/ci/run_docker.sh index c09ca51ce4..7b3b650e34 100755 --- a/ci/run_docker.sh +++ b/ci/run_docker.sh @@ -3,12 +3,17 @@ set -e BUILD_IMAGE=opentelemetry-cpp-build +BUILD_IMAGE2=opentelemetry-cpp-build2 docker image inspect "$BUILD_IMAGE" &> /dev/null || { docker build -t "$BUILD_IMAGE" ci } -if [[ $# -ge 1 ]]; then - docker run -v "$PWD":/src -w /src -it "$BUILD_IMAGE" "$@" +if [ $2 == cmake.c++20.test ]; then + docker run -v "$PWD":/src -w /src -it "$BUILD_IMAGE2" "$@" else - docker run -v "$PWD":/src -w /src --privileged -it "$BUILD_IMAGE" /bin/bash -l -fi + if [[ $# -ge 1 ]]; then + docker run -v "$PWD":/src -w /src -it "$BUILD_IMAGE" "$@" + else + docker run -v "$PWD":/src -w /src --privileged -it "$BUILD_IMAGE" /bin/bash -l + fi +fi \ No newline at end of file diff --git a/ci/setup_ci_environment.sh b/ci/setup_ci_environment.sh index 9d7df6a1d5..b5ef8da358 100755 --- a/ci/setup_ci_environment.sh +++ b/ci/setup_ci_environment.sh @@ -6,5 +6,6 @@ apt-get install --no-install-recommends --no-install-suggests -y \ build-essential \ ca-certificates \ wget \ - git + git \ + g++-10 apt-get install -y lcov