Skip to content

Commit 77566fe

Browse files
author
Barnabás Domozi
committed
Compile ODB from source on Ubuntu 20.04 CI
1 parent 30f6f46 commit 77566fe

File tree

4 files changed

+38
-7
lines changed

4 files changed

+38
-7
lines changed

.github/scripts/ubuntu-20.04/compile_build.sh

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,34 @@
44

55
mkdir -p ${INSTALL_PATH}
66

7+
## Compile build2
8+
9+
sh "${DOWNLOAD_PATH}/install_latest_build2.sh" ${INSTALL_PATH}/build2
10+
11+
## Compile odb, libodb, and its connectors
12+
13+
mkdir -p ${DOWNLOAD_PATH}/odb
14+
cd ${DOWNLOAD_PATH}/odb
15+
${INSTALL_PATH}/build2/bin/bpkg create --quiet --jobs $(nproc) cc \
16+
config.cxx=g++ \
17+
config.cc.coptions=-O3 \
18+
config.bin.rpath=${INSTALL_PATH}/odb/lib \
19+
config.install.root=${INSTALL_PATH}/odb
20+
21+
### Getting the source
22+
${INSTALL_PATH}/build2/bin/bpkg add https://pkg.cppget.org/1/beta --trust-yes
23+
${INSTALL_PATH}/build2/bin/bpkg fetch --trust-yes
24+
25+
### Building odb
26+
${INSTALL_PATH}/build2/bin/bpkg build odb --yes
27+
${INSTALL_PATH}/build2/bin/bpkg build libodb --yes
28+
${INSTALL_PATH}/build2/bin/bpkg build libodb-sqlite --yes
29+
${INSTALL_PATH}/build2/bin/bpkg build libodb-pgsql --yes
30+
${INSTALL_PATH}/build2/bin/bpkg install --all --recursive
31+
732
## Compile Thrift
833
tar -xvf ${DOWNLOAD_PATH}/thrift-0.16.0.tar.gz
9-
cd thrift-0.16.0
34+
cd ${DOWNLOAD_PATH}/thrift-0.16.0
1035
./configure --prefix=${INSTALL_PATH}/thrift --silent --without-python \
1136
--enable-libtool-lock --enable-tutorial=no --enable-tests=no \
1237
--with-libevent --with-zlib --without-nodejs --without-lua \
@@ -16,4 +41,4 @@ cd thrift-0.16.0
1641
--without-dotnetcore --without-d --without-qt4 --without-qt5 \
1742
--without-java --without-swift
1843

19-
make install -j $(nproc)
44+
make install -j $(nproc)

.github/scripts/ubuntu-20.04/download_build.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44

55
mkdir -p ${DOWNLOAD_PATH}
66

7+
## ODB beta
8+
9+
wget -O "${DOWNLOAD_PATH}/install_latest_build2.sh" "https://github.com/Ericsson/CodeCompass/raw/master/scripts/install_latest_build2.sh"
10+
build2_version=$(sh "${DOWNLOAD_PATH}/install_latest_build2.sh" --version)
11+
odb_signature=$(wget -qO- https://pkg.cppget.org/1/beta/signature.manifest)
12+
713
## Thrift 0.16
814

915
wget -O ${DOWNLOAD_PATH}/thrift-0.16.0.tar.gz "http://archive.apache.org/dist/thrift/0.16.0/thrift-0.16.0.tar.gz"
@@ -18,7 +24,7 @@ for file in "${dependencies_to_hash[@]}"; do
1824
concatenated_hashes="${concatenated_hashes}${file_hash}"
1925
done
2026

21-
hash_value=$(echo -n "$concatenated_hashes" | md5sum | awk '{print $1}')
27+
hash_value=$(echo -n "${build2_version}${odb_signature}${concatenated_hashes}" | md5sum | awk '{print $1}')
2228

2329
## Save said hash
2430

@@ -27,4 +33,4 @@ hash_value=$(echo -n "$concatenated_hashes" | md5sum | awk '{print $1}')
2733
echo "ubuntu-20-04-compile-hash-key=${hash_value}" >> "$GITHUB_OUTPUT"
2834

2935
### Save action
30-
echo "CACHE_KEY=${hash_value}" >> "$GITHUB_ENV"
36+
echo "CACHE_KEY=${hash_value}" >> "$GITHUB_ENV"

.github/scripts/ubuntu-20.04/setup_build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
# Install required packages for CodeCompass build
44
sudo apt-get install -y git cmake make g++ libboost-all-dev llvm-11-dev clang-11 \
5-
libclang-11-dev odb libodb-dev default-jdk libssl-dev \
5+
libclang-11-dev default-jdk libssl-dev \
66
libgraphviz-dev libmagic-dev libgit2-dev ctags doxygen libgtest-dev npm libldap2-dev

.github/scripts/ubuntu-22.04/download_build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
mkdir -p "${DOWNLOAD_PATH}"
66

7-
## Thrift 0.16 + ODB beta
7+
## ODB beta
88

99
wget -O "${DOWNLOAD_PATH}/install_latest_build2.sh" "https://github.com/Ericsson/CodeCompass/raw/master/scripts/install_latest_build2.sh"
1010
build2_version=$(sh "${DOWNLOAD_PATH}/install_latest_build2.sh" --version)
@@ -20,4 +20,4 @@ hash_value=$(echo -n "${build2_version}${odb_signature}" | md5sum | awk '{print
2020
echo "ubuntu-22-04-compile-hash-key=${hash_value}" >> "$GITHUB_OUTPUT"
2121

2222
### Save action
23-
echo "CACHE_KEY=${hash_value}" >> "$GITHUB_ENV"
23+
echo "CACHE_KEY=${hash_value}" >> "$GITHUB_ENV"

0 commit comments

Comments
 (0)