From f2dc0d7dba5e6141e48c3164016e60fd760f269b Mon Sep 17 00:00:00 2001 From: Vladimir Pustovalov Date: Mon, 23 Mar 2026 16:11:01 +0300 Subject: [PATCH 001/135] update gcc to 14.2.0 --- Dockerfile.ci | 5 +- pp/MODULE.bazel | 4 +- pp/bazel/toolchain/BUILD | 88 +------------------ pp/bazel/toolchain/cc_toolchain_config.bzl | 2 +- pp/go/cppbridge/entrypoint.go | 4 +- pp/scripts/test_coredump.sh | 2 +- .../patches/quasis_crypto/0001-md5.hh.patch | 36 +++++++- 7 files changed, 45 insertions(+), 96 deletions(-) diff --git a/Dockerfile.ci b/Dockerfile.ci index f70ecf0cc2..bfd18ccfc2 100644 --- a/Dockerfile.ci +++ b/Dockerfile.ci @@ -1,8 +1,11 @@ FROM ubuntu:24.04 # Base + g++ + git for perf_tests -RUN DEBIAN_FRONTEND=noninteractive && apt-get update && apt-get install -y gpg wget gcc g++ libunwind-dev jq bash nodejs npm bzip2 \ +RUN DEBIAN_FRONTEND=noninteractive && apt-get update && apt-get install -y gpg wget gcc-14 g++-14 libunwind-14-dev jq bash nodejs npm bzip2 \ git autoconf make iproute2 jq curl ca-certificates libtool pkg-config cmake lcov && \ + update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100 && \ + update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100 && \ + update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-14 100 && \ echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main" | tee /etc/apt/sources.list.d/archive_uri-http_apt_llvm_org_jammy_-jammy.list && \ wget -qO - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \ apt-get update && apt-get install -y clang-format-19 clang-tidy-19 && \ diff --git a/pp/MODULE.bazel b/pp/MODULE.bazel index 7dd2143c93..c97519dbfe 100644 --- a/pp/MODULE.bazel +++ b/pp/MODULE.bazel @@ -5,8 +5,8 @@ # For more details, please check https://github.com/bazelbuild/bazel/issues/18958 ############################################################################### register_toolchains( - "//bazel/toolchain:cc_toolchain_for_g++-13_toolchain_aarch64", - "//bazel/toolchain:cc_toolchain_for_g++-13_toolchain_x86_64", + "//bazel/toolchain:cc_toolchain_for_g++-14_toolchain_aarch64", + "//bazel/toolchain:cc_toolchain_for_g++-14_toolchain_x86_64", ) # Hedron's Compile Commands Extractor for Bazel diff --git a/pp/bazel/toolchain/BUILD b/pp/bazel/toolchain/BUILD index c1a4745949..eb723a3368 100644 --- a/pp/bazel/toolchain/BUILD +++ b/pp/bazel/toolchain/BUILD @@ -44,41 +44,15 @@ string_flag( ) cc_toolchain_suite( - name = "g++-13", + name = "g++-14", toolchains = { - "k8": ":g++-13_toolchain_x86_64", - "aarch64": ":g++-13_toolchain_aarch64", + "k8": ":g++-14_toolchain_x86_64", + "aarch64": ":g++-14_toolchain_aarch64", }, ) filegroup(name = "empty") -cc_toolchain( - name = "g++-13_toolchain_x86_64", - all_files = ":empty", - compiler_files = ":empty", - dwp_files = ":empty", - linker_files = ":empty", - objcopy_files = ":empty", - strip_files = ":empty", - supports_param_files = 0, - toolchain_config = ":g++-13_toolchain_config_x86_64", - toolchain_identifier = "g++-13_toolchain", -) - -cc_toolchain( - name = "g++-13_toolchain_aarch64", - all_files = ":empty", - compiler_files = ":empty", - dwp_files = ":empty", - linker_files = ":empty", - objcopy_files = ":empty", - strip_files = ":empty", - supports_param_files = 0, - toolchain_config = ":g++-13_toolchain_config_aarch64", - toolchain_identifier = "g++-13_toolchain", -) - cc_toolchain( name = "g++-14_toolchain_x86_64", all_files = ":empty", @@ -105,34 +79,6 @@ cc_toolchain( toolchain_identifier = "g++-14_toolchain", ) -toolchain( - name = "cc_toolchain_for_g++-13_toolchain_x86_64", - toolchain = ":g++-13_toolchain_x86_64", - toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", - exec_compatible_with = [ - "@platforms//cpu:x86_64", - "@platforms//os:linux", - ], - target_compatible_with = [ - "@platforms//cpu:x86_64", - "@platforms//os:linux", - ], -) - -toolchain( - name = "cc_toolchain_for_g++-13_toolchain_aarch64", - toolchain = ":g++-13_toolchain_aarch64", - toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", - exec_compatible_with = [ - "@platforms//cpu:aarch64", - "@platforms//os:linux", - ], - target_compatible_with = [ - "@platforms//cpu:aarch64", - "@platforms//os:linux", - ], -) - toolchain( name = "cc_toolchain_for_g++-14_toolchain_x86_64", toolchain = ":g++-14_toolchain_x86_64", @@ -161,34 +107,6 @@ toolchain( ], ) -cc_toolchain_config( - name = "g++-13_toolchain_config_x86_64", - builtin_include_directories = [ - "/usr/lib/gcc/x86_64-alpine-linux-musl", - "/usr/lib/gcc/x86_64-linux-gnu/13", - "/usr/include", - "/usr/lib/linux", - ], - march = ":march", - with_asan = ":asan", - with_profiling = ":profiling", - profiling_opts = ":profiling_opts", -) - -cc_toolchain_config( - name = "g++-13_toolchain_config_aarch64", - builtin_include_directories = [ - "/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/include/", - "/usr/lib/gcc/aarch64-linux-gnu/13", - "/usr/include", - "/usr/lib/linux", - ], - march = ":march", - with_asan = ":asan", - with_profiling = ":profiling", - profiling_opts = ":profiling_opts", -) - cc_toolchain_config( name = "g++-14_toolchain_config_x86_64", builtin_include_directories = [ diff --git a/pp/bazel/toolchain/cc_toolchain_config.bzl b/pp/bazel/toolchain/cc_toolchain_config.bzl index 82da70b7f8..88d59317b2 100644 --- a/pp/bazel/toolchain/cc_toolchain_config.bzl +++ b/pp/bazel/toolchain/cc_toolchain_config.bzl @@ -207,7 +207,7 @@ def _impl(ctx): "-l:libstdc++.a", "-lm", "-lunwind", - "-lstdc++_libbacktrace" + "-lstdc++exp" ], ), ]), diff --git a/pp/go/cppbridge/entrypoint.go b/pp/go/cppbridge/entrypoint.go index 2e6c99e29a..2c0d58ef25 100644 --- a/pp/go/cppbridge/entrypoint.go +++ b/pp/go/cppbridge/entrypoint.go @@ -12,8 +12,8 @@ package cppbridge // #cgo amd64,!asan,dbg LDFLAGS: -l:amd64_entrypoint_init_aio_dbg.a -l:amd64_k8_entrypoint_aio_prefixed_dbg.a -l:amd64_nehalem_entrypoint_aio_prefixed_dbg.a -l:amd64_haswell_entrypoint_aio_prefixed_dbg.a // #cgo amd64,asan,!dbg LDFLAGS: -l:amd64_entrypoint_init_aio_opt_asan.a -l:amd64_k8_entrypoint_aio_prefixed_opt_asan.a -l:amd64_nehalem_entrypoint_aio_prefixed_opt_asan.a -l:amd64_haswell_entrypoint_aio_prefixed_opt_asan.a // #cgo amd64,asan,dbg LDFLAGS: -l:amd64_entrypoint_init_aio_dbg_asan.a -l:amd64_k8_entrypoint_aio_prefixed_dbg_asan.a -l:amd64_nehalem_entrypoint_aio_prefixed_dbg_asan.a -l:amd64_haswell_entrypoint_aio_prefixed_dbg_asan.a -// #cgo !static LDFLAGS: -lstdc++ -lm -lgcc_eh -l:libunwind.a -llzma -lstdc++_libbacktrace -// #cgo static LDFLAGS: -static -static-libgcc -static-libstdc++ -l:libstdc++.a -l:libm.a -l:libgcc_eh.a -l:libunwind.a -l:liblzma.a -l:libstdc++_libbacktrace.a +// #cgo !static LDFLAGS: -lstdc++ -lm -lgcc_eh -l:libunwind.a -lstdc++exp +// #cgo static LDFLAGS: -static -static-libgcc -static-libstdc++ -l:libstdc++.a -l:libm.a -l:libgcc_eh.a -l:libunwind.a -l:libstdc++exp.a // #include "entrypoint.h" import "C" //nolint:gocritic // because otherwise it won't work import ( diff --git a/pp/scripts/test_coredump.sh b/pp/scripts/test_coredump.sh index d1377b4777..7e7082eb8b 100755 --- a/pp/scripts/test_coredump.sh +++ b/pp/scripts/test_coredump.sh @@ -33,7 +33,7 @@ OLD_COREDUMP_USE_PID=0 SAVE_COREDUMP=1 SKIP_BUILD_TEST=0 TEST_TARGET_NAME=bare_bones_coredump_test -TEST_BUILD_COMMAND="bazel build --config=g++-13 $TEST_TARGET_NAME" +TEST_BUILD_COMMAND="bazel build --config=g++-14 $TEST_TARGET_NAME" TEST_BINARY=./bazel-bin/$TEST_TARGET_NAME eval set -- "${options}" diff --git a/pp/third_party/patches/quasis_crypto/0001-md5.hh.patch b/pp/third_party/patches/quasis_crypto/0001-md5.hh.patch index 043bec7310..74da29f589 100644 --- a/pp/third_party/patches/quasis_crypto/0001-md5.hh.patch +++ b/pp/third_party/patches/quasis_crypto/0001-md5.hh.patch @@ -1,17 +1,45 @@ --- a/md5.hh +++ b/md5.hh -@@ -36,6 +36,10 @@ +@@ -36,6 +36,11 @@ * Copyright 2022 Quasis - The MIT License */ +#pragma once + +#include ++#include + namespace crypto { template -@@ -180,7 +184,7 @@ namespace crypto { +@@ -154,22 +159,22 @@ namespace crypto { + } + + template constexpr MD5& +- update(const input_type *input, size_type count) noexcept requires (__is_trivially_copyable(input_type)) { ++ update(const input_type *input, size_type count) noexcept requires (std::is_trivially_copyable_v) { + return update(reinterpret_cast(input), sizeof(input_type) * count); + } + + template constexpr MD5& +- update(const input_type (&input)[count]) noexcept requires (__is_trivially_copyable(input_type)) { ++ update(const input_type (&input)[count]) noexcept requires (std::is_trivially_copyable_v) { + return update(reinterpret_cast(input), sizeof(input_type) * count); + } + + template constexpr MD5& +- update(const input_type *begin, const input_type *end) noexcept requires (__is_trivially_copyable(input_type)) { ++ update(const input_type *begin, const input_type *end) noexcept requires (std::is_trivially_copyable_v) { + return update(reinterpret_cast(begin), sizeof(input_type) * (end - begin)); + } + + template constexpr MD5& +- update(const input_type &input) noexcept requires (__is_trivially_copyable(input_type)) { ++ update(const input_type &input) noexcept requires (std::is_trivially_copyable_v) { + return update(reinterpret_cast(&input), sizeof(input_type)); + } + +@@ -180,7 +185,7 @@ namespace crypto { template constexpr MD5& update(const size_type count, input_type &&input) noexcept { @@ -20,7 +48,7 @@ } constexpr output_type -@@ -207,7 +211,7 @@ namespace crypto { +@@ -207,7 +212,7 @@ namespace crypto { static constexpr uint32_type rotl(uint32_type value, int count) noexcept { @@ -29,7 +57,7 @@ } static constexpr word_type -@@ -323,35 +327,3 @@ namespace crypto { +@@ -323,35 +328,3 @@ namespace crypto { return MD5().update(static_cast(input)...).digest(); } } From 76f1d93869b09b67084859e90452f3c6dbd5ff7d Mon Sep 17 00:00:00 2001 From: Vladimir Pustovalov Date: Mon, 23 Mar 2026 19:04:25 +0300 Subject: [PATCH 002/135] update clang-tidy to 21.1.8 --- Dockerfile.ci | 8 ++++---- .../benchmarks/encoding_benchmark.cpp | 17 +++++++++-------- .../benchmarks/stream_v_byte_benchmark.cpp | 18 ++++++++---------- pp/bare_bones/memory.h | 1 + pp/bare_bones/vector.h | 2 ++ pp/prometheus/tsdb/index/stream_writer.h | 11 +++++++++++ .../prometheus/tsdb/index/index_writer.h | 16 ++++++++-------- .../querier/regexp/match_analyzer.h | 2 ++ pp/series_index/trie/cedarpp_tree.h | 4 ++-- 9 files changed, 47 insertions(+), 32 deletions(-) diff --git a/Dockerfile.ci b/Dockerfile.ci index bfd18ccfc2..92cf4cac69 100644 --- a/Dockerfile.ci +++ b/Dockerfile.ci @@ -6,11 +6,11 @@ RUN DEBIAN_FRONTEND=noninteractive && apt-get update && apt-get install -y gpg w update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100 && \ update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100 && \ update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-14 100 && \ - echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main" | tee /etc/apt/sources.list.d/archive_uri-http_apt_llvm_org_jammy_-jammy.list && \ + echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-21 main" | tee /etc/apt/sources.list.d/archive_uri-http_apt_llvm_org_jammy_-jammy.list && \ wget -qO - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \ - apt-get update && apt-get install -y clang-format-19 clang-tidy-19 && \ - ln -s /usr/lib/llvm-19/bin/clang-tidy /usr/bin/clang-tidy && \ - ln -s /usr/lib/llvm-19/bin/clang-format /usr/bin/clang-format + apt-get update && apt-get install -y clang-format-21 clang-tidy-21 && \ + ln -s /usr/lib/llvm-21/bin/clang-tidy /usr/bin/clang-tidy && \ + ln -s /usr/lib/llvm-21/bin/clang-format /usr/bin/clang-format # Bazel ARG BAZEL_VERSION=7.4.1 diff --git a/pp/bare_bones/benchmarks/encoding_benchmark.cpp b/pp/bare_bones/benchmarks/encoding_benchmark.cpp index 4fc2845781..273d3ed147 100644 --- a/pp/bare_bones/benchmarks/encoding_benchmark.cpp +++ b/pp/bare_bones/benchmarks/encoding_benchmark.cpp @@ -26,11 +26,13 @@ const BareBones::Vector& values() { return values; } -template