Skip to content

Commit

Permalink
Address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
aobolensk committed Jan 30, 2025
1 parent 9cb1744 commit 6da0449
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 26 deletions.
6 changes: 4 additions & 2 deletions .github/dockerfiles/ov_build/ubuntu_22_04_x64_cc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ ENV DEBIAN_FRONTEND="noninteractive" \
TZ="Europe/London"

RUN apt-get update && \
apt-get install software-properties-common && \
apt-get install software-properties-common wget && \
add-apt-repository --yes --no-update ppa:git-core/ppa && \
add-apt-repository --yes --no-update "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" && \
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/llvm.asc && \
add-apt-repository --yes --no-update ppa:deadsnakes/ppa && \
apt-get update && \
apt-get install \
Expand All @@ -38,7 +40,7 @@ RUN apt-get update && \
# Compiler \
clang-15 \
# Static analyzer
clang-tidy-15 \
clang-tidy-18 \
# clang-tidy uses clang-format as a dependency
clang-format-15 \
&& \
Expand Down
12 changes: 0 additions & 12 deletions .github/dockerfiles/ov_build/ubuntu_24_04_x64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ RUN apt-get update && \
python3-full \
# For Java API
default-jdk \
# Compiler \
clang-18 \
# Static analyzer
clang-tidy-18 \
# clang-tidy uses clang-format as a dependency
clang-format-18 \
&& \
rm -rf /var/lib/apt/lists/*

Expand All @@ -46,12 +40,6 @@ RUN chmod +x /install_build_dependencies.sh && \
/install_build_dependencies.sh && \
rm -rf /var/lib/apt/lists/*

RUN update-alternatives --install /usr/bin/clang-format clang-format $(which clang-format-18) 100 && \
update-alternatives --set clang-format $(which clang-format-18)

RUN update-alternatives --install /usr/bin/clang-tidy clang-tidy $(which clang-tidy-18) 100 && \
update-alternatives --set clang-tidy $(which clang-tidy-18)

# Install sccache
ARG SCCACHE_VERSION="v0.7.5"
ENV SCCACHE_HOME="/opt/sccache" \
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/ubuntu_24.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,9 @@ jobs:
build-js: true
build-debian-packages: true
build-contrib: true
# clang-tidy static analysis check is enabled as part of collection
# to avoid an additional separate build execution
cmake-options: |-
-G "Ninja Multi-Config" \
-DENABLE_CPPLINT=OFF \
-DENABLE_CLANG_TIDY=ON \
-DENABLE_NCC_STYLE=OFF \
-DENABLE_TESTS=ON \
-DENABLE_STRICT_DEPENDENCIES=OFF \
Expand Down
16 changes: 8 additions & 8 deletions cmake/developer_package/clang_tidy/clang_tidy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
#

if(ENABLE_CLANG_TIDY)
set(CLANG_TIDY_REQUIRED_VERSION 15 CACHE STRING "Minimum clang-tidy version to use")
set(CLANG_TIDY_FILENAME clang-tidy)
set(CLANG_TIDY_REQUIRED_VERSION 18 CACHE STRING "clang-tidy version to use")
set(CLANG_TIDY_FILENAME clang-tidy-${CLANG_TIDY_REQUIRED_VERSION} clang-tidy)
find_host_program(CLANG_TIDY NAMES ${CLANG_TIDY_FILENAME} PATHS ENV PATH)
if(CLANG_TIDY)
execute_process(COMMAND ${CLANG_TIDY} --version OUTPUT_VARIABLE CLANG_VERSION)
execute_process(COMMAND ${CLANG_TIDY} ${CMAKE_CURRENT_SOURCE_DIR} ARGS --version OUTPUT_VARIABLE CLANG_VERSION)
if(NOT CLANG_VERSION)
message(WARNING "Minimum supported clang-tidy version is ${CLANG_TIDY_REQUIRED_VERSION}!")
message(WARNING "Supported clang-tidy version is ${CLANG_TIDY_REQUIRED_VERSION}!")
set(ENABLE_CLANG_TIDY OFF)
else()
string(REGEX REPLACE ".*version ([0-9]+)\\..*" "\\1" CLANG_TIDY_MAJOR_VERSION ${CLANG_VERSION})
if(CLANG_TIDY_MAJOR_VERSION LESS CLANG_TIDY_REQUIRED_VERSION)
message(WARNING "Minimum supported clang-tidy version is ${CLANG_TIDY_REQUIRED_VERSION}! Provided version ${CLANG_TIDY_MAJOR_VERSION}")
string(REGEX REPLACE "[^0-9]+([0-9]+)\\..*" "\\1" CLANG_TIDY_MAJOR_VERSION ${CLANG_VERSION})
if(NOT CLANG_TIDY_MAJOR_VERSION EQUAL CLANG_TIDY_REQUIRED_VERSION)
message(WARNING "Supported clang-tidy version is ${CLANG_TIDY_REQUIRED_VERSION}! Provided version ${CLANG_TIDY_MAJOR_VERSION}")
set(ENABLE_CLANG_TIDY OFF)
endif()
endif()
else()
message(WARNING "clang-tidy is not found!")
message(WARNING "Supported clang-tidy-${CLANG_TIDY_REQUIRED_VERSION} is not found!")
set(ENABLE_CLANG_TIDY OFF)
endif()
endif()
2 changes: 1 addition & 1 deletion cmake/developer_package/plugins/plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function(ov_add_plugin)
if (OV_PLUGIN_ADD_CLANG_TIDY)
if (ENABLE_CLANG_TIDY)
set_target_properties(${OV_PLUGIN_NAME} PROPERTIES
CXX_CLANG_TIDY "clang-tidy;--extra-arg=-Wno-unused-command-line-argument")
CXX_CLANG_TIDY "clang-tidy-${CLANG_TIDY_REQUIRED_VERSION};--extra-arg=-Wno-unused-command-line-argument")
endif()
endif()

Expand Down

0 comments on commit 6da0449

Please sign in to comment.