Skip to content

Commit 6ba0738

Browse files
Merge remote-tracking branch 'origin/master' into improve-test-failed-mutations
2 parents e9ef18c + 948ec2b commit 6ba0738

File tree

558 files changed

+12176
-9217
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

558 files changed

+12176
-9217
lines changed

.clang-tidy

Lines changed: 117 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -5,128 +5,127 @@
55
# a) the new check is not controversial (this includes many checks in readability-* and google-*) or
66
# b) too noisy (checks with > 100 new warnings are considered noisy, this includes e.g. cppcoreguidelines-*).
77

8-
# TODO: Once clang(-tidy) 17 is the minimum, we can convert this list to YAML
9-
# See https://releases.llvm.org/17.0.1/tools/clang/tools/extra/docs/ReleaseNotes.html#improvements-to-clang-tidy
10-
118
# TODO Let clang-tidy check headers in further directories
129
# --> HeaderFilterRegex: '^.*/(src|base|programs|utils)/.*(h|hpp)$'
1310
HeaderFilterRegex: '^.*/(base|programs|utils)/.*(h|hpp)$'
1411

15-
Checks: '*,
16-
-abseil-*,
17-
18-
-altera-*,
19-
20-
-android-*,
21-
22-
-bugprone-assignment-in-if-condition,
23-
-bugprone-branch-clone,
24-
-bugprone-easily-swappable-parameters,
25-
-bugprone-exception-escape,
26-
-bugprone-implicit-widening-of-multiplication-result,
27-
-bugprone-narrowing-conversions,
28-
-bugprone-not-null-terminated-result,
29-
-bugprone-reserved-identifier, # useful but too slow, TODO retry when https://reviews.llvm.org/rG1c282052624f9d0bd273bde0b47b30c96699c6c7 is merged
30-
-bugprone-unchecked-optional-access,
31-
32-
-cert-dcl16-c,
33-
-cert-dcl37-c,
34-
-cert-dcl51-cpp,
35-
-cert-err58-cpp,
36-
-cert-msc32-c,
37-
-cert-msc51-cpp,
38-
-cert-oop54-cpp,
39-
-cert-oop57-cpp,
40-
41-
-clang-analyzer-unix.Malloc,
42-
43-
-cppcoreguidelines-*, # impractical in a codebase as large as ClickHouse, also slow
44-
45-
-darwin-*,
46-
47-
-fuchsia-*,
48-
49-
-google-build-using-namespace,
50-
-google-readability-braces-around-statements,
51-
-google-readability-casting,
52-
-google-readability-function-size,
53-
-google-readability-namespace-comments,
54-
-google-readability-todo,
55-
56-
-hicpp-avoid-c-arrays,
57-
-hicpp-avoid-goto,
58-
-hicpp-braces-around-statements,
59-
-hicpp-explicit-conversions,
60-
-hicpp-function-size,
61-
-hicpp-member-init,
62-
-hicpp-move-const-arg,
63-
-hicpp-multiway-paths-covered,
64-
-hicpp-named-parameter,
65-
-hicpp-no-array-decay,
66-
-hicpp-no-assembler,
67-
-hicpp-no-malloc,
68-
-hicpp-signed-bitwise,
69-
-hicpp-special-member-functions,
70-
-hicpp-uppercase-literal-suffix,
71-
-hicpp-use-auto,
72-
-hicpp-use-emplace,
73-
-hicpp-vararg,
74-
75-
-linuxkernel-*,
76-
77-
-llvm-*,
78-
79-
-llvmlibc-*,
80-
81-
-openmp-*,
82-
83-
-misc-const-correctness,
84-
-misc-include-cleaner, # useful but far too many occurrences
85-
-misc-no-recursion,
86-
-misc-non-private-member-variables-in-classes,
87-
-misc-confusable-identifiers, # useful but slooow
88-
-misc-use-anonymous-namespace,
89-
90-
-modernize-avoid-c-arrays,
91-
-modernize-concat-nested-namespaces,
92-
-modernize-macro-to-enum,
93-
-modernize-pass-by-value,
94-
-modernize-return-braced-init-list,
95-
-modernize-use-auto,
96-
-modernize-use-default-member-init,
97-
-modernize-use-emplace,
98-
-modernize-use-nodiscard,
99-
-modernize-use-override,
100-
-modernize-use-trailing-return-type,
101-
102-
-performance-inefficient-string-concatenation,
103-
-performance-no-int-to-ptr,
104-
-performance-avoid-endl,
105-
-performance-unnecessary-value-param,
106-
107-
-portability-simd-intrinsics,
108-
109-
-readability-avoid-unconditional-preprocessor-if,
110-
-readability-braces-around-statements,
111-
-readability-convert-member-functions-to-static,
112-
-readability-else-after-return,
113-
-readability-function-cognitive-complexity,
114-
-readability-function-size,
115-
-readability-identifier-length,
116-
-readability-identifier-naming, # useful but too slow
117-
-readability-implicit-bool-conversion,
118-
-readability-isolate-declaration,
119-
-readability-magic-numbers,
120-
-readability-named-parameter,
121-
-readability-redundant-declaration,
122-
-readability-simplify-boolean-expr,
123-
-readability-static-accessed-through-instance,
124-
-readability-suspicious-call-argument,
125-
-readability-uppercase-literal-suffix,
126-
-readability-use-anyofallof,
127-
128-
-zircon-*,
129-
'
12+
Checks: [
13+
'*',
14+
15+
'-abseil-*',
16+
17+
'-altera-*',
18+
19+
'-android-*',
20+
21+
'-bugprone-assignment-in-if-condition',
22+
'-bugprone-branch-clone',
23+
'-bugprone-easily-swappable-parameters',
24+
'-bugprone-exception-escape',
25+
'-bugprone-implicit-widening-of-multiplication-result',
26+
'-bugprone-narrowing-conversions',
27+
'-bugprone-not-null-terminated-result',
28+
'-bugprone-reserved-identifier', # useful but too slow, TODO retry when https://reviews.llvm.org/rG1c282052624f9d0bd273bde0b47b30c96699c6c7 is merged
29+
'-bugprone-unchecked-optional-access',
30+
31+
'-cert-dcl16-c',
32+
'-cert-dcl37-c',
33+
'-cert-dcl51-cpp',
34+
'-cert-err58-cpp',
35+
'-cert-msc32-c',
36+
'-cert-msc51-cpp',
37+
'-cert-oop54-cpp',
38+
'-cert-oop57-cpp',
39+
40+
'-clang-analyzer-unix.Malloc',
41+
42+
'-cppcoreguidelines-*', # impractical in a codebase as large as ClickHouse, also slow
43+
44+
'-darwin-*',
45+
46+
'-fuchsia-*',
47+
48+
'-google-build-using-namespace',
49+
'-google-readability-braces-around-statements',
50+
'-google-readability-casting',
51+
'-google-readability-function-size',
52+
'-google-readability-namespace-comments',
53+
'-google-readability-todo',
54+
55+
'-hicpp-avoid-c-arrays',
56+
'-hicpp-avoid-goto',
57+
'-hicpp-braces-around-statements',
58+
'-hicpp-explicit-conversions',
59+
'-hicpp-function-size',
60+
'-hicpp-member-init',
61+
'-hicpp-move-const-arg',
62+
'-hicpp-multiway-paths-covered',
63+
'-hicpp-named-parameter',
64+
'-hicpp-no-array-decay',
65+
'-hicpp-no-assembler',
66+
'-hicpp-no-malloc',
67+
'-hicpp-signed-bitwise',
68+
'-hicpp-special-member-functions',
69+
'-hicpp-uppercase-literal-suffix',
70+
'-hicpp-use-auto',
71+
'-hicpp-use-emplace',
72+
'-hicpp-vararg',
73+
74+
'-linuxkernel-*',
75+
76+
'-llvm-*',
77+
78+
'-llvmlibc-*',
79+
80+
'-openmp-*',
81+
82+
'-misc-const-correctness',
83+
'-misc-include-cleaner', # useful but far too many occurrences
84+
'-misc-no-recursion',
85+
'-misc-non-private-member-variables-in-classes',
86+
'-misc-confusable-identifiers', # useful but slooo
87+
'-misc-use-anonymous-namespace',
88+
89+
'-modernize-avoid-c-arrays',
90+
'-modernize-concat-nested-namespaces',
91+
'-modernize-macro-to-enum',
92+
'-modernize-pass-by-value',
93+
'-modernize-return-braced-init-list',
94+
'-modernize-use-auto',
95+
'-modernize-use-default-member-init',
96+
'-modernize-use-emplace',
97+
'-modernize-use-nodiscard',
98+
'-modernize-use-override',
99+
'-modernize-use-trailing-return-type',
100+
101+
'-performance-inefficient-string-concatenation',
102+
'-performance-no-int-to-ptr',
103+
'-performance-avoid-endl',
104+
'-performance-unnecessary-value-param',
105+
106+
'-portability-simd-intrinsics',
107+
108+
'-readability-avoid-unconditional-preprocessor-if',
109+
'-readability-braces-around-statements',
110+
'-readability-convert-member-functions-to-static',
111+
'-readability-else-after-return',
112+
'-readability-function-cognitive-complexity',
113+
'-readability-function-size',
114+
'-readability-identifier-length',
115+
'-readability-identifier-naming', # useful but too slow
116+
'-readability-implicit-bool-conversion',
117+
'-readability-isolate-declaration',
118+
'-readability-magic-numbers',
119+
'-readability-named-parameter',
120+
'-readability-redundant-declaration',
121+
'-readability-simplify-boolean-expr',
122+
'-readability-static-accessed-through-instance',
123+
'-readability-suspicious-call-argument',
124+
'-readability-uppercase-literal-suffix',
125+
'-readability-use-anyofallof',
126+
127+
'-zircon-*'
128+
]
130129

131130
WarningsAsErrors: '*'
132131

.github/workflows/nightly.yml

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -45,62 +45,3 @@ jobs:
4545
with:
4646
data: "${{ needs.RunConfig.outputs.data }}"
4747
set_latest: true
48-
SonarCloud:
49-
runs-on: [self-hosted, builder]
50-
env:
51-
SONAR_SCANNER_VERSION: 4.8.0.2856
52-
SONAR_SERVER_URL: "https://sonarcloud.io"
53-
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
54-
CC: clang-17
55-
CXX: clang++-17
56-
steps:
57-
- name: Check out repository code
58-
uses: ClickHouse/checkout@v1
59-
with:
60-
clear-repository: true
61-
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
62-
filter: tree:0
63-
submodules: true
64-
- name: Set up JDK 11
65-
uses: actions/setup-java@v1
66-
with:
67-
java-version: 11
68-
- name: Download and set up sonar-scanner
69-
env:
70-
SONAR_SCANNER_DOWNLOAD_URL: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${{ env.SONAR_SCANNER_VERSION }}-linux.zip
71-
run: |
72-
mkdir -p "$HOME/.sonar"
73-
curl -sSLo "$HOME/.sonar/sonar-scanner.zip" "${{ env.SONAR_SCANNER_DOWNLOAD_URL }}"
74-
unzip -o "$HOME/.sonar/sonar-scanner.zip" -d "$HOME/.sonar/"
75-
echo "$HOME/.sonar/sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-linux/bin" >> "$GITHUB_PATH"
76-
- name: Download and set up build-wrapper
77-
env:
78-
BUILD_WRAPPER_DOWNLOAD_URL: ${{ env.SONAR_SERVER_URL }}/static/cpp/build-wrapper-linux-x86.zip
79-
run: |
80-
curl -sSLo "$HOME/.sonar/build-wrapper-linux-x86.zip" "${{ env.BUILD_WRAPPER_DOWNLOAD_URL }}"
81-
unzip -o "$HOME/.sonar/build-wrapper-linux-x86.zip" -d "$HOME/.sonar/"
82-
echo "$HOME/.sonar/build-wrapper-linux-x86" >> "$GITHUB_PATH"
83-
- name: Set Up Build Tools
84-
run: |
85-
sudo apt-get update
86-
sudo apt-get install -yq git cmake ccache ninja-build python3 yasm nasm
87-
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
88-
- name: Run build-wrapper
89-
run: |
90-
mkdir build
91-
cd build
92-
cmake ..
93-
cd ..
94-
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build/
95-
- name: Run sonar-scanner
96-
env:
97-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
98-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
99-
run: |
100-
sonar-scanner \
101-
--define sonar.host.url="${{ env.SONAR_SERVER_URL }}" \
102-
--define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" \
103-
--define sonar.projectKey="ClickHouse_ClickHouse" \
104-
--define sonar.organization="clickhouse-java" \
105-
--define sonar.cfamily.cpp23.enabled=true \
106-
--define sonar.exclusions="**/*.java,**/*.ts,**/*.js,**/*.css,**/*.sql"

.github/workflows/pull_request.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ jobs:
172172
run: |
173173
cd "$GITHUB_WORKSPACE/tests/ci"
174174
python3 finish_check.py
175+
python3 merge_pr.py --check-approved
175176
176177
177178
#############################################################################################

.github/workflows/reusable_build.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ jobs:
4343
runs-on: [self-hosted, '${{inputs.runner_type}}']
4444
steps:
4545
- name: Check out repository code
46-
# WIP: temporary try commit with limited perallelization of checkout
47-
uses: ClickHouse/checkout@0be3f7b3098bae494d3ef5d29d2e0676fb606232
46+
uses: ClickHouse/checkout@v1
4847
with:
4948
clear-repository: true
5049
ref: ${{ fromJson(inputs.data).git_ref }}

CMakeLists.txt

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ option(ENABLE_CHECK_HEAVY_BUILDS "Don't allow C++ translation units to compile t
5656
if (ENABLE_CHECK_HEAVY_BUILDS)
5757
# set DATA (since RSS does not work since 2.6.x+) to 5G
5858
set (RLIMIT_DATA 5000000000)
59-
# set VIRT (RLIMIT_AS) to 10G (DATA*10)
59+
# set VIRT (RLIMIT_AS) to 10G (DATA*2)
6060
set (RLIMIT_AS 10000000000)
6161
# set CPU time limit to 1000 seconds
6262
set (RLIMIT_CPU 1000)
6363

6464
# -fsanitize=memory and address are too heavy
65-
if (SANITIZE)
65+
if (SANITIZE OR SANITIZE_COVERAGE OR WITH_COVERAGE)
6666
set (RLIMIT_DATA 10000000000) # 10G
6767
endif()
6868

@@ -110,11 +110,6 @@ endif()
110110
# - sanitize.cmake
111111
add_library(global-libs INTERFACE)
112112

113-
# We don't want to instrument everything with fuzzer, but only specific targets (see below),
114-
# also, since we build our own llvm, we specifically don't want to instrument
115-
# libFuzzer library itself - it would result in infinite recursion
116-
#include (cmake/fuzzer.cmake)
117-
118113
include (cmake/sanitize.cmake)
119114

120115
option(ENABLE_COLORED_BUILD "Enable colors in compiler output" ON)
@@ -554,7 +549,9 @@ if (ENABLE_RUST)
554549
endif()
555550
endif()
556551

557-
if (CMAKE_BUILD_TYPE_UC STREQUAL "RELWITHDEBINFO" AND NOT SANITIZE AND NOT SANITIZE_COVERAGE AND OS_LINUX AND (ARCH_AMD64 OR ARCH_AARCH64))
552+
if (CMAKE_BUILD_TYPE_UC STREQUAL "RELWITHDEBINFO"
553+
AND NOT SANITIZE AND NOT SANITIZE_COVERAGE AND NOT ENABLE_FUZZING
554+
AND OS_LINUX AND (ARCH_AMD64 OR ARCH_AARCH64))
558555
set(CHECK_LARGE_OBJECT_SIZES_DEFAULT ON)
559556
else ()
560557
set(CHECK_LARGE_OBJECT_SIZES_DEFAULT OFF)
@@ -577,10 +574,7 @@ if (FUZZER)
577574
if (NOT(target_type STREQUAL "INTERFACE_LIBRARY" OR target_type STREQUAL "UTILITY"))
578575
target_compile_options(${target} PRIVATE "-fsanitize=fuzzer-no-link")
579576
endif()
580-
# clickhouse fuzzer isn't working correctly
581-
# initial PR https://github.com/ClickHouse/ClickHouse/pull/27526
582-
#if (target MATCHES ".+_fuzzer" OR target STREQUAL "clickhouse")
583-
if (target_type STREQUAL "EXECUTABLE" AND target MATCHES ".+_fuzzer")
577+
if (target_type STREQUAL "EXECUTABLE" AND (target MATCHES ".+_fuzzer" OR target STREQUAL "clickhouse"))
584578
message(STATUS "${target} instrumented with fuzzer")
585579
target_link_libraries(${target} PUBLIC ch_contrib::fuzzer)
586580
# Add to fuzzers bundle

base/base/coverage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "coverage.h"
22
#include <sys/mman.h>
33

4-
#pragma GCC diagnostic ignored "-Wreserved-identifier"
4+
#pragma clang diagnostic ignored "-Wreserved-identifier"
55

66

77
/// WITH_COVERAGE enables the default implementation of code coverage,

0 commit comments

Comments
 (0)