Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/scripts/ubuntu-24.04/compile_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

# Compile dependencies that cannot be acquired via the official repositories

mkdir -p ${INSTALL_PATH}

## Compile build2

sh "${DOWNLOAD_PATH}/install_latest_build2.sh" ${INSTALL_PATH}/build2

## Compile odb, libodb, and its connectors

mkdir -p ${DOWNLOAD_PATH}/odb
cd ${DOWNLOAD_PATH}/odb
${INSTALL_PATH}/build2/bin/bpkg create --quiet --jobs $(nproc) cc \
config.cxx=g++ \
config.cc.coptions=-O3 \
config.bin.rpath=${INSTALL_PATH}/odb/lib \
config.install.root=${INSTALL_PATH}/odb

### Getting the source
${INSTALL_PATH}/build2/bin/bpkg add https://pkg.cppget.org/1/beta --trust-yes
${INSTALL_PATH}/build2/bin/bpkg fetch --trust-yes

### Building odb
${INSTALL_PATH}/build2/bin/bpkg build odb --yes
${INSTALL_PATH}/build2/bin/bpkg build libodb --yes
${INSTALL_PATH}/build2/bin/bpkg build libodb-sqlite --yes
${INSTALL_PATH}/build2/bin/bpkg build libodb-pgsql --yes
${INSTALL_PATH}/build2/bin/bpkg install --all --recursive
23 changes: 23 additions & 0 deletions .github/scripts/ubuntu-24.04/download_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

# Download installers for compiled dependencies

mkdir -p "${DOWNLOAD_PATH}"

## Thrift 0.16 + ODB beta

wget -O "${DOWNLOAD_PATH}/install_latest_build2.sh" "https://github.com/Ericsson/CodeCompass/raw/master/scripts/install_latest_build2.sh"
build2_version=$(sh "${DOWNLOAD_PATH}/install_latest_build2.sh" --version)
odb_signature=$(wget -qO- https://pkg.cppget.org/1/beta/signature.manifest)

# Calculate hash of dependencies for Github Cache Action

hash_value=$(echo -n "${build2_version}${odb_signature}" | md5sum | awk '{print $1}')

## Save said hash

### Restore action
echo "compile-hash-key=${hash_value}" >> "$GITHUB_OUTPUT"

### Save action
echo "CACHE_KEY=${hash_value}" >> "$GITHUB_ENV"
9 changes: 9 additions & 0 deletions .github/scripts/ubuntu-24.04/postcompile_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

# Post compilation configuration for building (environmental variables, library location settings etc..)

echo "${INSTALL_PATH}/odb/bin" >> $GITHUB_PATH
echo "CMAKE_PREFIX_PATH=${INSTALL_PATH}/odb:$CMAKE_PREFIX_PATH" >> $GITHUB_ENV

# Clean up dependency sources and intermediate binaries to save space
rm -rf ${DOWNLOAD_PATH}/odb
8 changes: 8 additions & 0 deletions .github/scripts/ubuntu-24.04/setup_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

# Install required packages for CodeCompass build
sudo apt install git cmake make g++ libboost-all-dev \
llvm-15-dev clang-15 libclang-15-dev \
gcc-13-plugin-dev thrift-compiler libthrift-dev \
default-jdk libssl-dev libgraphviz-dev libmagic-dev libgit2-dev exuberant-ctags doxygen \
libldap2-dev libgtest-dev
4 changes: 4 additions & 0 deletions .github/scripts/ubuntu-24.04/setup_postgresql.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

# Install PostgreSQL
sudo apt-get install postgresql-server-dev-16
4 changes: 4 additions & 0 deletions .github/scripts/ubuntu-24.04/setup_sqlite3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

# Install SQLite3
sudo apt-get install libsqlite3-dev
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
db: [postgresql, sqlite3]
os: [ubuntu-22.04]
os: [ubuntu-22.04, ubuntu-24.04]
fail-fast: false

runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -182,7 +182,7 @@ jobs:
strategy:
matrix:
db: [postgresql, sqlite3]
os: [ubuntu-22.04]
os: [ubuntu-22.04, ubuntu-24.04]
fail-fast: false

runs-on: ${{ matrix.os }}
Expand Down
40 changes: 26 additions & 14 deletions doc/deps.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Build Environment
We build CodeCompass in a Linux environment. Currently, Ubuntu Long-Term
Support releases are the main targets: Ubuntu 22.04 LTS (and Ubuntu 24.04 LTS
is planned).
Support releases are the main targets: Ubuntu 22.04 LTS and Ubuntu 24.04 LTS.

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

#### Ubuntu 24.04 ("Noble Numbat") LTS

```bash
sudo apt install git cmake make g++ libboost-all-dev \
llvm-15-dev clang-15 libclang-15-dev \
gcc-13-plugin-dev thrift-compiler libthrift-dev \
default-jdk libssl-dev libgraphviz-dev libmagic-dev libgit2-dev exuberant-ctags doxygen \
libldap2-dev libgtest-dev
```

#### Database engine support

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

##### Ubuntu 22.04 ("Jammy Jellyfish") LTS

The database connector library must be compiled manually for this release,
The database connector library (ODB) must be compiled manually,
however, the database programs themselves should be installed from the
package manager.

##### SQLite

```bash
# For SQLite database systems:
# For Ubuntu 22.04, Ubuntu 24.04:
sudo apt install libsqlite3-dev
```

##### PostgreSQL

# For PostgreSQL database systems:
```bash
# For Ubuntu 22.04:
sudo apt install postgresql-server-dev-14

# For Ubuntu 24.04:
sudo apt install postgresql-server-dev-16
```

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

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

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

# If using Ubuntu 22.04:
export CMAKE_PREFIX_PATH=<thrift_install_dir>:$CMAKE_PREFIX_PATH
export CMAKE_PREFIX_PATH=<odb_install_directory>:$CMAKE_PREFIX_PATH

export PATH=<thrift_install_dir>/bin:$PATH
export PATH=<odb_install_directory>/bin:$PATH
```

Expand Down
7 changes: 5 additions & 2 deletions doc/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ creating and using the database file.
PostgreSQL can be installed from the package manager:

```bash
sudo apt install postgresql-<version>
# (e.g. postgresql-14 for Ubuntu 22.04)
# For Ubuntu 22.04:
sudo apt install postgresql-14

# For Ubuntu 24.04:
sudo apt install postgresql-16
```

This will set up an automatically starting local server on the default port
Expand Down
1 change: 1 addition & 0 deletions model/include/model/buildaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <string>
#include <memory>
#include <vector>
#include <cstdint>

#include <odb/core.hxx>
#include <odb/lazy-ptr.hxx>
Expand Down
1 change: 1 addition & 0 deletions plugins/cpp/model/include/model/cppinheritance.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define CC_MODEL_CPPINHERITANCE_H

#include <memory>
#include <cstdint>
#include "common.h"

namespace cc
Expand Down
Loading