]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
install-deps,run-make-check: use ceph-libboost repo
authorKefu Chai <kchai@redhat.com>
Sat, 8 Sep 2018 15:06:45 +0000 (23:06 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 11 Sep 2018 14:22:47 +0000 (22:22 +0800)
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 <kchai@redhat.com>
install-deps.sh
run-make-check.sh

index 7a8aa07f2284d74ad3c4699e1605acc4693f1aea..14db9f55047b9dd8526fee7e7ea303ffedf167f9 100755 (executable)
@@ -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
index 273531953c66a96751a970909bc31d96d7f06fb3..be52f5fa1e412e2361e95355f19f387752994cb6 100755 (executable)
@@ -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 <<EOM
 Note that the binaries produced by this script do not contain correct time
 and git version information, which may make them unsuitable for debugging