Upgrade clang compiler in CI builds (#6861)

This commit is contained in:
Dennis Luxen 2024-05-06 18:12:17 +02:00 committed by GitHub
parent 6d361ced41
commit 99809e105c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 52 additions and 33 deletions

View File

@ -170,17 +170,27 @@ jobs:
OSRM_CONNECTION_RETRIES: 10 OSRM_CONNECTION_RETRIES: 10
OSRM_CONNECTION_EXP_BACKOFF_COEF: 1.5 OSRM_CONNECTION_EXP_BACKOFF_COEF: 1.5
- name: clang-6.0-debug - name: clang-15-release
continue-on-error: false continue-on-error: false
node: 18 node: 18
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
BUILD_TOOLS: ON BUILD_TOOLS: ON
BUILD_TYPE: Debug BUILD_TYPE: Release
CCOMPILER: clang-6.0 CCOMPILER: clang-15
CXXCOMPILER: clang++-6.0 CXXCOMPILER: clang++-15
CUCUMBER_TIMEOUT: 60000 CUCUMBER_TIMEOUT: 60000
- name: clang-15.0-debug-clang-tidy - name: clang-15-debug
continue-on-error: false
node: 18
runs-on: ubuntu-22.04
BUILD_TOOLS: ON
BUILD_TYPE: Debug
CCOMPILER: clang-15
CXXCOMPILER: clang++-15
CUCUMBER_TIMEOUT: 60000
- name: clang-15-debug-clang-tidy
continue-on-error: false continue-on-error: false
node: 18 node: 18
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
@ -191,25 +201,45 @@ jobs:
CUCUMBER_TIMEOUT: 60000 CUCUMBER_TIMEOUT: 60000
ENABLE_CLANG_TIDY: ON ENABLE_CLANG_TIDY: ON
- name: clang-14-release
continue-on-error: false
node: 18
runs-on: ubuntu-22.04
BUILD_TOOLS: ON
BUILD_TYPE: Release
CCOMPILER: clang-14
CXXCOMPILER: clang++-14
CUCUMBER_TIMEOUT: 60000
- name: clang-13-release
continue-on-error: false
node: 18
runs-on: ubuntu-22.04
BUILD_TOOLS: ON
BUILD_TYPE: Release
CCOMPILER: clang-13
CXXCOMPILER: clang++-13
CUCUMBER_TIMEOUT: 60000
- name: conan-linux-debug-asan-ubsan - name: conan-linux-debug-asan-ubsan
continue-on-error: false continue-on-error: false
node: 18 node: 18
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
BUILD_TOOLS: ON BUILD_TOOLS: ON
BUILD_TYPE: Release BUILD_TYPE: Release
CCOMPILER: clang-11 CCOMPILER: clang-15
CXXCOMPILER: clang++-11 CXXCOMPILER: clang++-15
ENABLE_CONAN: ON ENABLE_CONAN: ON
ENABLE_SANITIZER: ON ENABLE_SANITIZER: ON
- name: conan-linux-release - name: conan-linux-release
continue-on-error: false continue-on-error: false
node: 18 node: 18
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
BUILD_TOOLS: ON BUILD_TOOLS: ON
BUILD_TYPE: Release BUILD_TYPE: Release
CCOMPILER: clang-6.0 CCOMPILER: clang-15
CXXCOMPILER: clang++-6.0 CXXCOMPILER: clang++-15
ENABLE_CONAN: ON ENABLE_CONAN: ON
- name: gcc-12-release - name: gcc-12-release
@ -279,10 +309,10 @@ jobs:
build_node_package: true build_node_package: true
continue-on-error: false continue-on-error: false
node: 20 node: 20
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
BUILD_TYPE: Release BUILD_TYPE: Release
CCOMPILER: clang-6.0 CCOMPILER: clang-13
CXXCOMPILER: clang++-6.0 CXXCOMPILER: clang++-13
ENABLE_CONAN: ON ENABLE_CONAN: ON
NODE_PACKAGE_TESTS_ONLY: ON NODE_PACKAGE_TESTS_ONLY: ON
@ -290,10 +320,10 @@ jobs:
build_node_package: true build_node_package: true
continue-on-error: false continue-on-error: false
node: 20 node: 20
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
BUILD_TYPE: Debug BUILD_TYPE: Debug
CCOMPILER: clang-6.0 CCOMPILER: clang-13
CXXCOMPILER: clang++-6.0 CXXCOMPILER: clang++-13
ENABLE_CONAN: ON ENABLE_CONAN: ON
NODE_PACKAGE_TESTS_ONLY: ON NODE_PACKAGE_TESTS_ONLY: ON
@ -415,17 +445,6 @@ jobs:
brew install ccache brew install ccache
fi fi
# clang
if [[ "${CCOMPILER}" == "clang-6.0" ]]; then
sudo apt-get update -y && sudo apt-get install clang++-6
elif [[ "${CCOMPILER}" == "clang-15" ]]; then
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update -y && sudo apt-get install software-properties-common
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main'
sudo apt-get update -y && sudo apt-get install clang++-15 clang-tidy-15
sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-15 100000
fi
# Linux dev packages # Linux dev packages
if [ "${TARGET_ARCH}" != "i686" ] && [ "${ENABLE_CONAN}" != "ON" ]; then if [ "${TARGET_ARCH}" != "i686" ] && [ "${ENABLE_CONAN}" != "ON" ]; then
sudo apt-get update -y sudo apt-get update -y

View File

@ -42,7 +42,7 @@ if (ENABLE_CLANG_TIDY)
message(FATAL_ERROR "ENABLE_CLANG_TIDY is ON but clang-tidy is not found!") message(FATAL_ERROR "ENABLE_CLANG_TIDY is ON but clang-tidy is not found!")
else() else()
message(STATUS "Found clang-tidy at ${CLANG_TIDY_COMMAND}") message(STATUS "Found clang-tidy at ${CLANG_TIDY_COMMAND}")
set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND};--warnings-as-errors=*") set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND};--warnings-as-errors=*;--header-filter=.*")
endif() endif()
endif() endif()

View File

@ -71,7 +71,7 @@ trimLaneString(std::string lane_string, std::int32_t count_left, std::int32_t co
OSRM_ATTR_WARN_UNUSED OSRM_ATTR_WARN_UNUSED
inline std::string applyAccessTokens(std::string lane_string, const std::string &access_tokens) inline std::string applyAccessTokens(std::string lane_string, const std::string &access_tokens)
{ {
typedef boost::tokenizer<boost::char_separator<char>> tokenizer; using tokenizer = boost::tokenizer<boost::char_separator<char>>;
boost::char_separator<char> sep("|", "", boost::keep_empty_tokens); boost::char_separator<char> sep("|", "", boost::keep_empty_tokens);
tokenizer tokens(lane_string, sep); tokenizer tokens(lane_string, sep);
tokenizer access(access_tokens, sep); tokenizer access(access_tokens, sep);

View File

@ -242,7 +242,7 @@ void ExtractorCallbacks::ProcessWay(const osmium::Way &input_way, const Extracti
TurnLaneDescription lane_description; TurnLaneDescription lane_description;
typedef boost::tokenizer<boost::char_separator<char>> tokenizer; using tokenizer = boost::tokenizer<boost::char_separator<char>>;
boost::char_separator<char> sep("|", "", boost::keep_empty_tokens); boost::char_separator<char> sep("|", "", boost::keep_empty_tokens);
boost::char_separator<char> inner_sep(";", ""); boost::char_separator<char> inner_sep(";", "");
tokenizer tokens(lane_string, sep); tokenizer tokens(lane_string, sep);

View File

@ -62,7 +62,7 @@ bool TurnLaneData::operator<(const TurnLaneData &other) const
LaneDataVector laneDataFromDescription(const TurnLaneDescription &turn_lane_description) LaneDataVector laneDataFromDescription(const TurnLaneDescription &turn_lane_description)
{ {
typedef std::unordered_map<TurnLaneType::Mask, std::pair<LaneID, LaneID>> LaneMap; using LaneMap = std::unordered_map<TurnLaneType::Mask, std::pair<LaneID, LaneID>>;
// TODO need to handle cases that have none-in between two identical values // TODO need to handle cases that have none-in between two identical values
const auto num_lanes = boost::numeric_cast<LaneID>(turn_lane_description.size()); const auto num_lanes = boost::numeric_cast<LaneID>(turn_lane_description.size());