Skip to content

Fix public API options in installed headers - #629

Open
XSY-28 wants to merge 2 commits into
ClickHouse:masterfrom
XSY-28:fix/installed-api-options
Open

XSY-28 wants to merge 2 commits into
ClickHouse:masterfrom
XSY-28:fix/installed-api-options

Conversation

@XSY-28

@XSY-28 XSY-28 commented Nov 24, 2026 •

Copy link
Copy Markdown

Fixes #615.

Summary

Standalone clients can see a different Int128 type or GetCurrentEndpoint() return type from the installed library. The installed public headers now import the CMake options that determine those declarations. Existing explicit options still work when they match the library, and conflicting options produce a compiler error.

An Abseil-backed installation uses the Abseil headers and library that match its build. This PR leaves Abseil dependency packaging to the existing installation paths and does not add a second set of Abseil headers. The bundled build's no-inline-namespace setting is read from its vendored configuration so the installed header explicitly rejects the incompatible namespace case. The README documents the matching header requirement. Packaging Abseil headers is tracked in #284.

Validation

  • A separate C++17 consumer built, linked and round-tripped 18446744073709551618 against each default, 3.x, 2.x Abseil-disabled, and external-Abseil installation on macOS arm64. It checks the actual endpoint return type at compile time.
  • Tested both include orders with an independently compiled Abseil variant. In the original PR revision, external-first selected the alternate Abseil type for ClickHouse, and ClickHouse-first selected the bundled type for an external library. Both were linker failures. In this patch, both include orders compile and run with matching dependency configurations. Both report the specific compile error when an inline-namespace dependency is supplied to the bundled no-inline-namespace build.
  • The external-Abseil build configured against the separately compiled archive and matching headers works in both orders. An install into a preseeded prefix left the existing Abseil header intact. Both default and 3.x build-tree clients compiled using the CMake target through add_subdirectory.
  • A consumer of each Abseil-disabled variant could also link and use the separate Abseil library in both include orders, with independent Int128 types.
  • Matching explicit API flags compile and conflicting flags produce the expected errors. Markdown and MDX parsing, documentation checks, and Git checks passed.
  • Bazel 9.3.3 built the Linux arm64 test target and passed 325 unit tests with two socket cases excluded. Both socket cases also failed on unchanged upstream in this container. On macOS the local Bazel build stopped at an absolute SDK include in unchanged LZ4 code.

The namespace check tests the reported mismatch and does not compare every aspect of the Abseil ABI. All validation used local build and install fixtures, without starting a ClickHouse server. Codex assisted with implementation and verification.

@XSY-28
XSY-28 requested review from a team and slabko as code owners November 24, 2026 10:57

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 81b8172. Configure here.

Comment thread clickhouse/types/bignum.h Resolved
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

AI review gate — AI review passed

Clean review from: Cursor Bugbot.

Keep the installed ClickHouse API options and leave Abseil header selection to the application. Reject inline namespaces for a bundled build that used Abseil without one. This preserves existing dependency packaging and avoids introducing a second set of Abseil headers into the same translation unit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

install: installed headers do not record the CH_* build options, so non-CMake programs get the wrong Int128 and GetCurrentEndpoint() declarations

1 participant