Skip to content

Build only the needed parts of the CI toolchain - #132530

Merged
thevar1able merged 2 commits into
masterfrom
toolchain-build-distribution
Nov 18, 2026
Merged

thevar1able merged 2 commits into
masterfrom
toolchain-build-distribution

Conversation

@thevar1able

@thevar1able thevar1able commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

OptimizeToolchain spent most of its time on work whose output CI never uses. This builds only what the CI toolchain needs:

  • Stage 2 builds and installs an explicit LLVM_DISTRIBUTION_COMPONENTS list (the compiler, the linker, runtimes, BOLT, and the binutils and profile tools CI calls) instead of LLVM's default target. That target built every tool, test utility and fuzzer of clang-tools-extra, polly and the rest, each one a separate ThinLTO link. clang-tidy already comes from the distro package, because cmake/clang_tidy.cmake prefers clang-tidy-23.
  • Only the backends of the architectures ClickHouse targets are built (X86;AArch64;PowerPC;SystemZ;RISCV;LoongArch); Emscripten ships its own LLVM. Without AMDGPU, BOLT now works on aarch64, which previously shipped a PGO-only toolchain.
  • BOLT profiles are collected at full parallelism for 300 seconds instead of with four jobs for 20 minutes, which left 28 of 32 cores idle.
  • The Dockerfile update job no longer opens a PR from a run on a branch other than master: that PR would point at master's artifact path, where nothing exists.

Validation run (with a 150-second BOLT window, raised afterwards because it collected only 755 profiles on amd64): https://github.com/ClickHouse/ClickHouse/actions/runs/44093071861

amd64 before (run) after
Stage 2 build 68 min 11 min
BOLT profile collection 20 min 2.5 min
Packaging 4.8 min 0.6 min
Archive 1801 MB 190 MB
Job 2h56m 1h31m

aarch64: 1h12m with BOLT applied, 195 MB archive.

The toolchain from the next master run reaches CI through the auto-generated Dockerfile PR, which builds ClickHouse with it before merge.

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

🤖 Generated with Claude Code


Workflow [PR]
Sync PR [sync-upstream/pr/132530]

Version info

  • Merged into: 26.11.1.2672-master (included in 26.11 and later)

thevar1able and others added 2 commits November 17, 2026 14:27
Stage 2 of `OptimizeToolchain` built LLVM's default target: every tool, test
utility and fuzzer of `clang`, `clang-tools-extra`, `lld`, `bolt` and `polly`
for all backends, each one a separate ThinLTO link, and installed all of it.
In the 2026-08-14 run, `clang` and `lld` were linked 23 minutes into the
60-minute stage; the rest went to binaries CI never uses, and the archive
grew to 1.7 GB.

- Build and install an explicit `LLVM_DISTRIBUTION_COMPONENTS` list: the
  compiler, the linker, runtimes, BOLT, and the binutils and profile tools CI
  calls. `clang-tidy` comes from the distro package already.
- Build only the backends of the architectures ClickHouse targets. The AMDGPU
  backend is what BOLT instrumentation failed on for aarch64.
- Collect BOLT profiles at full parallelism for a shorter time instead of
  four jobs for 20 minutes, which left 28 of 32 cores idle.
- Do not open the Dockerfile update PR from a run on a branch other than
  master: the PR would point at master's artifact path, where nothing exists.

Run analyzed: https://github.com/ClickHouse/ClickHouse/actions/runs/31840246060

Co-Authored-By: Claude Opus 5.5 <[email protected]>
150 seconds at full parallelism collected 755 profiles on amd64, against
1604 in the previous 20-minute run with four jobs.

Validation run: https://github.com/ClickHouse/ClickHouse/actions/runs/44093071861

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [ee9809b]

Summary: ✅


AI Review

Summary

The PR limits the CI toolchain to required LLVM projects, backends, and distribution components, collects BOLT profiles with full parallelism for 300 seconds, and restricts Dockerfile update PRs to master. No actionable findings after reviewing both changed files, their CI consumers, prior discussion, and validation artifacts. The validation run successfully built, installed, BOLT-optimized, and packaged both architectures using the earlier 150-second collection window; the amd64 archive also contains the required tools, runtime headers, and cross-target builtins.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Nov 18, 2026
@thevar1able
thevar1able added this pull request to the merge queue Nov 18, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). label Nov 18, 2026
Merged via the queue into master with commit 361455a Nov 18, 2026
196 checks passed
@thevar1able
thevar1able deleted the toolchain-build-distribution branch November 18, 2026 01:17
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 18, 2026
@snelheidai snelheidai mentioned this pull request Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants