Skip to content

Remove unused curl dependency from AWS, Azure, and Arrow contribs - #108254

Closed
alexey-milovidov wants to merge 1 commit into
masterfrom
remove-unused-curl
Closed

alexey-milovidov wants to merge 1 commit into
masterfrom
remove-unused-curl

Conversation

@alexey-milovidov

Copy link
Copy Markdown
Member

ClickHouse does not use libcurl through the AWS SDK, the Azure SDK, or Arrow. In all three cases the curl-based code is either already excluded from the build or installed as a custom transport, leaving the curl link/sources as dead weight. This removes them so the dependency surface reflects what is actually used.

  • AWS: the aws-cmake wrapper already builds only the standard and crt HTTP clients (never http/curl), and lib_aws.a contains no curl symbols. No change was required.
  • Azure: ClickHouse installs its own PocoAzureHTTPClient transport (client_options.Transport.Transport), so the SDK's libcurl transport adapter was dead code. This stops compiling http/curl/curl.cpp, drops the BUILD_CURL_HTTP_TRANSPORT_ADAPTER definition and the ch_contrib::curl link, and removes the vestigial <azure/core/http/curl_transport.hpp> include. The CurlMemoryLeak unit test relied on the default libcurl transport and is removed together with it.
  • Arrow: curl is only needed by Arrow's S3/GCS filesystem layer, which is excluded from the build, so lib_arrow.a referenced no curl symbols. This drops the ch_contrib::curl link.

librdkafka still links ch_contrib::curl (it genuinely uses it for the SASL/OAUTHBEARER OIDC token endpoint) and is left untouched.

Verified by building clickhouse and unit_tests_dbms and confirming nm reports zero undefined curl symbols in lib_azure_sdk.a, lib_arrow.a, and lib_aws.a (and 15 in lib_rdkafka.a, unchanged). All Azure* unit tests pass.

Changelog category (leave one):

  • Build/Testing/Packaging Improvement

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

Do not build or link libcurl into the Azure SDK and Arrow contribs, which never used it (ClickHouse uses its own HTTP transport for Azure and excludes Arrow's filesystem layer).

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

ClickHouse does not use libcurl through the AWS SDK, the Azure SDK, or Arrow.

- AWS: the `aws-cmake` wrapper already builds only the `standard` and `crt`
  HTTP clients (never `http/curl`), and `lib_aws.a` contains no curl symbols.
  No change was required.

- Azure: ClickHouse installs its own `PocoAzureHTTPClient` transport
  (`client_options.Transport.Transport`), so the SDK's libcurl transport
  adapter was dead code. Stop compiling `http/curl/curl.cpp`, drop the
  `BUILD_CURL_HTTP_TRANSPORT_ADAPTER` definition and the `ch_contrib::curl`
  link, and remove the vestigial `<azure/core/http/curl_transport.hpp>`
  include. The `CurlMemoryLeak` unit test relied on the default libcurl
  transport and is removed together with it.

- Arrow: curl is only needed by Arrow's S3/GCS filesystem layer, which is
  excluded from the build, so `lib_arrow.a` referenced no curl symbols.
  Drop the `ch_contrib::curl` link.

`librdkafka` still links `ch_contrib::curl` (it genuinely uses it for the
SASL/OAUTHBEARER OIDC token endpoint) and is left untouched.

Verified by building `clickhouse` and `unit_tests_dbms` and confirming `nm`
reports zero undefined curl symbols in `lib_azure_sdk.a`, `lib_arrow.a`, and
`lib_aws.a`.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [05023ac]

Summary: ❌

job_name test_name status info comment
Stateless tests (amd_debug, parallel) FAIL
Server died FAIL cidb, issue
Segmentation fault (STID: 5294-3b8d) FAIL cidb
Stateless tests (amd_llvm_coverage, 2/3) FAIL
Server died FAIL cidb, issue
Segmentation fault (STID: 5294-3b8d) FAIL cidb
Fast test (arm_darwin) ERROR
Build (amd_release) ERROR
Build (arm_release) ERROR
Build (amd_darwin) ERROR
Build (arm_darwin) ERROR
Build (arm_v80compat) ERROR
Build (amd_freebsd) ERROR
Build (ppc64le) ERROR

AI Review

Summary

This PR removes libcurl linkage from the Azure SDK and Arrow contrib builds. The Arrow part looks consistent with the disabled Arrow S3/GCS filesystem surface, but the Azure change also removes the SDK's default HTTP transport used by Azure Identity token acquisition, while ClickHouse only installs PocoAzureHTTPClient on blob/data-lake client options. I found one blocking runtime regression for managed/workload identity authentication.

Missing context / blind spots
  • ⚠️ The local checkout has contrib/azure as an uninitialized submodule, so I fetched the exact ClickHouse/azure-sdk-for-cpp sources at submodule commit e1c250fe5dd4306e3b7d19600788f4029c29786c for the Azure Identity transport trace instead of reading them from the working tree.
  • ⚠️ .claude/tools/fetch_ci_report.js failed with a GitHub token policy error, so I could not independently inspect the Praktika CI report beyond the robot comment metadata.
Findings

❌ Blockers

  • [contrib/azure-cmake/CMakeLists.txt:51] The PR promises Azure no longer needs the SDK curl transport because ClickHouse supplies PocoAzureHTTPClient, but that only covers BlobClientOptions. ManagedIdentityCredential and WorkloadIdentityCredential are still constructed with default TokenCredentialOptions in src/Disks/DiskObjectStorage/ObjectStorages/AzureBlobStorage/AzureBlobStorageCommon.cpp and src/Storages/ObjectStorage/Azure/Configuration.cpp; Azure Identity then builds a separate HttpPipeline for token requests from those options. After removing BUILD_CURL_HTTP_TRANSPORT_ADAPTER, that token pipeline has no default transport, so managed/workload identity authentication cannot fetch tokens.
    Suggested fix: keep the Azure SDK curl adapter/link until Azure Identity credentials are constructed with a ClickHouse transport, or pass an appropriate TokenCredentialOptions.Transport.Transport into every ManagedIdentityCredential / WorkloadIdentityCredential construction path.
Tests
  • ⚠️ Please add focused coverage for the Azure Identity path after the transport fix: construct the relevant credential options used by ClickHouse and exercise a token request path far enough to prove the identity HttpPipeline has a non-null transport.
Final Verdict

Status: ❌ Block

Minimum required action: restore a valid transport for Azure Identity token acquisition, then add focused coverage for managed/workload identity credential construction.

@clickhouse-gh clickhouse-gh Bot added pr-build Pull request with build/testing/packaging improvement submodule changed At least one submodule changed in this PR. labels Jun 23, 2026
add_library(_azure_sdk ${AZURE_SDK_UNIFIED_SRC})
target_compile_definitions(_azure_sdk PRIVATE BUILD_CURL_HTTP_TRANSPORT_ADAPTER)

# ClickHouse supplies its own HTTP transport (PocoAzureHTTPClient), so neither the

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Removing the SDK curl adapter also removes the default transport used by Azure Identity credentials. ClickHouse sets PocoAzureHTTPClient on BlobClientOptions, but ManagedIdentityCredential and WorkloadIdentityCredential are still constructed with default TokenCredentialOptions (for example in AzureBlobStorageCommon.cpp), and the identity SDK builds a separate HttpPipeline from those options when fetching tokens. With neither BUILD_CURL_HTTP_TRANSPORT_ADAPTER nor a credential transport set, that token pipeline has no transport, so managed/workload identity authentication breaks even though blob operations use PocoAzureHTTPClient.

Please either keep the Azure SDK curl transport linked, or pass a ClickHouse transport through the Azure Identity credential options before removing the SDK default adapter.

@thevar1able thevar1able self-assigned this Jun 23, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member Author

Closing in favor of #108296

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-build Pull request with build/testing/packaging improvement submodule changed At least one submodule changed in this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants