From f0d7616b374d8975413ad53aab30795c364943fd Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 8 Sep 2018 23:06:45 +0800 Subject: [PATCH] install-deps,run-make-check: use ceph-libboost repo ceph-libboost1.67 repo is setup to satisfy the libboost dependencies used when building ceph. now it offers arm64 and amd64 builds for xenial. * install-deps.sh: add ceph-libboost1.67 repo hosted on chacra if the building host does not have any of the listed ceph-libboost1.67 packages installed * run-make-check.sh: add "-DWITH_SYSTEM_BOOST=ON -DBOOST_ROOT=/opt/ceph" if include/boost/config.hpp is found under /opt/ceph See-also: http://tracker.ceph.com/issues/25186 Signed-off-by: Kefu Chai --- install-deps.sh | 41 +++++++++++++++++++++++++++++++++++++++++ run-make-check.sh | 10 ++++++++++ 2 files changed, 51 insertions(+) diff --git a/install-deps.sh b/install-deps.sh index 7a8aa07f2284d..14db9f55047b9 100755 --- a/install-deps.sh +++ b/install-deps.sh @@ -105,6 +105,28 @@ ENDOFKEY $SUDO ln -nsf /usr/bin/g++ /usr/bin/$(uname -m)-linux-gnu-g++ } +function install_pkg_on_ubuntu { + local project=$1 + shift + local sha1=$1 + shift + local codename=$1 + shift + local pkgs=$@ + local missing_pkgs + for pkg in $pkgs; do + if ! dpkg -s $pkg &> /dev/null; then + missing_pkgs+=" $pkg" + fi + done + if test -n "$missing_pkgs"; then + local shaman_url="https://shaman.ceph.com/api/repos/${project}/master/${sha1}/ubuntu/${codename}/repo" + $SUDO curl --silent --location $shaman_url --output /etc/apt/sources.list.d/$project.list + $SUDO env DEBIAN_FRONTEND=noninteractive apt-get update -y -o Acquire::Languages=none -o Acquire::Translation=none || true + $SUDO env DEBIAN_FRONTEND=noninteractive apt-get install --allow-unauthenticated -y $missing_pkgs + fi +} + function version_lt { test $1 != $(echo -e "$1\n$2" | sort -rV | head -n 1) } @@ -200,6 +222,25 @@ else ;; *Xenial*) ensure_decent_gcc_on_ubuntu 7 xenial + install_pkg_on_ubuntu \ + ceph-libboost1.67 \ + dd38c27740c1f9a9e6719a07eef84a1369dc168b \ + xenial \ + ceph-libboost-atomic1.67-dev \ + ceph-libboost-chrono1.67-dev \ + ceph-libboost-container1.67-dev \ + ceph-libboost-context1.67-dev \ + ceph-libboost-coroutine1.67-dev \ + ceph-libboost-date-time1.67-dev \ + ceph-libboost-filesystem1.67-dev \ + ceph-libboost-iostreams1.67-dev \ + ceph-libboost-program-options1.67-dev \ + ceph-libboost-python1.67-dev \ + ceph-libboost-random1.67-dev \ + ceph-libboost-regex1.67-dev \ + ceph-libboost-system1.67-dev \ + ceph-libboost-thread1.67-dev \ + ceph-libboost-timer1.67-dev ;; *) $SUDO apt-get install -y gcc diff --git a/run-make-check.sh b/run-make-check.sh index 273531953c66a..be52f5fa1e412 100755 --- a/run-make-check.sh +++ b/run-make-check.sh @@ -50,6 +50,15 @@ function get_processors() { fi } +function detect_ceph_dev_pkgs() { + local cmake_opts + local boost_root=/opt/ceph + if test -f $boost_root/include/boost/config.hpp; then + cmake_opts+=" -DWITH_SYSTEM_BOOST=ON -DBOOST_ROOT=$boost_root" + fi + echo "$cmake_opts" +} + function run() { local install_cmd local which_pkg="which" @@ -103,6 +112,7 @@ function run() { if ! type python2 > /dev/null 2>&1 ; then CMAKE_BUILD_OPTS+=" -DWITH_PYTHON2=OFF -DWITH_PYTHON3=ON -DMGR_PYTHON_VERSION=3" fi + CMAKE_BUILD_OPTS+=$(detect_ceph_dev_pkgs) cat <