Skip to content

Commit 5f69a93

Browse files
Ubuntu 24.04 support (#824)
1 parent eb11d20 commit 5f69a93

File tree

11 files changed

+113
-18
lines changed

11 files changed

+113
-18
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
# Compile dependencies that cannot be acquired via the official repositories
4+
5+
mkdir -p ${INSTALL_PATH}
6+
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
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
# Download installers for compiled dependencies
4+
5+
mkdir -p "${DOWNLOAD_PATH}"
6+
7+
## Thrift 0.16 + 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+
13+
# Calculate hash of dependencies for Github Cache Action
14+
15+
hash_value=$(echo -n "${build2_version}${odb_signature}" | md5sum | awk '{print $1}')
16+
17+
## Save said hash
18+
19+
### Restore action
20+
echo "compile-hash-key=${hash_value}" >> "$GITHUB_OUTPUT"
21+
22+
### Save action
23+
echo "CACHE_KEY=${hash_value}" >> "$GITHUB_ENV"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
# Post compilation configuration for building (environmental variables, library location settings etc..)
4+
5+
echo "${INSTALL_PATH}/odb/bin" >> $GITHUB_PATH
6+
echo "CMAKE_PREFIX_PATH=${INSTALL_PATH}/odb:$CMAKE_PREFIX_PATH" >> $GITHUB_ENV
7+
8+
# Clean up dependency sources and intermediate binaries to save space
9+
rm -rf ${DOWNLOAD_PATH}/odb
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
# Install required packages for CodeCompass build
4+
sudo apt install git cmake make g++ libboost-all-dev \
5+
llvm-15-dev clang-15 libclang-15-dev \
6+
gcc-13-plugin-dev thrift-compiler libthrift-dev \
7+
default-jdk libssl-dev libgraphviz-dev libmagic-dev libgit2-dev exuberant-ctags doxygen \
8+
libldap2-dev libgtest-dev
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
# Install PostgreSQL
4+
sudo apt-get install postgresql-server-dev-16
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
# Install SQLite3
4+
sudo apt-get install libsqlite3-dev

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
matrix:
1919
db: [postgresql, sqlite3]
20-
os: [ubuntu-22.04]
20+
os: [ubuntu-22.04, ubuntu-24.04]
2121
fail-fast: false
2222

2323
runs-on: ${{ matrix.os }}
@@ -182,7 +182,7 @@ jobs:
182182
strategy:
183183
matrix:
184184
db: [postgresql, sqlite3]
185-
os: [ubuntu-22.04]
185+
os: [ubuntu-22.04, ubuntu-24.04]
186186
fail-fast: false
187187

188188
runs-on: ${{ matrix.os }}

doc/deps.md

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Build Environment
22
We build CodeCompass in a Linux environment. Currently, Ubuntu Long-Term
3-
Support releases are the main targets: Ubuntu 22.04 LTS (and Ubuntu 24.04 LTS
4-
is planned).
3+
Support releases are the main targets: Ubuntu 22.04 LTS and Ubuntu 24.04 LTS.
54

65
We also provide a Docker image that can be used as developer environment to
76
CodeCompass. See its usage [in a seperate document](/docker/README.md).
@@ -61,23 +60,40 @@ sudo apt install git cmake make g++ libboost-all-dev \
6160
libldap2-dev libgtest-dev
6261
```
6362

63+
#### Ubuntu 24.04 ("Noble Numbat") LTS
64+
65+
```bash
66+
sudo apt install git cmake make g++ libboost-all-dev \
67+
llvm-15-dev clang-15 libclang-15-dev \
68+
gcc-13-plugin-dev thrift-compiler libthrift-dev \
69+
default-jdk libssl-dev libgraphviz-dev libmagic-dev libgit2-dev exuberant-ctags doxygen \
70+
libldap2-dev libgtest-dev
71+
```
72+
6473
#### Database engine support
6574

6675
Depending on the desired database engines to be supported, the following
6776
packages should be installed.
6877

69-
##### Ubuntu 22.04 ("Jammy Jellyfish") LTS
70-
71-
The database connector library must be compiled manually for this release,
78+
The database connector library (ODB) must be compiled manually,
7279
however, the database programs themselves should be installed from the
7380
package manager.
7481

82+
##### SQLite
83+
7584
```bash
76-
# For SQLite database systems:
85+
# For Ubuntu 22.04, Ubuntu 24.04:
7786
sudo apt install libsqlite3-dev
87+
```
88+
89+
##### PostgreSQL
7890

79-
# For PostgreSQL database systems:
91+
```bash
92+
# For Ubuntu 22.04:
8093
sudo apt install postgresql-server-dev-14
94+
95+
# For Ubuntu 24.04:
96+
sudo apt install postgresql-server-dev-16
8197
```
8298

8399
## Known issues
@@ -91,10 +107,10 @@ by other processes which could, in extreme cases, make the system very hard or
91107
impossible to recover. **Please do NOT add a `sudo` in front of any `make` or
92108
other commands below, unless *explicitly* specified!**
93109

94-
### ODB (for Ubuntu 22.04)
110+
### ODB
95111
ODB is an Object Relational Mapping tool, that is required by CodeCompass.
96-
For Ubuntu 22.04, the official release of ODB conflicts with the official
97-
compiler (GNU G++ 11) of the distribution. A newer version of ODB must be
112+
In recent Ubuntu versions, the official release of ODB conflicts with the official
113+
compiler (GNU G++) of the distribution. A newer version of ODB must be
98114
compiled manually.
99115

100116
The ODB installation uses the build2 build system. (Build2 is not needed for
@@ -186,11 +202,7 @@ seen by CMake. Please set this environment before executing the build.
186202
# For all supported OS versions:
187203
export GTEST_ROOT=<gtest_install_dir>
188204

189-
# If using Ubuntu 22.04:
190-
export CMAKE_PREFIX_PATH=<thrift_install_dir>:$CMAKE_PREFIX_PATH
191205
export CMAKE_PREFIX_PATH=<odb_install_directory>:$CMAKE_PREFIX_PATH
192-
193-
export PATH=<thrift_install_dir>/bin:$PATH
194206
export PATH=<odb_install_directory>/bin:$PATH
195207
```
196208

doc/usage.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ creating and using the database file.
1818
PostgreSQL can be installed from the package manager:
1919

2020
```bash
21-
sudo apt install postgresql-<version>
22-
# (e.g. postgresql-14 for Ubuntu 22.04)
21+
# For Ubuntu 22.04:
22+
sudo apt install postgresql-14
23+
24+
# For Ubuntu 24.04:
25+
sudo apt install postgresql-16
2326
```
2427

2528
This will set up an automatically starting local server on the default port

model/include/model/buildaction.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <string>
55
#include <memory>
66
#include <vector>
7+
#include <cstdint>
78

89
#include <odb/core.hxx>
910
#include <odb/lazy-ptr.hxx>

0 commit comments

Comments
 (0)