diff --git a/.github/scripts/ubuntu-24.04/compile_build.sh b/.github/scripts/ubuntu-24.04/compile_build.sh new file mode 100755 index 000000000..44a16b63e --- /dev/null +++ b/.github/scripts/ubuntu-24.04/compile_build.sh @@ -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 \ No newline at end of file diff --git a/.github/scripts/ubuntu-24.04/download_build.sh b/.github/scripts/ubuntu-24.04/download_build.sh new file mode 100755 index 000000000..d032e4c4e --- /dev/null +++ b/.github/scripts/ubuntu-24.04/download_build.sh @@ -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" \ No newline at end of file diff --git a/.github/scripts/ubuntu-24.04/postcompile_build.sh b/.github/scripts/ubuntu-24.04/postcompile_build.sh new file mode 100755 index 000000000..c33212c69 --- /dev/null +++ b/.github/scripts/ubuntu-24.04/postcompile_build.sh @@ -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 \ No newline at end of file diff --git a/.github/scripts/ubuntu-24.04/setup_build.sh b/.github/scripts/ubuntu-24.04/setup_build.sh new file mode 100755 index 000000000..f3dca6def --- /dev/null +++ b/.github/scripts/ubuntu-24.04/setup_build.sh @@ -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 diff --git a/.github/scripts/ubuntu-24.04/setup_postgresql.sh b/.github/scripts/ubuntu-24.04/setup_postgresql.sh new file mode 100755 index 000000000..e0664d5e6 --- /dev/null +++ b/.github/scripts/ubuntu-24.04/setup_postgresql.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +# Install PostgreSQL +sudo apt-get install postgresql-server-dev-16 diff --git a/.github/scripts/ubuntu-24.04/setup_sqlite3.sh b/.github/scripts/ubuntu-24.04/setup_sqlite3.sh new file mode 100755 index 000000000..4170c6062 --- /dev/null +++ b/.github/scripts/ubuntu-24.04/setup_sqlite3.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +# Install SQLite3 +sudo apt-get install libsqlite3-dev \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 48364ba96..194e879d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 }} @@ -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 }} diff --git a/doc/deps.md b/doc/deps.md index a0bb431bc..0159d90c1 100644 --- a/doc/deps.md +++ b/doc/deps.md @@ -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). @@ -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 @@ -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 @@ -186,11 +202,7 @@ seen by CMake. Please set this environment before executing the build. # For all supported OS versions: export GTEST_ROOT= -# If using Ubuntu 22.04: -export CMAKE_PREFIX_PATH=:$CMAKE_PREFIX_PATH export CMAKE_PREFIX_PATH=:$CMAKE_PREFIX_PATH - -export PATH=/bin:$PATH export PATH=/bin:$PATH ``` diff --git a/doc/usage.md b/doc/usage.md index bd0b10af9..491f2a67d 100644 --- a/doc/usage.md +++ b/doc/usage.md @@ -18,8 +18,11 @@ creating and using the database file. PostgreSQL can be installed from the package manager: ```bash -sudo apt install postgresql- -# (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 diff --git a/model/include/model/buildaction.h b/model/include/model/buildaction.h index 382ca817a..7802debf9 100644 --- a/model/include/model/buildaction.h +++ b/model/include/model/buildaction.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #include diff --git a/plugins/cpp/model/include/model/cppinheritance.h b/plugins/cpp/model/include/model/cppinheritance.h index 286b378f5..726f6db03 100644 --- a/plugins/cpp/model/include/model/cppinheritance.h +++ b/plugins/cpp/model/include/model/cppinheritance.h @@ -2,6 +2,7 @@ #define CC_MODEL_CPPINHERITANCE_H #include +#include #include "common.h" namespace cc