Repository navigation
Build packages from the build and source directories without CMake install - #107115
alexey-milovidov merged 22 commits into
Conversation
`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]>
Pre-PR validation gate
This is Step 1 of #36588. Step 2 (replacing the remaining Session id: cron:clickhouse-worker-slot-23:20260610-235400 |
|
cc @alexey-milovidov @Algunenano — could you review this? It's Step 1 of #36588: it stops |
|
Workflow [PR], commit [fde55d0] Summary: ✅
AI ReviewSummaryReviewed head Missing context / blind spots
Final VerdictStatus: ✅ Approve |
CI summary, covered HEAD
|
| 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.
CI finish ledger — 61f072cEvery failure below has an owner: a fixing PR (ours or external), or a full-effort fix task whose
Session id: cron:our-pr-ci-monitor:20260729-164745 |
…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.
…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).
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units7 translation units recompiled, 8 s compile time in total, 7 of them have a recent master baseline. |
CI finish ledger - 937dfffEvery failure below has an owner: a fixing PR (ours or external), or a full-effort fix task
The 107 remaining Not caused by this PR: the diff is one line of Session id: cron:our-pr-ci-monitor:20260815-103000 |
|
Fixing PR for the |
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]>
|
@groeneai, continue. |
|
Continuing here with Step 2 of #36588: the packages will take their files directly from the build and source directories, so the |
…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]>
install
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.
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-48:20260926-054000 |
|
📊 Cloud Performance Report ✅ AI verdict: 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
|
CI finish ledger - 3597990Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
Session id: cron:our-pr-ci-monitor:20261010-230007 |
# Conflicts: # cmake/split_debug_symbols.cmake
|
🕵 Status update:
There are no unresolved review threads, and the PR branch itself needed no changes. |
|
🕵 Merged |
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]>
|
🕵 Merged |
|
🕵 |
|
🕵 |
|
🕵 |
|
🕵 Merged The only CI failure on the previous head @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. |
|
The From
The same stack is in 3 of the 13 master |
# Conflicts: # ci/jobs/build_clickhouse.py
|
🕵 Merged The only CI failure on the previous head, |
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]>
CI finish ledger - 453adb2Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
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]>
|
🕵 Merged
Two adjustments beyond the conflict markers:
Checked locally: CMake configures on the merged tree, and no first-party The only CI failure on the previous head, |
alexey-milovidov
left a comment
There was a problem hiding this comment.
Amazing! The less CMake the better!
Closes: #36588
Changelog category (leave one):
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
installstaging tree, and their contents do not change.ninja installis no longer available; to install a built binary, useclickhouse install.Description
Step 2 of #36588: the packages no longer go through CMake
install.The CI packaging stage ran
ninja programs/installintobuild/root, and nfpm read thepackages/*.yamlentries 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.debugfiles through apackages/build-dirlink to the build directory, the configs, bash completions and well-known Protobuf types from the source tree, and the 16 tool names such asclickhouse-client,clickhouse-keeperandchcastype: symlinkentries.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 explicitfile_info.mode; without itusers.xmlwould ship group-writable.Removed: every first-party
install(), the bash-completion CMake files, the empty.debugand dummy chdig placeholders for nfpm, thegoogle_proto_filesproperty,GNUInstallDirs,CLICKHOUSE_ETC_DIR, the openssl.confand native-tblgen install rules (neither could ever run), and the install-only CI flags.-DCMAKE_INSTALL_PREFIX=/usrstays, because mariadb-connector-c derivesMARIADB_PLUGINDIRfrom it.clickhouse_program_installis renamed toclickhouse_program_link.clickhouse installnow also createsclickhouse-keeper-client, the only packaged name it did not create.-DBUILD_STANDALONE_KEEPER=1without-DSPLIT_DEBUG_SYMBOLS=ONconfigures again.The manifests expect a build configured like the release builds, the only ones CI packages (
-DSPLIT_DEBUG_SYMBOLS=ON), and withchdigenabled;packages/buildrefuses to package a build withoutchdig, which formerly got placeholder scripts.Validation, from one build (done before
mastermadeclickhouse-keepera symlink to theclickhousebinary and dropped theclickhouse-keeper-dbgpackage in #109239; the keeper manifest now followsmaster): 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 nofile_infomodes, 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 master171f5ef3, and no compile command changes.Workflow [PR]
Sync PR [sync-upstream/pr/107115]
Version info
26.12.1.346-master(included in26.12and later)