Skip to content

GH-50753: [C++] Co-locate static install interface libraries with dependencies - #50764

Closed
KHARSHAVARDHAN-eng wants to merge 1 commit into
apache:mainfrom
KHARSHAVARDHAN-eng:fix/arrow-static-install-interface-libs-50753
Closed

GH-50753: [C++] Co-locate static install interface libraries with dependencies#50764
KHARSHAVARDHAN-eng wants to merge 1 commit into
apache:mainfrom
KHARSHAVARDHAN-eng:fix/arrow-static-install-interface-libs-50753

Conversation

@KHARSHAVARDHAN-eng

@KHARSHAVARDHAN-eng KHARSHAVARDHAN-eng commented Aug 1, 2026

Copy link
Copy Markdown

Rationale for this change

In Apache Arrow's CMake build system, third-party dependency resolution and static library interface target registration were decoupled across two separate locations:

  1. resolve_dependency() in cpp/cmake_modules/ThirdpartyToolchain.cmake
  2. Manual ARROW_STATIC_INSTALL_INTERFACE_LIBS checks in cpp/src/arrow/CMakeLists.txt

Because these declarations were separate, developers adding or updating a dependency in ThirdpartyToolchain.cmake frequently forgot to update ARROW_STATIC_INSTALL_INTERFACE_LIBS in cpp/src/arrow/CMakeLists.txt (e.g. simdjson in GH-50716 / GH-50566). As a result, static builds (-DARROW_DEPENDENCY_SOURCE=SYSTEM) generated exported target metadata (ArrowTargets.cmake) missing required transitive interface link libraries.

What changes are included in this PR?

  1. Extended the resolve_dependency() macro in cpp/cmake_modules/ThirdpartyToolchain.cmake to accept an optional STATIC_INSTALL_INTERFACE_LIBS argument. When a dependency is resolved as SYSTEM, its static interface targets are automatically appended to ARROW_STATIC_INSTALL_INTERFACE_LIBS (or ARROW_FLIGHT_STATIC_INSTALL_INTERFACE_LIBS).
  2. Updated dependency resolution calls in ThirdpartyToolchain.cmake for simdjson, Snappy, Brotli, OpenSSL, glog, Protobuf, ZLIB, lz4, zstd, re2, BZip2, utf8proc, opentelemetry-cpp, google_cloud_cpp_storage, orc, and AWSSDK.
  3. Removed redundant manual ARROW_STATIC_INSTALL_INTERFACE_LIBS checks from cpp/src/arrow/CMakeLists.txt and updated cpp/src/arrow/flight/CMakeLists.txt.

Are these changes tested?

Verified via CMake configurations and generated export metadata:

  • Configured a static build with SYSTEM dependencies and verified that ArrowTargets.cmake contains simdjson::simdjson, Snappy::snappy, ZLIB::ZLIB, LZ4::lz4, BZip2::BZip2, etc. in INTERFACE_LINK_LIBRARIES for Arrow::arrow_static.
  • Configured a bundled static build (-DARROW_DEPENDENCY_SOURCE=BUNDLED) and confirmed system targets do not leak into exported static interface libraries.

Closes #50753

…th dependencies

* Extend resolve_dependency() in ThirdpartyToolchain.cmake to accept STATIC_INSTALL_INTERFACE_LIBS.
* Declare static installation interface targets at dependency resolution site.
* Remove redundant manual ARROW_STATIC_INSTALL_INTERFACE_LIBS declarations in cpp/src/arrow/CMakeLists.txt and cpp/src/arrow/flight/CMakeLists.txt.
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

⚠️ GitHub issue #50753 has been automatically assigned in GitHub to PR creator.

@Reranko05

Copy link
Copy Markdown
Collaborator

@KHARSHAVARDHAN-eng, please stop opening new PRs until you've addressed the feedback on your existing ones. Several maintainers have already spent time reviewing your previous PRs, but you haven't responded to that feedback. Continuously opening new PRs also prevents other contributors from working on these issues while they remain effectively unaddressed.

@kou

kou commented Aug 3, 2026

Copy link
Copy Markdown
Member

I close this for now because there are conflicts.

Let's revisit this after you completed other PRs.

@kou kou closed this Aug 3, 2026
@raulcd

raulcd commented Aug 3, 2026

Copy link
Copy Markdown
Member

Thanks @kou and @Reranko05

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C++] ARROW_STATIC_INSTALL_INTERFACE_LIBS declarations are usually forgotten because they are separate

4 participants