Repository navigation
Use clang-23 - #117346
Use clang-23#117346
clang-23#117346Conversation
Bump the CI toolchain, docker images, toolchain build job and build docs from clang-22 to clang-23 (apt.llvm.org ships 1:23.1.0~ snapshots for amd64 and arm64; llvm-project has the release/23.x branch). Co-Authored-By: Claude Fable 5 <[email protected]>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
|
Workflow [PR], commit [b9473fd] Summary: ✅
AI ReviewSummaryReviewed head Findings
Missing context / blind spots
Final VerdictLLVM Coverage ReportMeasured on commit b9473fd.
Changed lines: Changed C/C++ lines covered: 316/340 (92.94%) · Uncovered code |
`cctools-port`'s configure copies the system LLVM's `llvm-c/lto.h` (and
`ExternC.h`) over its bundled headers, but since LLVM 23 `lto.h` also
includes `llvm-c/Visibility.h`, which configure does not copy, failing
the compilation of `libstuff_la-lto.lo` with:
../include/llvm-c/lto.h:20:10: fatal error: 'llvm-c/Visibility.h' file not found
Copy it next to the bundled headers before running configure.
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=117346&sha=bbeba6209f488d4af4283f708a8c2116470820ce&name_0=PR&name_1=Dockers%20Build%20%28arm%29
#117346
Co-Authored-By: Claude Fable 5 <[email protected]>
LLVM 23's `llvm-c/Visibility.h` includes `llvm/Config/llvm-config.h`
(a self-contained header with only defines), failing the cctools build
with:
../include/llvm-c/Visibility.h:19:10: fatal error: 'llvm/Config/llvm-config.h' file not found
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=117346&sha=ab1ed9bbc156d200fb4631e43ebfeb5437c4be66&name_0=PR&name_1=Dockers%20Build%20%28amd%29
#117346
Co-Authored-By: Claude Fable 5 <[email protected]>
apt.llvm.org does not publish llvm-toolchain-jammy-23 (jammy stops at
LLVM 22), so the `test-base` image failed with:
E: The repository 'https://apt.llvm.org/jammy llvm-toolchain-jammy-23 Release' does not have a Release file.
The fasttest image is already on ubuntu:24.04 (noble), which has the
LLVM 23 repository. The deadsnakes and Kitware repositories key off
`lsb_release -cs` and both publish noble packages.
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=117346&sha=f084c9c909095b513039e161c135a4bbb9f2a6dd&name_0=PR&name_1=Dockers%20Build%20%28arm%29
#117346
Co-Authored-By: Claude Fable 5 <[email protected]>
Verified by building test-base and all its children locally: - fuzzer: the `awscli` apt package has no installation candidate on noble; install AWS CLI v2 from the official zip like the fasttest and stateless-test images do. - fuzzer, performance-comparison: drop `dbus-python==1.2.18` from requirements.txt (fails to build a wheel without pkg-config and libdbus headers; nothing imports `dbus`), and pass `--ignore-installed` to pip, because noble ships Debian-packaged blinker 1.7.0 without a RECORD file, which pip cannot uninstall. - test-base: remove the default `ubuntu` user (uid/gid 1000) shipped in ubuntu:24.04, which collided with the `clickhouse` user created by stateless-test. - keeper-jepsen-test, server-jepsen-test: `/root/.ssh` already exists in the noble-based image, use `mkdir -p`. https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=117346&sha=afe00dbf8ddb04427144d91b761ea123673ff17b&name_0=PR&name_1=Dockers%20Build%20%28arm%29 #117346 Co-Authored-By: Claude Fable 5 <[email protected]>
Verified by building both images locally on the noble test-base: - integration/base: drop `dbus-python==1.2.18` from requirements.txt and pass `--ignore-installed` to pip (same as the fuzzer and performance-comparison images); `rpm2archive` from rpm 4.18 streams to stdout when it is not a tty instead of creating `<file>.tgz`, so redirect explicitly. - integration/runner: the `awscli` apt package has no installation candidate on noble; install AWS CLI v2 from the official zip, and pass `--ignore-installed` to pip. https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=117346&sha=bae483905d9ab4ae43623cc269f567858258795c&name_0=PR&name_1=Dockers%20Build%20%28arm%29 #117346 Co-Authored-By: Claude Fable 5 <[email protected]>
The suppression was gated on clang 24 when the diagnostic only existed
on trunk (for the Emscripten build), but it shipped in the clang 23
release, failing the build with:
src/Interpreters/InterpreterSelectQuery.cpp:2098:47: error: stack memory associated with local variable 'creating_set_step' may be returned later. This could be a false positive as the storage may have been moved. [-Werror,-Wlifetime-safety-return-stack-addr-moved]
Move it into the clang 23 block next to the other `lifetime-safety-*`
suppressions.
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=117346&sha=41a0e27004fbd9d892cb23120f2327a0f75c38d2&name_0=PR&name_1=Fast%20test
#117346
Co-Authored-By: Claude Fable 5 <[email protected]>
clang-tidy 23 added new checks and renamed some existing ones, failing the tidy build with ~188 unique findings across 22 check names. Disable the new noisy checks in .clang-tidy (per the policy at the top of the file), including the new canonical names of already-disabled checks (`bugprone-signed-bitwise` for `hicpp-signed-bitwise`, `portability-no-assembler` for `hicpp-no-assembler`) and the new aliases of `google-explicit-constructor`, whose `NOLINT`s in the code reference the google name. Fix the small mechanical findings: - `modernize-redundant-void-arg`: `std::function<void(void)>` and similar in 7 places. - `readability-redundant-casting`: remove 11 redundant casts. - `bugprone-unsafe-to-allow-exceptions`: `NOLINT` the deliberately throwing `~SimpleFaultInjection`. Also disable the `lifetime-safety-dangling-field` compiler diagnostic for clang >= 23: it does not understand a field that is deliberately cleared (via `SCOPE_EXIT`) before the captured local dies. All touched translation units compile cleanly in a local debug build. https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=117346&sha=ed8367eb17b594dbb12b741e1354473f53f82c11&name_0=PR&name_1=Build%20%28arm_tidy%29 #117346 Co-Authored-By: Claude Fable 5 <[email protected]>
Disable `bugprone-unhandled-code-paths` (new in clang-tidy 23): all 7 findings were on switches already carrying `NOLINT(bugprone-switch-missing-default-case)`, so the check duplicates the enabled `bugprone-switch-missing-default-case` for this codebase. Remove 11 redundant `static_cast<size_t>(i + 1)` casts flagged by `readability-redundant-casting` in `gtest_coordination_changelog.cpp`; `i` is already `size_t` in all of them. https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=117346&sha=e687a44500e92d797a393e030550f128b219ffa9&name_0=PR&name_1=Build%20%28arm_tidy%29 #117346 Co-Authored-By: Claude Fable 5 <[email protected]>
UBSan in clang 23 reports a misaligned load in the `Install
ClickHouse` step of the asan_ubsan stateless test jobs:
decompressor.cpp:199:25: runtime error: load of misaligned address
0x7bd15e3b9161 for type 'const MetaData', which requires 8 byte
alignment
`MetaData` is read from the end of the mmapped file and `FileData`
records are read at offsets that depend on preceding file name lengths,
so none of these loads are guaranteed to be aligned. Replace the
`reinterpret_cast` dereferences with `memcpy`.
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=117346&sha=9102ce6e08d5fe41d5509e4056d3c06138adda1a&name_0=PR&name_1=Stateless%20tests%20%28amd_asan_ubsan%2C%20db%20disk%2C%20distributed%20plan%2C%20sequential%2C%20selected%20tests%29
#117346
Co-Authored-By: Claude Fable 5 <[email protected]>
Two reproducible failures in `Stateless tests (arm_binary, parallel)`, both caused by the test image moving to ubuntu:24.04 rather than by clang-23: - `00746_sql_fuzzy`: newer perl prints `Smartmatch is deprecated` to stderr (and perl 5.42 removes the operator entirely), and the test fails on non-empty stderr. Replace the four `~~` uses with `eq`/`ne` comparisons. - `03036_test_parquet_bloom_filter_push_down`: jq 1.7 preserves the precision of 64-bit integer literals, while the reference contains values rounded to double by jq 1.6 (`7711695863945022000` instead of `7711695863945021976`). Update the reference to the exact values. https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=117346&sha=9102ce6e08d5fe41d5509e4056d3c06138adda1a&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20parallel%29 #117346 Co-Authored-By: Claude Fable 5 <[email protected]>
Build profile diff (arm_release)Comparing Binary sizes
The official master build is compiled with Object file sizes
|
| Object file | Master | PR | Δ |
|---|---|---|---|
src/Functions/CMakeFiles/clickhouse_functions_obj.dir/FunctionsNumericIndexedVector.cpp.o |
19.54 MiB | 18.10 MiB | -1.44 MiB (-7.38%) |
src/AggregateFunctions/CMakeFiles/clickhouse_aggregate_functions.dir/AggregateFunctionsArgMinArgMax… |
16.09 MiB | 17.27 MiB | +1.18 MiB (+7.34%) |
src/AggregateFunctions/CMakeFiles/clickhouse_aggregate_functions.dir/AggregateFunctionAvgWeighted.c… |
13.68 MiB | 14.68 MiB | +1.00 MiB (+7.31%) |
contrib/cld2-cmake/CMakeFiles/_cld2.dir/__/cld2/internal/cld2_generated_quadchrome_2.cc.o |
1.94 MiB | 2.94 MiB | +1022.74 KiB (+51.46%) |
contrib/llvm-project-cmake/CMakeFiles/LLVMPasses.dir/__/llvm-project/llvm/lib/Passes/PassBuilder.cp… |
5.66 MiB | 6.56 MiB | +918.85 KiB (+15.85%) |
src/AggregateFunctions/CMakeFiles/clickhouse_aggregate_functions.dir/AggregateFunctionUniq.cpp.o |
13.68 MiB | 14.54 MiB | +880.06 KiB (+6.28%) |
contrib/hive-metastore-cmake/CMakeFiles/_hivemetastore.dir/__/hive-metastore/ThriftHiveMetastore.cp… |
5.82 MiB | 6.61 MiB | +810.80 KiB (+13.60%) |
contrib/llvm-project-cmake/CMakeFiles/LLVMVectorize.dir/__/llvm-project/llvm/lib/Transforms/Vectori… |
2.62 MiB | 3.36 MiB | +758.55 KiB (+28.23%) |
src/CMakeFiles/dbms.dir/Interpreters/Aggregator.cpp.o |
28.56 MiB | 29.25 MiB | +708.80 KiB (+2.42%) |
src/CMakeFiles/dbms.dir/Functions/FunctionsConversion.cpp.o |
24.72 MiB | 25.35 MiB | +645.54 KiB (+2.55%) |
src/CMakeFiles/dbms.dir/Core/Settings.cpp.o |
3.59 MiB | 4.21 MiB | +638.56 KiB (+17.39%) |
contrib/llvm-project-cmake/CMakeFiles/llvm-tblgen.dir/__/llvm-project/llvm/utils/TableGen/Common/Gl… |
new | 592.13 KiB | +592.13 KiB |
contrib/llvm-project-cmake/CMakeFiles/LLVMVectorize.dir/__/llvm-project/llvm/lib/Transforms/Vectori… |
1.14 MiB | 1.68 MiB | +549.79 KiB (+47.08%) |
src/AggregateFunctions/CMakeFiles/clickhouse_aggregate_functions.dir/AggregateFunctionRegr.cpp.o |
5.95 MiB | 6.49 MiB | +548.37 KiB (+9.00%) |
contrib/llvm-project-cmake/CMakeFiles/LLVMipo.dir/__/llvm-project/llvm/lib/Transforms/IPO/Instrumen… |
new | 533.41 KiB | +533.41 KiB |
src/Functions/CMakeFiles/clickhouse_functions_obj.dir/avg2.cpp.o |
7.32 MiB | 7.82 MiB | +520.01 KiB (+6.94%) |
src/Functions/CMakeFiles/clickhouse_functions_obj.dir/midpoint.cpp.o |
7.31 MiB | 7.81 MiB | +519.25 KiB (+6.94%) |
src/AggregateFunctions/CMakeFiles/clickhouse_aggregate_functions.dir/AggregateFunctionCorr.cpp.o |
7.12 MiB | 7.62 MiB | +513.16 KiB (+7.04%) |
src/Functions/CMakeFiles/clickhouse_functions_obj.dir/modulo.cpp.o |
17.46 MiB | 17.95 MiB | +501.65 KiB (+2.81%) |
src/AggregateFunctions/CMakeFiles/clickhouse_aggregate_functions.dir/AggregateFunctionCovar.cpp.o |
6.93 MiB | 7.42 MiB | +500.80 KiB (+7.05%) |
722 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only clickhouse-bundle) and not compared.
Slowest function optimization changes (ThinLTO) ⚠️
programs/clickhouse, programs/clickhouse-keeper but this build uploaded none: the profile producer lost it and the comparison is incomplete.
Compile time of recompiled translation units ⚠️
15989 translation units recompiled, 41506 s compile time in total, 15906 of them have a recent master baseline.
Median compile-time ratio to the baselines is ×1.23 (machine-speed difference or a change affecting every TU); per-TU deltas below are relative to that ratio.
The matched translation units cost +7200.2 s (+21%) in total before that adjustment.
| Translation unit | Master | PR | Δ vs median |
|---|---|---|---|
src/Functions/FunctionsConversion_reg.cpp |
28.2 s | 25.9 s | -8.9 s (-26%) |
contrib/arrow-cmake/__/arrow/cpp/src/arrow/compute/kernels/vector_select_k.cc |
15.4 s | 13.7 s | -5.3 s (-28%) |
Translation units without a recent master baseline:
contrib/llvm-project-cmake/__/llvm-project/llvm/utils/TableGen/Common/GlobalISel/MatchTable/Matcher…: 5.7 scontrib/llvm-project-cmake/__/llvm-project/llvm/lib/Target/AArch64/AArch64SRLTDefineSuperRegs.cpp: 5.4 scontrib/llvm-project-cmake/__/llvm-project/llvm/lib/Target/AArch64/SVEShuffleOpts.cpp: 5.2 scontrib/llvm-project-cmake/__/llvm-project/llvm/lib/Transforms/IPO/Instrumentor.cpp: 5.1 s
Symbol sizes
| Binary | Symbol | Master | PR | Δ |
|---|---|---|---|---|
programs/clickhouse-keeper |
llvm::AArch64MCRegisterClassStorage |
new | 203.23 KiB | +203.23 KiB |
programs/clickhouse |
llvm::AArch64MCRegisterClassStorage |
new | 203.23 KiB | +203.23 KiB |
programs/clickhouse |
llvm::InlineFunctionImpl(llvm::CallBase&, llvm::InlineFunctionInfo&, bool, llvm::AAResults*, bool, … |
88.11 KiB | removed | -88.11 KiB (-100.00%) |
programs/clickhouse-keeper |
llvm::InlineFunctionImpl(llvm::CallBase&, llvm::InlineFunctionInfo&, bool, llvm::AAResults*, bool, … |
88.02 KiB | removed | -88.02 KiB (-100.00%) |
programs/clickhouse |
llvm::InlineFunctionImpl(llvm::CallBase&, llvm::InlineFunctionInfo&, bool, llvm::AAResults*, bool, … |
new | 69.59 KiB | +69.59 KiB |
programs/clickhouse-keeper |
llvm::InlineFunctionImpl(llvm::CallBase&, llvm::InlineFunctionInfo&, bool, llvm::AAResults*, bool, … |
new | 69.59 KiB | +69.59 KiB |
programs/clickhouse |
_ZNSt3__1L18__contention_tableE |
new | 64.00 KiB | +64.00 KiB |
programs/clickhouse-keeper |
_ZNSt3__1L18__contention_tableE |
new | 64.00 KiB | +64.00 KiB |
- amd_darwin/arm_darwin: `std::min(total_size - offset, data_capacity)` in `ReadBufferFromAzureBlobStorage` fails template deduction on Darwin where `off_t` is `long long`, so the subtraction promotes to `unsigned long long` while `data_capacity` is `size_t` (aka `unsigned long`). Use `std::min<size_t>`. - arm_fuzzers: the generated `out.pb.h` of `codegen_select_fuzzer` trips the new clang 23 `lifetime-safety-lifetimebound-violation` and `lifetime-safety-intra-tu-misplaced-lifetimebound` diagnostics. Disable them for this target. - loongarch64: the clang/lld 23 snapshots are mid-transition of the LoongArch TLS relocations to the new PCADD scheme; the compiler still emits `R_LARCH_TLS_IE_PC_HI20` while `ld.lld-23` fails on it with 'unknown relocation (87) against symbol thread_local_rng' and then crashes. Use `-ftls-model=global-dynamic` until the transition settles upstream (llvm/llvm-project#135521). https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=117346&sha=c5327723e4be9b25b184e60b81abdc93115bf1a8&name_0=PR #117346 Co-Authored-By: Claude Fable 5 <[email protected]>
- `00746_sql_fuzzy`: tag as `no-flaky-check` - the test makes up to 5 runs of 60 seconds each, exceeding the flaky check time limit under sanitizers (it entered the flaky check because the previous commit edited its .pl script). - `test_input_format_parallel_parsing_memory_tracking`: since 2024 the test generated `data.jsonl` but curl posted `@data.json` - old curl warned and sent an empty body, so the test was silently a no-op; curl in ubuntu:24.04 hard-errors on the missing file. Fix the file name and generate valid `JSONEachRow` data (it was space-separated numbers before, which would fail parsing). - `test_server_overload`: while the wait/busy ratio is still between `min_os_cpu_wait_time_ratio_to_throw` and `max_os_cpu_wait_time_ratio_to_throw`, a throw is a probabilistic Bernoulli draw; the test asserted saturation instead of waiting for it. Keep polling until the probability saturates at 1. - Keeper Stress Tests: `import yaml` worked by accident via the apt `awscli` dependency on `python3-yaml`; the ubuntu:24.04 image installs AWS CLI v2 from a zip, dropping it. Pin `PyYAML` in the integration runner requirements. https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=117346&sha=c5327723e4be9b25b184e60b81abdc93115bf1a8&name_0=PR #117346 Co-Authored-By: Claude Fable 5 <[email protected]>
Rebased ClickHouse patches from `ClickHouse/release-22.x` onto upstream `release/23.x` (llvmorg-23.1.0+3). Dropped patches that were merged upstream: the `ProgramStack.cpp` include fix and the `unordered_map` copy-constructor node-leak fix with its follow-ups. CMake adaptation: - Synced LLVM per-component source lists with 23.x (renames like `X86VZeroUpper.cpp` -> `X86InsertVZeroUpper.cpp`, `ExpandMemCmp.cpp` moved from CodeGen to Scalar, new TableGen `MatchTable/` files, etc.) - Added `tsan_adaptive_delay.cpp` and `sanitizer_unwind_aix.cpp` to compiler-rt source lists - Added `text_encoding.cpp` to libcxx sources - Bumped bundled LLVM version macros to 23.1.0
- Compile libcxx `text_encoding.cpp` with `-std=c++26` (`std::text_encoding` is a C++26 feature; upstream builds libcxx sources with a newer standard) - Add new LLVM 23 tablegen outputs: `X86GenSDNodeInfo.inc`, `X86GenPostLegalizeGICombiner.inc`, `IntrinsicsAVR.h`, and the `-gisel-extended-llt` flag for `AArch64GenGlobalISel.inc` - Generate `InstrumentorVariables.inc` needed by the new `Instrumentor` pass in `LLVMipo` - Handle `[[nodiscard]]` on `try_lock_for` in `ProfiledLocks.h` (newly annotated in libc++ 23) - Add missing includes no longer provided transitively by libc++ 23: `<atomic>` in Poco JSON `Array.h`, `<cstdlib>` in rocksdb (submodule bump), `<array>` in Jieba-CPP (submodule bump)
clang-tidy 23 flags `.get()->` on smart pointers (`readability-redundant-smartptr-get`) in more contexts, and libc++ 23 makes `std::string` iterators raw pointers, so `begin().base()` no longer compiles in `gtest_compressionCodec`. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=116787&sha=da3ff9339cf7c2a77486aca83edd682a26824bb2&name_0=PR&name_1=Build%20%28arm_tidy%29 PR: #116787 Co-Authored-By: Claude Fable 5 <[email protected]>
…x commits Same LLVM 23 include fixes (`<cstdlib>` in rocksdb `stderr_logger`, `<array>` in `jieba_hmm_seg`), re-authored with the work email and pushed to reachable branches: `ClickHouse/v10.10.1` in `ClickHouse/rocksdb` and `clickhouse-submodule` in `thevar1able/Jieba-CPP`. Co-Authored-By: Claude Fable 5 <[email protected]>
In `release/23.x`, `GlobalISelMatchTable.cpp` was split into
`Common/GlobalISel/MatchTable/{MatchTable,Matchers,Types}.cpp`, and
`lib/Support/APFloat.cpp` now includes `shared/math.h` from the `libc`
project, so `${LLVM_SOURCE_DIR}/../libc` must be on the include path
(matching upstream `LLVMSupport`).
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=116787&sha=45de7279e5046c978ae85a97330864dcef89b327&name_0=PR&name_1=Build%20%28amd_binary%29
#116787
Co-Authored-By: Claude Fable 5 <[email protected]>
`PACKAGE_VERSION` is embedded into DWARF producer strings via `AsmPrinter`, so keep it in sync with the bundled LLVM version. Co-Authored-By: Claude Fable 5 <[email protected]>
`llvm::ConstantInt::get(type, -1)` implicitly truncates the sign-extended value to the target width. LLVM 23 asserts that the value is representable in the given bit width (`APInt.h:127`), so JIT compilation of `groupBitAnd` aborted in debug builds for types narrower than 64 bits. Use `llvm::Constant::getAllOnesValue` instead, which is exact for any width. CI: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=116787&sha=24ff9d93a336ff032a847bf46bb704bae2cea4a9&name_0=PR&name_1=Stateless%20tests%20(amd_debug,%20parallel) PR: #116787 Co-Authored-By: Claude Fable 5 <[email protected]>
|
@thevar1able @alexey-milovidov, since this PR was merged, CI compiles with apt.llvm.org's clang 23 instead of the PGO+BOLT toolchain. The The
The cause is the missing PGO+BOLT build, not clang 23. Compiling 96 random Dispatching OptimizeToolchain and merging the Dockerfile PR it opens should restore this. The job has not run since |
|
@alexey-milovidov @groeneai another effect of the LLVM 23 switch: lld now names its time trace In The fix below accepts both names and keeps the same diff --git a/ci/jobs/scripts/job_hooks/build_profile_hook.py b/ci/jobs/scripts/job_hooks/build_profile_hook.py
index 3759aa31a..8832ddb78 100644
--- a/ci/jobs/scripts/job_hooks/build_profile_hook.py
+++ b/ci/jobs/scripts/job_hooks/build_profile_hook.py
@@ -102,7 +102,7 @@ def _has_data(file):
# compiled TU (an sccache hit does not run the compiler) plus one per linked
# binary, so their presence is the ground truth for whether this build was
# expected to produce time-trace rows.
-_RAW_TRACE_RE = re.compile(r"\.(c|cpp|cc|cxx)\.json$|\.time-trace$")
+_RAW_TRACE_RE = re.compile(r"\.(c|cpp|cc|cxx)\.json$|\.time-trace(\.json)?$")
def _raw_traces_exist(directory):
@@ -268,9 +268,11 @@ def check():
objects_only = build_type in _OBJECTS_ONLY_BUILDS
try:
if objects_only:
- # lld writes the link trace next to its output.
+ # lld writes the link trace next to its output: <output>.time-trace
+ # up to LLVM 22, <output>.time-trace.json from LLVM 23 on.
for rel in _FINAL_BINARIES:
- (Path(build_dir) / f"{rel}.time-trace").unlink(missing_ok=True)
+ for suffix in (".time-trace", ".time-trace.json"):
+ (Path(build_dir) / f"{rel}{suffix}").unlink(missing_ok=True)
Shell.check(
"./utils/prepare-time-trace/prepare-time-trace.sh "
f"{build_dir} {profiles_dir.absolute()}",
diff --git a/utils/prepare-time-trace/prepare-time-trace.sh b/utils/prepare-time-trace/prepare-time-trace.sh
index 10d546553..513794fdd 100755
--- a/utils/prepare-time-trace/prepare-time-trace.sh
+++ b/utils/prepare-time-trace/prepare-time-trace.sh
@@ -60,7 +60,7 @@ OUTPUT_DIR=$2
# A build that was a complete compiler-cache hit compiles nothing and emits no
# raw trace file at all - that is legitimate, unlike a failing extraction.
-TRACE_FILES=$(find "$INPUT_DIR" -name '*.json' -or -name '*.time-trace' | { grep -P '\.(c|cpp|cc|cxx)\.json|\.time-trace$' || true; })
+TRACE_FILES=$(find "$INPUT_DIR" -name '*.json' -or -name '*.time-trace' | { grep -P '\.(c|cpp|cc|cxx)\.json|\.time-trace(\.json)?$' || true; })
if [[ -n "$TRACE_FILES" ]]
then
@@ -68,7 +68,7 @@ then
set -e
set -o pipefail
- ORIGINAL_FILENAME=\$(echo '{}' | sed -r -e 's!\.(json|time-trace)\$!!; s!/CMakeFiles/[^/]+\.dir!!')
+ ORIGINAL_FILENAME=\$(echo '{}' | sed -r -e 's!\.time-trace(\.json)?\$!!; s!\.json\$!!; s!/CMakeFiles/[^/]+\.dir!!')
LIBRARY_NAME=\$(echo '{}' | sed -r -e 's!^.*/CMakeFiles/([^/]+)\.dir/.*\$!\1!')
START_TIME=\$(jq '.beginningOfTime' '{}')
|
|
@thevar1able in all three master OptimizeToolchain runs since this PR, the aarch64 In each failed run, one of the three links that run at about the same time never finished, and the build printed nothing more once the work that does not depend on it was done:
The #132530 validation run 44093071861 and all amd64 jobs completed these links with their instrumented linker. I reproduced it on a Graviton3 host with the same stage 1 (LLVM 23.1.7 The cause is the aarch64 profile runtime. apt.llvm.org's The instrumented --- a/ci/jobs/build_toolchain.py
+++ b/ci/jobs/build_toolchain.py
@@ -368,6 +368,10 @@
f" -DENABLE_THINLTO=0"
f" -DCMAKE_C_COMPILER={STAGE1_INSTALL_DIR}/bin/clang"
f" -DCMAKE_CXX_COMPILER={STAGE1_INSTALL_DIR}/bin/clang++"
+ # Link with the distro lld: the instrumented one never writes a profile
+ # (lld exits with `_Exit`), and its multithreaded value profiling uses
+ # non-atomic updates on aarch64, which can make a link spin forever.
+ f" -DLINKER_NAME=ld.lld-{LLVM_VERSION}"
f" -DCOMPILER_CACHE=disabled"
f" -DENABLE_TESTS=0"
f" -DENABLE_UTILS=0"The compiler's directory has only |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Use
clang-23in CI.Workflow [PR]
Sync PR [sync-upstream/pr/117346]
Version info
26.11.1.2315-master(included in26.11and later)