This is an automated email from the ASF dual-hosted git repository. laiyingchun pushed a commit to branch support_ubuntu2204_clang14 in repository https://gitbox.apache.org/repos/asf/incubator-pegasus.git
commit 754185d17ccb45929d2236181159c0c4f41bdc6b Author: Yingchun Lai <[email protected]> AuthorDate: Tue Feb 14 14:42:34 2023 +0800 build: Support Ubuntu 22.04 and clang 14 --- .github/workflows/build-push-env-docker.yml | 1 + .github/workflows/regular-build.yml | 4 ++ .github/workflows/thirdparty-regular-push.yml | 2 + cmake_modules/BaseFunctions.cmake | 2 +- docker/README.md | 2 + docker/pegasus-build-env/ubuntu2204/Dockerfile | 71 ++++++++++++++++++++++++++ thirdparty/CMakeLists.txt | 3 +- thirdparty/fix_prometheus-cpp_limits.patch | 10 ++++ 8 files changed, 93 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-push-env-docker.yml b/.github/workflows/build-push-env-docker.yml index 756ebad07..4693429b3 100644 --- a/.github/workflows/build-push-env-docker.yml +++ b/.github/workflows/build-push-env-docker.yml @@ -42,6 +42,7 @@ jobs: - ubuntu1604 - ubuntu1804 - ubuntu2004 + - ubuntu2204 - centos6 - centos7 steps: diff --git a/.github/workflows/regular-build.yml b/.github/workflows/regular-build.yml index 4eb4849d1..08dc3edd4 100644 --- a/.github/workflows/regular-build.yml +++ b/.github/workflows/regular-build.yml @@ -58,11 +58,15 @@ jobs: - ubuntu1604 - ubuntu1804 - ubuntu2004 + - ubuntu2204 - centos6 - centos7 compiler-family: - gcc include: + - compiler-family: clang + compiler: "clang-14,clang++-14" + os: ubuntu2204 - compiler-family: clang compiler: "clang-10,clang++-10" os: ubuntu2004 diff --git a/.github/workflows/thirdparty-regular-push.yml b/.github/workflows/thirdparty-regular-push.yml index 3a591b06a..685a7932e 100644 --- a/.github/workflows/thirdparty-regular-push.yml +++ b/.github/workflows/thirdparty-regular-push.yml @@ -74,6 +74,7 @@ jobs: - ubuntu1604 - ubuntu1804 - ubuntu2004 + - ubuntu2204 - centos6 - centos7 steps: @@ -111,6 +112,7 @@ jobs: - ubuntu1604 - ubuntu1804 - ubuntu2004 + - ubuntu2204 - centos6 - centos7 steps: diff --git a/cmake_modules/BaseFunctions.cmake b/cmake_modules/BaseFunctions.cmake index 359e7a79a..79aba27cb 100644 --- a/cmake_modules/BaseFunctions.cmake +++ b/cmake_modules/BaseFunctions.cmake @@ -204,7 +204,7 @@ function(dsn_setup_compiler_flags) # We want access to the PRI* print format macros. add_definitions(-D__STDC_FORMAT_MACROS) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y" CACHE STRING "" FORCE) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y -gdwarf-4" CACHE STRING "" FORCE) # -Wall: Enable all warnings. add_compile_options(-Wall) diff --git a/docker/README.md b/docker/README.md index 102150439..5ff4fa743 100644 --- a/docker/README.md +++ b/docker/README.md @@ -39,6 +39,7 @@ Github Actions automatically rebuilds and publishes build-env for every commit. - `apache/pegasus:build-env-ubuntu1604` - `apache/pegasus:build-env-ubuntu1804` - `apache/pegasus:build-env-ubuntu2004` +- `apache/pegasus:build-env-ubuntu2204` DockerHub: https://hub.docker.com/r/apache/pegasus @@ -62,3 +63,4 @@ so jobs based on this image can skip building third-parties. - `apache/pegasus:thirdparties-bin-ubuntu1604-master` - `apache/pegasus:thirdparties-bin-ubuntu1804-master` - `apache/pegasus:thirdparties-bin-ubuntu2004-master` +- `apache/pegasus:thirdparties-bin-ubuntu2204-master` diff --git a/docker/pegasus-build-env/ubuntu2204/Dockerfile b/docker/pegasus-build-env/ubuntu2204/Dockerfile new file mode 100644 index 000000000..2a0f1445e --- /dev/null +++ b/docker/pegasus-build-env/ubuntu2204/Dockerfile @@ -0,0 +1,71 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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 ubuntu:22.04 + +ENV TZ=Asia/Shanghai +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt-get update -y; \ + apt-get install -y --no-install-recommends \ + build-essential \ + software-properties-common \ + clang-14 \ + libclang-14-dev \ + llvm-14-dev \ + openjdk-8-jdk \ + pkg-config \ + python3-pip \ + libaio-dev \ + libsnappy-dev \ + libbz2-dev \ + libzstd-dev \ + liblz4-dev \ + zlib1g \ + zlib1g.dev \ + patch \ + netcat \ + wget \ + ccache \ + git \ + curl \ + zip \ + unzip \ + gdb \ + vim \ + automake \ + libtool \ + libssl-dev \ + bison \ + maven \ + flex; \ + rm -rf /var/lib/apt/lists/* + +RUN pip3 install --no-cache-dir cmake + +RUN wget --progress=dot:giga https://github.com/apache/thrift/archive/refs/tags/0.11.0.tar.gz -P /opt/thrift && \ + cd /opt/thrift && tar xzf 0.11.0.tar.gz && cd thrift-0.11.0 && ./bootstrap.sh && \ + ./configure --enable-libs=no && \ + make -j$(($(nproc)/2+1)) && make install && cd - && \ + rm -rf thrift-0.11.0 0.11.0.tar.gz + +ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 +ENV CLASSPATH=$JAVA_HOME/lib/ +ENV PATH=$JAVA_HOME/bin:$PATH +ENV LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/amd64/server:$LD_LIBRARY_PATH + +WORKDIR /root/apache diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index 33bac0dbc..3a98df212 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -340,7 +340,8 @@ ExternalProject_Add(prometheus-cpp https://codeload.github.com/jupp0r/prometheus-cpp/tar.gz/v0.7.0 URL_MD5 dc75c31ceaefd160e978365bdca8eb01 DEPENDS civetweb curl - PATCH_COMMAND rm -rf 3rdparty/civetweb && cp -R ${civetweb_SRC} 3rdparty/civetweb # replace the submodule + # TODO(yingchun): replace the submodule + PATCH_COMMAND rm -rf 3rdparty/civetweb && cp -R ${civetweb_SRC} 3rdparty/civetweb && patch -p0 < ${TP_DIR}/fix_prometheus-cpp_limits.patch CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${TP_OUTPUT} -DENABLE_TESTING=OFF -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} diff --git a/thirdparty/fix_prometheus-cpp_limits.patch b/thirdparty/fix_prometheus-cpp_limits.patch new file mode 100644 index 000000000..065b04f67 --- /dev/null +++ b/thirdparty/fix_prometheus-cpp_limits.patch @@ -0,0 +1,10 @@ +--- core/src/histogram.cc 2023-02-13 13:56:03.678985601 +0800 ++++ core/src/histogram_fix_limits.cc 2023-02-13 13:55:55.303966447 +0800 +@@ -4,6 +4,7 @@ + #include <cassert> + #include <iterator> + #include <numeric> ++#include <limits> + + namespace prometheus { + --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
