Update toolchain to v3 (#189)

* Make memgraph buildable with new toolchain

* Use toolchain v3 in workflows
This commit is contained in:
antonio2368 2021-07-08 14:20:48 +02:00 committed by GitHub
parent 7776160836
commit e51954fc94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 94 additions and 79 deletions

View File

@ -23,7 +23,7 @@ jobs:
- name: Build release binaries
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Initialize dependencies.
./init

View File

@ -26,7 +26,7 @@ jobs:
- name: Build community binaries
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Initialize dependencies.
./init
@ -39,7 +39,7 @@ jobs:
- name: Run unit tests
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Run unit tests.
cd build
@ -53,7 +53,7 @@ jobs:
- name: Create community DEB package
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
cd build
@ -88,7 +88,7 @@ jobs:
- name: Build combined ASAN, UBSAN and coverage binaries
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Initialize dependencies.
./init
@ -100,7 +100,7 @@ jobs:
- name: Run unit tests
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Run unit tests. It is restricted to 2 threads intentionally, because higher concurrency makes the timing related tests unstable.
cd build
@ -109,7 +109,7 @@ jobs:
- name: Compute code coverage
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Compute code coverage.
cd tools/github
@ -127,7 +127,7 @@ jobs:
- name: Run clang-tidy
run: |
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Restrict clang-tidy results only to the modified parts
git diff -U0 master... -- src ':!*.hpp' | ./tools/github/clang-tidy/clang-tidy-diff.py -p 1 -j $THREADS -path build | tee ./build/clang_tidy_output.txt
@ -152,7 +152,7 @@ jobs:
- name: Build debug binaries
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Initialize dependencies.
./init
@ -165,7 +165,7 @@ jobs:
- name: Run leftover CTest tests
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Run leftover CTest tests (all except unit and benchmark tests).
cd build
@ -197,7 +197,7 @@ jobs:
- name: Run cppcheck and clang-format
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Run cppcheck and clang-format.
cd tools/github
@ -226,7 +226,7 @@ jobs:
- name: Build release binaries
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Initialize dependencies.
./init
@ -277,7 +277,7 @@ jobs:
- name: Create enterprise DEB package
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
cd build
@ -322,7 +322,7 @@ jobs:
- name: Build release binaries
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Initialize dependencies.
./init
@ -361,7 +361,7 @@ jobs:
- name: Build release binaries
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Initialize dependencies.
./init

View File

@ -21,7 +21,7 @@ jobs:
- name: Build debug binaries
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Initialize dependencies.
./init
@ -34,10 +34,10 @@ jobs:
- name: Run clang-tidy
run: |
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# The results are also written to standard output in order to retain them in the logs
./tools/github/clang-tidy/run-clang-tidy.py -p build -j $THREADS -clang-tidy-binary=/opt/toolchain-v2/bin/clang-tidy "$PWD/src/*" |
./tools/github/clang-tidy/run-clang-tidy.py -p build -j $THREADS -clang-tidy-binary=/opt/toolchain-v3/bin/clang-tidy "$PWD/src/*" |
tee ./build/full_clang_tidy_output.txt
- name: Summarize clang-tidy results

View File

@ -24,7 +24,7 @@ jobs:
- name: Build community binaries
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Initialize dependencies.
./init
@ -37,7 +37,7 @@ jobs:
- name: Create community RPM package
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
cd build
@ -59,7 +59,7 @@ jobs:
- name: Run unit tests
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Run unit tests.
cd build
@ -92,7 +92,7 @@ jobs:
- name: Build coverage binaries
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Initialize dependencies.
./init
@ -105,7 +105,7 @@ jobs:
- name: Run unit tests
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Run unit tests.
cd build
@ -114,7 +114,7 @@ jobs:
- name: Compute code coverage
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Compute code coverage.
cd tools/github
@ -147,7 +147,7 @@ jobs:
- name: Build debug binaries
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Initialize dependencies.
./init
@ -160,7 +160,7 @@ jobs:
- name: Run leftover CTest tests
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Run leftover CTest tests (all except unit and benchmark tests).
cd build
@ -192,7 +192,7 @@ jobs:
- name: Run cppcheck and clang-format
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Run cppcheck and clang-format.
cd tools/github
@ -222,7 +222,7 @@ jobs:
- name: Build release binaries
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Initialize dependencies.
./init
@ -235,7 +235,7 @@ jobs:
- name: Create enterprise RPM package
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
cd build
@ -257,7 +257,7 @@ jobs:
- name: Run micro benchmark tests
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Run micro benchmark tests.
cd build

View File

@ -24,7 +24,7 @@ jobs:
- name: Build community binaries
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Initialize dependencies.
./init
@ -37,7 +37,7 @@ jobs:
- name: Create community DEB package
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
cd build
@ -58,7 +58,7 @@ jobs:
- name: Run unit tests
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Run unit tests.
cd build
@ -91,7 +91,7 @@ jobs:
- name: Build coverage binaries
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Initialize dependencies.
./init
@ -104,7 +104,7 @@ jobs:
- name: Run unit tests
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Run unit tests.
cd build
@ -113,7 +113,7 @@ jobs:
- name: Compute code coverage
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Compute code coverage.
cd tools/github
@ -146,7 +146,7 @@ jobs:
- name: Build debug binaries
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Initialize dependencies.
./init
@ -159,7 +159,7 @@ jobs:
- name: Run leftover CTest tests
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Run leftover CTest tests (all except unit and benchmark tests).
cd build
@ -191,7 +191,7 @@ jobs:
- name: Run cppcheck and clang-format
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Run cppcheck and clang-format.
cd tools/github
@ -221,7 +221,7 @@ jobs:
- name: Build release binaries
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Initialize dependencies.
./init
@ -234,7 +234,7 @@ jobs:
- name: Create enterprise DEB package
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
cd build
@ -255,7 +255,7 @@ jobs:
- name: Run micro benchmark tests
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Run micro benchmark tests.
cd build
@ -345,7 +345,7 @@ jobs:
- name: Build release binaries
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Initialize dependencies.
./init

View File

@ -24,7 +24,7 @@ jobs:
- name: Build community binaries
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Initialize dependencies.
./init
@ -37,7 +37,7 @@ jobs:
- name: Create community DEB package
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
cd build
@ -58,7 +58,7 @@ jobs:
- name: Run unit tests
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Run unit tests.
cd build
@ -91,7 +91,7 @@ jobs:
- name: Build coverage binaries
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Initialize dependencies.
./init
@ -104,7 +104,7 @@ jobs:
- name: Run unit tests
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Run unit tests.
cd build
@ -113,7 +113,7 @@ jobs:
- name: Compute code coverage
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Compute code coverage.
cd tools/github
@ -146,7 +146,7 @@ jobs:
- name: Build debug binaries
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Initialize dependencies.
./init
@ -159,7 +159,7 @@ jobs:
- name: Run leftover CTest tests
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Run leftover CTest tests (all except unit and benchmark tests).
cd build
@ -191,7 +191,7 @@ jobs:
- name: Run cppcheck and clang-format
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Run cppcheck and clang-format.
cd tools/github
@ -221,7 +221,7 @@ jobs:
- name: Build release binaries
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Initialize dependencies.
./init
@ -234,7 +234,7 @@ jobs:
- name: Create enterprise DEB package
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
cd build
@ -255,7 +255,7 @@ jobs:
- name: Run micro benchmark tests
run: |
# Activate toolchain.
source /opt/toolchain-v2/activate
source /opt/toolchain-v3/activate
# Run micro benchmark tests.
cd build

View File

@ -111,7 +111,7 @@ install() {
# within GDB yet (an assumption).
if [ "$pkg" == libbabeltrace-devel ]; then
if ! dnf list installed libbabeltrace-devel >/dev/null 2>/dev/null; then
dnf install -y http://repo.okay.com.mx/centos/8/x86_64/release/libbabeltrace-devel-1.5.4-2.el8.x86_64.rpm
dnf install -y http://mirror.centos.org/centos/8/PowerTools/x86_64/os/Packages/libbabeltrace-devel-1.5.4-3.el8.x86_64.rpm
fi
continue
fi

View File

@ -14,19 +14,20 @@ DISTRO="$(operating_system)"
TOOLCHAIN_VERSION=3
# package versions used
GCC_VERSION=10.2.0
BINUTILS_VERSION=2.35.1
GCC_VERSION=11.1.0
BINUTILS_VERSION=2.36.1
case "$DISTRO" in
centos-7) # because GDB >= 9 does NOT compile with readline6.
GDB_VERSION=8.3
;;
*)
GDB_VERSION=10.1
GDB_VERSION=10.2
;;
esac
CMAKE_VERSION=3.18.4
CPPCHECK_VERSION=2.2
LLVM_VERSION=11.0.0
CMAKE_VERSION=3.20.5
CPPCHECK_VERSION=2.4.1
LLVM_VERSION=12.0.1rc4
LLVM_VERSION_LONG=12.0.1-rc4
SWIG_VERSION=4.0.2 # used only for LLVM compilation
# Check for the dependencies.
@ -84,11 +85,12 @@ if [ ! -f cppcheck-$CPPCHECK_VERSION.tar.gz ]; then
wget https://github.com/danmar/cppcheck/archive/$CPPCHECK_VERSION.tar.gz -O cppcheck-$CPPCHECK_VERSION.tar.gz
fi
if [ ! -f llvm-$LLVM_VERSION.src.tar.xz ]; then
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION/llvm-$LLVM_VERSION.src.tar.xz
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION/clang-$LLVM_VERSION.src.tar.xz
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION/lld-$LLVM_VERSION.src.tar.xz
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION/clang-tools-extra-$LLVM_VERSION.src.tar.xz
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION/compiler-rt-$LLVM_VERSION.src.tar.xz
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION_LONG/llvm-$LLVM_VERSION.src.tar.xz
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION_LONG/clang-$LLVM_VERSION.src.tar.xz
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION_LONG/lld-$LLVM_VERSION.src.tar.xz
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION_LONG/clang-tools-extra-$LLVM_VERSION.src.tar.xz
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION_LONG/compiler-rt-$LLVM_VERSION.src.tar.xz
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION_LONG/libunwind-$LLVM_VERSION.src.tar.xz
fi
if [ ! -f pahole-gdb-master.zip ]; then
wget https://github.com/PhilArmstrong/pahole-gdb/archive/master.zip -O pahole-gdb-master.zip
@ -101,6 +103,7 @@ fi
# signed the archive and download their public key instead.
GPG="gpg --homedir .gnupg"
KEYSERVER="hkp://keyserver.ubuntu.com"
mkdir -p .gnupg
chmod 700 .gnupg
# verify gcc
@ -108,7 +111,7 @@ if [ ! -f gcc-$GCC_VERSION.tar.gz.sig ]; then
wget https://ftp.gnu.org/gnu/gcc/gcc-$GCC_VERSION/gcc-$GCC_VERSION.tar.gz.sig
fi
# list of valid gcc gnupg keys: https://gcc.gnu.org/mirrors.html
$GPG --keyserver $KEYSERVER --recv-keys 0x3AB00996FC26A641
$GPG --keyserver $KEYSERVER --recv-keys 0x6C35B99309B5FA62
$GPG --verify gcc-$GCC_VERSION.tar.gz.sig gcc-$GCC_VERSION.tar.gz
# verify binutils
if [ ! -f binutils-$BINUTILS_VERSION.tar.gz.sig ]; then
@ -135,19 +138,21 @@ sha256sum -c cmake-$CMAKE_VERSION-SHA-256-filtered.txt
$GPG --verify cmake-$CMAKE_VERSION-SHA-256.txt.asc cmake-$CMAKE_VERSION-SHA-256.txt
# verify llvm, cfe, lld, clang-tools-extra
if [ ! -f llvm-$LLVM_VERSION.src.tar.xz.sig ]; then
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION/llvm-$LLVM_VERSION.src.tar.xz.sig
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION/clang-$LLVM_VERSION.src.tar.xz.sig
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION/lld-$LLVM_VERSION.src.tar.xz.sig
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION/clang-tools-extra-$LLVM_VERSION.src.tar.xz.sig
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION/compiler-rt-$LLVM_VERSION.src.tar.xz.sig
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION_LONG/llvm-$LLVM_VERSION.src.tar.xz.sig
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION_LONG/clang-$LLVM_VERSION.src.tar.xz.sig
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION_LONG/lld-$LLVM_VERSION.src.tar.xz.sig
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION_LONG/clang-tools-extra-$LLVM_VERSION.src.tar.xz.sig
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION_LONG/compiler-rt-$LLVM_VERSION.src.tar.xz.sig
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION_LONG/libunwind-$LLVM_VERSION.src.tar.xz.sig
fi
# list of valid llvm gnupg keys: https://releases.llvm.org/download.html
$GPG --keyserver $KEYSERVER --recv-keys 0x345AD05D
$GPG --keyserver $KEYSERVER --recv-keys 0x474E22316ABF4785A88C6E8EA2C794A986419D8A
$GPG --verify llvm-$LLVM_VERSION.src.tar.xz.sig llvm-$LLVM_VERSION.src.tar.xz
$GPG --verify clang-$LLVM_VERSION.src.tar.xz.sig clang-$LLVM_VERSION.src.tar.xz
$GPG --verify lld-$LLVM_VERSION.src.tar.xz.sig lld-$LLVM_VERSION.src.tar.xz
$GPG --verify clang-tools-extra-$LLVM_VERSION.src.tar.xz.sig clang-tools-extra-$LLVM_VERSION.src.tar.xz
$GPG --verify compiler-rt-$LLVM_VERSION.src.tar.xz.sig compiler-rt-$LLVM_VERSION.src.tar.xz
$GPG --verify libunwind-$LLVM_VERSION.src.tar.xz.sig libunwind-$LLVM_VERSION.src.tar.xz
popd
# create build directory
@ -345,6 +350,9 @@ if [ ! -f $PREFIX/bin/cppcheck ]; then
fi
tar -xvf ../archives/cppcheck-$CPPCHECK_VERSION.tar.gz
pushd cppcheck-$CPPCHECK_VERSION
# this was fixed in cppcheck 2.5, remove this in toolchain-v4 after the lib is updated
# to 2.5+ version.
sed -i '/#include <iostream>/ a #include <limits>' lib/symboldatabase.cpp
env \
CC=gcc \
CXX=g++ \
@ -393,6 +401,8 @@ if [ ! -f $PREFIX/bin/clang ]; then
mv clang-tools-extra-$LLVM_VERSION.src/ llvm-$LLVM_VERSION/tools/clang/tools/extra
tar -xvf ../archives/compiler-rt-$LLVM_VERSION.src.tar.xz
mv compiler-rt-$LLVM_VERSION.src/ llvm-$LLVM_VERSION/projects/compiler-rt
tar -xvf ../archives/libunwind-$LLVM_VERSION.src.tar.xz
mv libunwind-$LLVM_VERSION.src/include/mach-o llvm-$LLVM_VERSION/tools/lld/include
pushd llvm-$LLVM_VERSION
mkdir build && pushd build
# activate swig

View File

@ -151,6 +151,10 @@ repo_clone_try_double "${primary_urls[antlr4-code]}" "${secondary_urls[antlr4-co
sed -i 's/install(TARGETS antlr4_shared/install(TARGETS antlr4_shared OPTIONAL/' antlr4/runtime/Cpp/runtime/CMakeLists.txt
# fix issue https://github.com/antlr/antlr4/issues/3194 - should update Antlr commit once the PR related to the issue gets merged
sed -i 's/std::is_nothrow_copy_constructible/std::is_copy_constructible/' antlr4/runtime/Cpp/runtime/src/support/Any.h
# replace the utf8cpp version which is used because the older one uses gtest that doesn't
# compile with the newer compilers because of uninitialized variable
# the newer utf8cpp switched to ftest
sed -i 's/v3.1.1/v3.2.1/' antlr4/runtime/Cpp/runtime/CMakeLists.txt
# cppitertools v2.0 2019-12-23
cppitertools_ref="cb3635456bdb531121b82b4d2e3afc7ae1f56d47"

View File

@ -1,5 +1,6 @@
#pragma once
#include <functional>
#include <type_traits>
#include "utils/cast.hpp"

View File

@ -6,12 +6,14 @@
#else
#define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_OFF
#endif
#include <spdlog/fmt/ostr.h>
#include <spdlog/sinks/stdout_color_sinks.h>
#include <spdlog/spdlog.h>
#include <array>
#include <cstdint>
#include <filesystem>
#include <optional>
#include <spdlog/fmt/ostr.h>
#include <spdlog/sinks/stdout_color_sinks.h>
#include <spdlog/spdlog.h>
#include "utils/likely.hpp"

View File

@ -1,6 +1,5 @@
#include <chrono>
#include <random>
#include <ranges>
#include <thread>
#include <unordered_set>

View File

@ -1,7 +1,6 @@
#include <chrono>
#include <fstream>
#include <random>
#include <ranges>
#include <thread>
#include <fmt/format.h>