Skip to content

Build packages from the build and source directories without CMake install - #107115

Merged
alexey-milovidov merged 22 commits into
ClickHouse:masterfrom
groeneai:cmake-remove-useless-install-step1
Nov 24, 2026
Merged

alexey-milovidov merged 22 commits into
ClickHouse:masterfrom
groeneai:cmake-remove-useless-install-step1

Conversation

@groeneai

@groeneai groeneai commented Jun 11, 2026 •

Copy link
Copy Markdown
Collaborator

Closes: #36588

Changelog category (leave one):

  • Build/Testing/Packaging Improvement

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

The DEB, RPM and tgz packages are assembled directly from the build and source directories instead of a CMake install staging tree, and their contents do not change. ninja install is no longer available; to install a built binary, use clickhouse install.

Description

Step 2 of #36588: the packages no longer go through CMake install.

The CI packaging stage ran ninja programs/install into build/root, and nfpm read the packages/*.yaml entries from there. That tree was a second copy of the file list the manifests already spell out, so the manifests now name the real files: the stripped binaries and .debug files through a packages/build-dir link to the build directory, the configs, bash completions and well-known Protobuf types from the source tree, and the 16 tool names such as clickhouse-client, clickhouse-keeper and chc as type: symlink entries.

The copy did one thing besides copying: install() forced modes 0644/0755, while nfpm keeps the source mode, and the CI checkout runs with umask 002. Every formerly installed regular file therefore gets an explicit file_info.mode; without it users.xml would ship group-writable.

Removed: every first-party install(), the bash-completion CMake files, the empty .debug and dummy chdig placeholders for nfpm, the google_proto_files property, GNUInstallDirs, CLICKHOUSE_ETC_DIR, the openssl .conf and native-tblgen install rules (neither could ever run), and the install-only CI flags. -DCMAKE_INSTALL_PREFIX=/usr stays, because mariadb-connector-c derives MARIADB_PLUGINDIR from it. clickhouse_program_install is renamed to clickhouse_program_link. clickhouse install now also creates clickhouse-keeper-client, the only packaged name it did not create. -DBUILD_STANDALONE_KEEPER=1 without -DSPLIT_DEBUG_SYMBOLS=ON configures again.

The manifests expect a build configured like the release builds, the only ones CI packages (-DSPLIT_DEBUG_SYMBOLS=ON), and with chdig enabled; packages/build refuses to package a build without chdig, which formerly got placeholder scripts.

Validation, from one build (done before master made clickhouse-keeper a symlink to the clickhouse binary and dropped the clickhouse-keeper-dbg package in #109239; the keeper manifest now follows master): the packages made by the old flow and by this one are identical (18 deb/rpm/tgz, every path, type, mode, owner, link target and file hash). With the inputs of the formerly installed files at 0664/0775 and no file_info modes, exactly those files (25 package entries) come out group-writable. In every formerly installed entry, the old-flow packages match the ones CI published for master 171f5ef3, and no compile command changes.


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

Version info

  • Merged into: 26.12.1.346-master (included in 26.12 and later)

`ninja programs/install` copied a clickhouse-<name> symlink into the
packaging root for every subcommand, but several of those subcommands
are only reachable through the multi-call `clickhouse` binary (as
`clickhouse <name>`) and are not shipped as standalone programs in any
package. nfpm builds every package strictly from the explicit `src:`
entries in packages/clickhouse-*.yaml, none of which reference these
symlinks, so installing them was wasted work whose only effect was extra
"Installing ..." lines and files in the temporary install tree.

Split the helper into clickhouse_program_link (link the subcommand
library into the multi-call binary and create the build-tree symlink)
and clickhouse_program_install (additionally install the symlink for
packaging). Switch the subcommands that are not packaged
(check-marks, checksum-for-compressed-block, disks, docker-init,
git-import, static-files-disk-uploader, su, zookeeper-dump-tree,
zookeeper-remove-by-list, keeper-data-dumper, keeper-utils,
keeper-bench) to clickhouse_program_link.

The build-tree symlinks and the multi-call dispatch are unchanged, so
`clickhouse <name>` keeps working and the produced packages are
unaffected. Step 1 of ClickHouse#36588.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator Author

Pre-PR validation gate

# Question Answer
a Deterministic repro? N/A (build-system cleanup, not a test/bug fix). Instead, validated deterministically: configured the install logic in isolation and inspected the generated cmake_install.cmake. Before: 24 clickhouse-* symlink installs. After: exactly the 8 packaged programs + ch/chl/chc aliases; the 12 multi-call-only subcommands dropped.
b Root cause explained? ninja programs/install populates <build>/root/ via CMake install(). nfpm (packages/build) builds every deb/rpm/tgz/apk strictly from the explicit src: entries in packages/clickhouse-*.yaml (no glob of root/), and none reference the 12 standalone symlinks. So installing them was pure waste with no packaging effect.
c Fix matches root cause? Yes. Split clickhouse_program_install into clickhouse_program_link (link + build-tree symlink, no install) and clickhouse_program_install (also installs). The 12 unpackaged subcommands switch to _link, so their symlinks are no longer copied into the install tree.
d Test intent preserved / new tests added? No tests removed/weakened. The multi-call dispatch table in programs/main.cpp is unchanged (all 12 subcommands keep their {"name", mainEntryClickHouse*} entries), and the build-tree symlinks are still created, so clickhouse <name> is unaffected. No new test added: this is a CMake/packaging change with no runtime behavior to assert; package contents are unchanged by construction.
e Both directions demonstrated? Yes. Isolated configure with the OLD helper installs all 24 symlinks; with the NEW split it installs only the 11 packaged ones (8 programs + 3 aliases), while all 23 build-tree create_symlink commands remain. The delta is exactly the 12 intended subcommands.
f Fix is general, not a narrow patch? Yes. Every install callsite for a non-packaged subcommand was converted in the same change (the full set: check-marks, checksum-for-compressed-block, disks, docker-init, git-import, static-files-disk-uploader, su, zookeeper-dump-tree, zookeeper-remove-by-list, keeper-data-dumper, keeper-utils, keeper-bench), not just one. Cross-checked against packages/*.yaml, ci/jobs/functional_tests.py, the distroless Dockerfiles, and programs/install/Install.cpp to confirm none depend on the installed standalone symlinks.

This is Step 1 of #36588. Step 2 (replacing the remaining install() calls with direct paths into the build directory so CMake install can be dropped entirely) is a separate, higher-risk change and will be a follow-up PR.

Session id: cron:clickhouse-worker-slot-23:20260610-235400

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @alexey-milovidov @Algunenano — could you review this? It's Step 1 of #36588: it stops ninja programs/install from copying standalone clickhouse-<name> symlinks for the 12 subcommands that are only reachable via the multi-call binary and aren't referenced by any packages/*.yaml, by splitting the install helper into a link-only variant. The multi-call dispatch and produced packages are unchanged.

@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label Jun 11, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jun 11, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [fde55d0]

Summary: ✅


AI Review

Summary

Reviewed head fde55d01852e5e556b49bb6b1a11b673094e1031, the full diff, surrounding code, and all prior discussion. The PR assembles packages directly from build and source files, removes CMake installation staging, and adds the clickhouse-keeper-client installer alias. No actionable findings remain. An isolated comparison using CI's nfpm 2.20.0 matched all 15 old/new DEB, RPM, and tgz package pairs in paths, permissions, ownership, symlink targets, and file contents. The chdig guard also correctly rejects a disabled configuration with a stale symlink and a missing configuration.

Missing context / blind spots
  • ⚠️ Local packaging verification used fixture binaries, debug information, and Protobuf files, with the actual configuration files and completions. No full ClickHouse build or live service installation was performed. Detailed build/install reports for this head were unavailable through the CI report tool; the workflow overview reports those jobs green.
Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-build Pull request with build/testing/packaging improvement label Jun 11, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

CI summary, covered HEAD e98f897b

CI fully finished (run=0, aggregator complete, >18h buffer). The single failure is the inherited azure-outage corruption; this CMake-install-only change cannot cause it.

Check Failure Classification Disposition
Stateless tests (arm_asan_ubsan, azure, sequential) Segmentation fault (STID 0883-49e8), Server died, 01079_parallel_alter_modify_zookeeper_long ERROR Inherited trunk corruption (multistage distributed-queries thread-teardown UAF, STID 0883-* family) NOT PR-caused. A programs/CMakeLists.txt install change cannot segfault a stateless test. This HEAD predates the master revert #107122 (merged 01:37 UTC 06-11); the arm_asan_ubsan, azure, sequential check is clean on master across 55 commits since 03:00 UTC 06-11, and STID 0883-49e8 hit 16+ unrelated PRs in the pre-revert window. A rebase past 01:37 UTC 06-11 clears it.

No PR-caused failures. The change (drop standalone symlink installs for multi-call-only subcommands; Step 1 of #36588) is unaffected.

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger — 61f072c

Every failure below has an owner: a fixing PR (ours or external), or a full-effort fix task whose
fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Stateless tests (amd_llvm_coverage, ParallelReplicas, s3 storage, parallel) / 01666_merge_tree_max_query_limit fails 3/3 reruns under parallel replicas on coverage builds #112385 (ours, merged 2026-07-29 15:37Z) - this build predates the fix
Stateless tests (arm_binary, parallel) / 01396_inactive_replica_cleanup_nodes_zookeeper flaky: 16/16 same-settings reruns passed, so not reproducible under its own settings #108213 (ours, open)

Session id: cron:our-pr-ci-monitor:20260729-164745

alexey-milovidov and others added 3 commits August 1, 2026 17:57
…khouse-packed-io

Both were added to programs/CMakeLists.txt after this branch was opened
(oom-canary in e0297fd, packed-io in 80246e2) and took the
installing path, but no packaging manifest references either standalone
symlink, so `ninja programs/install` staged two files that never reach a
package. Move them to clickhouse_program_link, like the other
multi-call-only subcommands.

`clickhouse oom-canary` and `clickhouse packed-io` are unaffected: both stay
registered in the multi-call dispatch table and still get their build-tree
symlink. Verified by configuring the pre-change and post-change trees side by
side: the installed set drops exactly the 14 unpackaged standalone symlinks
and adds none, while all 30 build-tree create_symlink commands are preserved.
Comment thread programs/CMakeLists.txt Resolved
…ation surface

The comments said the linked-only subcommands are "only reachable through the
multi-call binary" and that the installed group is "shipped as standalone
clickhouse-<name> programs in packages". The second half is the criterion the
change actually applies: a `src: root/usr/bin/clickhouse-<name>` line in
packages/*.yaml, which nfpm consumes literally (no globs). The "only reachable"
half is a stronger claim that does not hold for clickhouse-disks and
clickhouse-git-import, which `clickhouse install` also symlinks from its own
`tools` list in programs/install/Install.cpp. That path never reads this staging
tree - it symlinks from the binary it has just copied itself - so its behaviour
is the same either way, but the comment should not imply otherwise.

No functional change: the per-subcommand link/install classification is
identical before and after (8 installed, 15 linked).
@clickhouse-gh

clickhouse-gh Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing fde55d018 with master cd61bfb0c (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Compile time of recompiled translation units

7 translation units recompiled, 8 s compile time in total, 7 of them have a recent master baseline.

Job report

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 937dfff

Every failure below has an owner: a fixing PR (ours or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Integration tests (amd_asan_ubsan, db disk, old analyzer, 1/6) / Timeout harness: the shard exhausted its 7200s parallel-phase budget with zero test failures (903 OK, 17 skipped, the Timeout row the only FAIL) a fix task is created (investigating at full effort - fixing PR link to follow on this PR)

The 107 remaining ERROR results on this head carry empty info and were never dispatched: the
old-analyzer shards are in CORE_BLOCKING_JOB_NAMES (ci/workflows/pull_request.py:16-37) and
almost the whole rest of the matrix is set_run_after them, so the one shard's timeout skipped
every Stress test, fuzzer, Performance Comparison, ClickBench, SQLLogic/SQLStorm, Upgrade check,
Docker image, Install/Compatibility, and every amd_tsan / amd_msan / amd_llvm_coverage job. They
are consequences of the single line above, not separate failures, so they are not ledgered
individually.

Not caused by this PR: the diff is one line of programs/CMakeLists.txt, which cannot affect
integration-test wall-clock. The signature is PR-side only (0 master hits in 30 days) and spread
across 8 unrelated PRs and 5 of the 6 shards in that window.

Session id: cron:our-pr-ci-monitor:20260815-103000

@groeneai

Copy link
Copy Markdown
Collaborator Author

Fixing PR for the Integration tests (amd_asan_ubsan, db disk, old analyzer, 1/6) / Timeout line on my CI finish ledger: #114956

@groeneai groeneai added the groeneai-origin-unknown PR origin: unclassified (legacy task) label Aug 19, 2026
pull Bot pushed a commit to SINHASantos/ClickHouse that referenced this pull request Aug 21, 2026
A job that sets `do_not_block_pipeline_on_failure` still blocked its whole
downstream closure whenever it ended `ERROR` rather than `FAIL`.

The two consumers of the flag disagreed. `hook_html` gates on
`not result.is_ok()`, so dependees were correctly not marked `DROPPED`, while
`runner._post_run` gated on `result.is_failure()`, which covers `FAIL`/`XPASS`
only, so an `ERROR` was never exempted and the job emitted
`pipeline_status=failure`. Every dependent job's generated guard is
`!contains(needs.*.outputs.pipeline_status, 'failure')` over a transitive
`needs`, so that one token skips the entire closure. Both predicates were
introduced together in b35b5fd and have been asymmetric since.

The case that hits it: an integration shard exhausts its 7200s parallel-phase
budget and appends a synthetic `Timeout` child while every real test passes.
One non-ok child means `force_ok_exit = True`, so the job declares itself
non-blocking, but the same timeout sets the error flag and `set_error()` makes
the job-level status `ERROR`. That skipped 107 of 175 results on ClickHouse#107115 and
112 of 177 on ClickHouse#109071, including all five `Bugfix validation (*)` jobs. Because
those never ran, the `new_tests_check` post-hook read them as `PENDING` and
failed `Finish Workflow` reporting that the test is not actually a regression
test for the fix, so a harness timeout in an unrelated shard became a verdict
on the author's regression test. 8 occurrences across 8 PRs and 5 of the 6
shards in 30 days.

The predicate is extracted into `Runner._pipeline_status` so a test can assert
the production decision rather than a copy of it, following
`_skip_missing_optional_artifact` in the same file. `functional_tests` passes
the same flag after a path that can also end `ERROR`, so it is fixed by the
same line.

Merge-blocking is unchanged: `ready_for_merge` is computed from
`job.allow_failure` alone and never reads this flag, and all six shards are
`allow_failure=False`, so a failing shard still blocks the merge and still
reports red. Only downstream dispatch changes. `new_tests_check` is left as it
is, since its strict check is correct once the jobs actually run.

Co-Authored-By: Claude Fable 5 <[email protected]>
@abashkeev abashkeev added the comp-build-system Build system (CMake, compilation, platform builds). label Sep 4, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member

@groeneai, continue.

@groeneai

Copy link
Copy Markdown
Collaborator Author

Continuing here with Step 2 of #36588: the packages will take their files directly from the build and source directories, so the ninja programs/install staging step and the CMake install() calls go away. I'll follow up in this thread when it is pushed.

groeneai and others added 3 commits September 26, 2026 03:19
…stall

The packages were built by running `ninja programs/install` into a staging
tree (`build/root`) and pointing `packages/*.yaml` at it. That tree was a
second, implicit copy of the file list the manifests already spell out, so
the manifests now name the real files:

- binaries and debug info: `build-dir/programs/stripped/...`, where
  `packages/build-dir` links to the build directory;
- configs, bash completions and the well-known Protobuf types: the source
  tree;
- the `clickhouse-<tool>` names: `type: symlink` entries, as the keeper
  ones already were.

`install()` forced mode 0644 for files and 0755 for programs, while nfpm
takes the mode of the source file, and the CI checkout runs with umask 002.
Every formerly installed regular file therefore gets an explicit
`file_info.mode`, so the packaged modes do not change (`users.xml` must not
become group-writable).

With nothing left to install, every first-party `install()` is removed,
together with the code that only fed it: the bash-completion CMake files,
the empty `.debug` placeholders and dummy chdig scripts for nfpm, the
`google_proto_files` property, `GNUInstallDirs`, `CLICKHOUSE_ETC_DIR`, the
openssl and native-tblgen install rules that could never run, and the
install-only CMake flags in CI. `-DCMAKE_INSTALL_PREFIX=/usr` stays,
because mariadb-connector-c derives `MARIADB_PLUGINDIR` from it.
`clickhouse_program_install` becomes `clickhouse_program_link`, because
it installs nothing now.

`-DBUILD_STANDALONE_KEEPER=1` without `-DSPLIT_DEBUG_SYMBOLS=ON`
configures again: the empty-debug macro it failed in is gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The keeper manifests read the standalone keeper's stripped binary and debug info, which exist only with that option.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai groeneai changed the title Do not install standalone symlinks for multi-call-only subcommands Build packages from the build and source directories without CMake install Sep 26, 2026
@groeneai groeneai added the groeneai-origin-request PR origin: a maintainer pinged or directed groeneai label Sep 26, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex; 2 findings on the full pass, 0 on the delta recheck after the fix), plus my own cold review.

# Sev Finding Verdict Evidence / action
1 ⚠️ packages/build help names only -DSPLIT_DEBUG_SYMBOLS=ON, but the keeper manifests also need -DBUILD_STANDALONE_KEEPER=1 AGREE, fixed @ 3267b52 the help line names both options
2 ⚠️ The package-equivalence claim needs an old-vs-new artifact comparison DISAGREE done before review: old flow vs new flow from one build, 18 deb/rpm/tgz, 756 entries (path, type, mode, owner, link target, sha256), 0 differences; the same run without the file_info modes is red on exactly the 25 formerly installed entries
3 💡 src/Common/SymbolIndex.cpp still explains its empty .debug guard with the CMake placeholder this PR removes noted, not changed outside the diff; the guard itself stays correct

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence and are terminal per finding.

Session id: cron:clickhouse-review-slot-48:20260926-054000

@clickhouse-gh clickhouse-gh Bot added the manual approve Manual approve required to run CI label Sep 26, 2026
@clickhouse-gh

clickhouse-gh Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

📊 Cloud Performance Report

✅ AI verdict: no_change — no significant changes across 31 queries analysed

no significant changes detected. K_source=6 K_base=30 flagged=0/65

clickbench

🟢 No significant changes

tpch_adapted_1_official

🟢 No significant changes

Debug info
  • StressHouse run: 5e36d4ba-ae71-4013-8243-d47042694a02
  • MIRAI run: b8fe3865-59a6-49f7-a3eb-ed2013f40b50
  • PR check IDs:
    • clickbench_769844_1791664773
    • clickbench_769857_1791664772
    • clickbench_769864_1791664772
    • tpch_adapted_1_official_769870_1791664772
    • tpch_adapted_1_official_769900_1791664773
    • tpch_adapted_1_official_769914_1791664772

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 3597990

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Stateless tests (arm_binary, ParallelReplicas, s3 storage, parallel) / 05317_local_read_throttler_filesystem_cache flaky, not from this PR (it changes packaging and CMake install rules only; 131 of 133 reruns pass): under parallel replicas another replica can do the read, so its ProfileEvents miss this query's query_log row and the last line reads 0 1 instead of 1 1. 38 PRs and 2 master runs show it in 30 days #124920 (mine, open)
Mergeable Check, PR praktika rollups of the row above #124920 (mine, open)
Sync - CH Inc sync (private, not actionable by me)

Session id: cron:our-pr-ci-monitor:20261010-230007

# Conflicts:
#	cmake/split_debug_symbols.cmake
@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 Status update:

  • CH Inc sync: the sync PR had a conflict in cmake/split_debug_symbols.cmake with private master. I merged private master and then this PR's head eedfba10cb15 into sync-upstream/pr/107115. While checking the result I found that an earlier sync merge (a311957efd21) had dropped the private CLICKHOUSE_CLOUD keeper link libraries in programs/keeper/CMakeLists.txt, so I restored them. Private CI is running again on 81138253a71c.
  • Stateless tests (arm_binary, parallel): 05325_iceberg_mixed_format_top_k_dynamic_filtering failed only because of an <Error> log line about a lost Iceberg metadata commit race (FILE_ALREADY_EXISTS on v3.metadata.json). This PR does not touch that code, 117 reruns with the same settings all passed, and Log a lost Iceberg metadata commit race at Debug, not Error #125026 already lowers that log line to Debug.

There are no unresolved review threads, and the PR branch itself needed no changes.

@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 Merged master into the branch (db78e7c466e). It merged without conflicts, and CMake still configures. Nothing new on master refers to ninja programs/install or packages/root. The only CI failure, 05325_iceberg_mixed_format_top_k_dynamic_filtering, is not related to this PR: it is the <Error> log line about a lost Iceberg metadata commit race, and #125026 addresses it. There are no unresolved review threads.

Resolve the conflict in `ci/jobs/build_clickhouse.py`: keep the removal of
`-DCMAKE_INSTALL_SYSCONFDIR`, `-DCMAKE_INSTALL_LOCALSTATEDIR` and
`-DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY` from this PR, and take
`-DSYMBOL_SECTIONS=compact` for the release builds from master.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 Merged master into the branch (9f99b090822f). The only conflict was in ci/jobs/build_clickhouse.py. I kept this PR's removal of -DCMAKE_INSTALL_SYSCONFDIR, -DCMAKE_INSTALL_LOCALSTATEDIR and -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY, and took -DSYMBOL_SECTIONS=compact for the release builds from master. CMake still configures, and no install() rules are left in our CMake files. There are no unresolved review threads.

@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 CH Inc sync: the bot could not merge public head 9f99b090822f into the sync PR, because private master also changed ci/jobs/build_clickhouse.py (it added -DSYMBOL_SECTIONS=compact). I merged private master into sync-upstream/pr/107115 (9313dbb4aa87) and kept both changes: -DSYMBOL_SECTIONS=compact from master, and this PR's removal of the install flags. This PR's own diff is unchanged since the last sync; the only new commit is a merge of public master. The sync PR is now MERGEABLE. All other checks on this PR pass, and there are no unresolved review threads.

@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 CH Inc sync: the sync PR is MERGEABLE and builds. Its only failures are tests that this PR (packaging and CMake install rules only) cannot affect: the private-only integration test test_storage_iceberg_with_spark/test_compaction_file_size.py::test_compaction_splits_a_file_above_the_upper_threshold[s3-2] (fails the same way under both MSan and TSan) and the stateless test 05227_system_tables_filter_by_in. I reran the failed jobs of the private run 41203014889. All other checks on this PR pass, and there are no unresolved review threads.

@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 CH Inc sync: the remaining failure in the sync PR was test_storage_iceberg_with_spark/test_compaction_file_size.py::test_compaction_splits_a_file_above_the_upper_threshold (MSan and TSan). It is a private-only test, unrelated to this PR, and private master already fixed it in 37d60ff4b606 ("Make the Iceberg compaction split test independent of Parquet encoder timing"), after the last sync merge. I merged private master into sync-upstream/pr/107115 (96affd065688, no conflicts) so the fix is picked up. All public CI checks of this PR pass, and there are no unresolved review threads.

@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 Merged master into the branch (8c4b34c0869e). There were no conflicts, the PR diff is the same as before, and CMake still configures. No review threads are open.

The only CI failure on the previous head 9dac6125f724 is La Casa Del Dolor (amd_debug) / Server shutdown ("Server node0 did not shut down gracefully and had to be force killed during a scheduled restart"). This PR only changes packaging and CMake install rules, so it cannot cause this. The same failure shows up every day on master (pull_request_number = 0) and on many unrelated PRs: 7-21 failures per day from 2026-11-02 to 2026-11-06 in CIDB.

@groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=107115&sha=9dac6125f724a1b65858fbbc1be85a4159c91cc4&name_0=PR&name_1=La%20Casa%20Del%20Dolor%20%28amd_debug%29 and provide a fix in a separate PR. If the fix is already in progress, link it here.

@groeneai

groeneai commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator Author

The Server shutdown failure on 9dac6125f724 is the ProcessList::killAllQueries deadlock with distributed query plans. Your #128832 fixes it; it is still open, and master has the same killAllQueries code, so I am not opening a separate PR.

From gdb.log (taken at the force kill at 16:36:38, 31 s after the scheduled restart):

  • Main thread: Server::main -> ProcessList::killAllQueries(except_ddl_backups_and_restores=false) -> QueryStatus::cancelQuery -> ReadFromDistributedPlanSource::onCancel -> DistributedQueryPlanExecutorLocal::cleanup -> joinAllThreads, joining LWP 4776.
  • LWP 4776 (DistQueryTask): executeTask (DistributedPlanExecutor.cpp:1192) -> ~shared_ptr<Context> -> ProcessListEntry::~ProcessListEntry (ProcessList.cpp:501), waiting on cancelled_cv for is_cancelling == false. killAllQueries only clears that flag after every cancellation finishes.

The same stack is in 3 of the 13 master Server shutdown failures since 2026-11-02, including the latest one (9fa73f2b539e, 2026-11-06 19:22).

# Conflicts:
#	ci/jobs/build_clickhouse.py
@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 Merged master into the branch (cc8e220cab13). The only conflict was in ci/jobs/build_clickhouse.py. I took master's changes to the build flags (it dropped -DENABLE_SILK_THREAD_LOCAL_STORAGE_SANITIZER=1 and set -DPARALLEL_LINK_JOBS=2 for ARM_FUZZERS) and kept this PR's removal of -DCMAKE_INSTALL_SYSCONFDIR, -DCMAKE_INSTALL_LOCALSTATEDIR and -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY. The PR diff touches the same 20 files as before, no install( rules came back from master, and CMake still configures.

The only CI failure on the previous head, 05515_global_subquery_projection_where (ParallelReplicas), is unrelated to packaging. master fixed it in 1cfc5bb ("Do not rewrite GLOBAL IN in projection queries with parallel replicas"), and this merge brings that fix in. No review threads are open.

The guard tested for the `programs/chdig` link, which the build creates
as a post-build side effect. A build directory built with chdig and then
reconfigured with `-DENABLE_CHDIG=OFF` (or `-DENABLE_RUST=OFF`) keeps that
link after the rebuild, so the guard passed and the packages shipped
`chdig` links to a binary without chdig.

Read `USE_CHDIG` from the generated `includes/configs/config.h` instead.
It is set under the same `TARGET ch_rust::chdig` condition that adds the
alias commands and is regenerated on every configure. A build directory
without the header is refused as well.

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

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 453adb2

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Build profile diff infra, not from this PR: the job stopped before any comparison, because all 8 readiness probes (SELECT 1) to the CI logs cluster hit the 3 s read timeout and it raised LogClusterNotReady: the endpoint never became ready in has_pr_data. The same error hit 11 other PRs between 20:51Z and 22:01Z #129675 (mine, open)
Sync - CH Inc sync (private, not actionable by me)

Session id: cron:our-pr-ci-monitor:20261114-233011

…s-install-step1

Conflicts, all from the keeper packaging rework and the native tablegen rework on `master`:

- `packages/clickhouse-keeper.yaml`: `master` made `clickhouse-keeper` a symlink to the `clickhouse`
  binary of `clickhouse-common-static`. Took that, and kept this PR's `keeper_config.xml` from the
  source tree with an explicit mode.
- `packages/clickhouse-keeper-dbg.yaml`: deleted on `master`, the deletion is kept.
- `contrib/llvm-project-cmake/native-tblgen/CMakeLists.txt`: deleted on `master`, the deletion is
  kept (this PR only removed its `install` rule).
- `ci/jobs/build_clickhouse.py`: took the build flags of `master` (no `-DBUILD_STANDALONE_KEEPER=1`
  for the release builds, new CFI flags) and kept this PR's removal of `-DCMAKE_INSTALL_SYSCONFDIR`,
  `-DCMAKE_INSTALL_LOCALSTATEDIR` and `-DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY`.
- `CMakeLists.txt`: kept the new `ENABLE_CFI` check of `master`, and this PR's removal of
  `CLICKHOUSE_ETC_DIR`.
- `programs/CMakeLists.txt`: kept this PR's removal of the `install` rule for `clickhouse-keeper`.

Semantic adjustments beyond the conflict markers:

- `UNUSED_BUILD_OUTPUTS` in `ci/jobs/build_clickhouse.py` (new on `master`) removed the `root`
  directory of the release builds. That directory no longer exists without `ninja programs/install`,
  and removing a missing path fails, so only `programs/stripped` is left there.
- The help of `packages/build` no longer asks for `-DBUILD_STANDALONE_KEEPER=1`: the manifests do
  not package a standalone keeper binary anymore.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 Merged master into the branch (fde55d01852e). This time the merge was not mechanical, because #109239 reworked the keeper packaging and the native tablegen build on master:

  • packages/clickhouse-keeper.yaml: took master's version, where clickhouse-keeper is a symlink to the clickhouse binary of clickhouse-common-static, and kept this PR's keeper_config.xml from the source tree with an explicit mode.
  • packages/clickhouse-keeper-dbg.yaml and contrib/llvm-project-cmake/native-tblgen/CMakeLists.txt are deleted on master; the deletions are kept, so the PR diff is now 18 files instead of 20.
  • ci/jobs/build_clickhouse.py: took master's build flags (the release builds no longer pass -DBUILD_STANDALONE_KEEPER=1) and kept this PR's removal of -DCMAKE_INSTALL_SYSCONFDIR, -DCMAKE_INSTALL_LOCALSTATEDIR and -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY.
  • CMakeLists.txt and programs/CMakeLists.txt: kept master's new ENABLE_CFI check, and this PR's removal of CLICKHOUSE_ETC_DIR and of the install rule for clickhouse-keeper.

Two adjustments beyond the conflict markers:

  • master added UNUSED_BUILD_OUTPUTS, which removes root and programs/stripped after a release build. Without ninja programs/install there is no root directory, and removing a missing path would fail the build job, so only programs/stripped is left in that list (it is removed after the packaging step, which reads it).
  • The help of packages/build no longer asks for -DBUILD_STANDALONE_KEEPER=1. I updated the PR description accordingly.

Checked locally: CMake configures on the merged tree, and no first-party install rules are left. I did not build packages locally (no nfpm here), so the Build Packages step of the release builds in CI is the real check of the merged manifests.

The only CI failure on the previous head, Build profile diff (LogClusterNotReady), is an infrastructure error; its fix #129675 is merged and comes in with this merge. No review threads are open.

@alexey-milovidov alexey-milovidov self-assigned this Nov 23, 2026

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing! The less CMake the better!

@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Nov 24, 2026
Merged via the queue into ClickHouse:master with commit ecc78fd Nov 24, 2026
194 checks passed
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-build-system Build system (CMake, compilation, platform builds). groeneai-origin-request PR origin: a maintainer pinged or directed groeneai groeneai-origin-unknown PR origin: unclassified (legacy task) manual approve Manual approve required to run CI pr-build Pull request with build/testing/packaging improvement pr-synced-to-cloud The PR is synced to the cloud repo submodule changed At least one submodule changed in this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove useless "install" from CMake

4 participants