Skip to content

enhance: improve dependency source resolution#282

Open
suxiaogang223 wants to merge 3 commits into
alibaba:mainfrom
suxiaogang223:codex/fix-dependency-resolution
Open

enhance: improve dependency source resolution#282
suxiaogang223 wants to merge 3 commits into
alibaba:mainfrom
suxiaogang223:codex/fix-dependency-resolution

Conversation

@suxiaogang223
Copy link
Copy Markdown
Contributor

Summary

  • Disable SYSTEM resolution for Arrow and ORC while paimon-cpp depends on project-specific patches.
  • Make AUTO resolution for Arrow and ORC fall back to bundled builds.
  • Add shared helper logic for validating that imported CMake targets expose required headers.
  • Apply system dependency header validation to GTest and other FindXXXAlt config-package paths.

Why

Arrow and ORC currently carry project-specific patches in paimon-cpp, so resolving them from system packages can miss required behavior. Some system dependency config packages can also expose library targets without the corresponding development headers, which lets configure pass and build fail later.

Validation

  • cmake -S . -B build/codex-deps-check -DPAIMON_BUILD_TESTS=OFF -DPAIMON_ENABLE_ORC=OFF -DPAIMON_DEPENDENCY_SOURCE=BUNDLED
  • cmake -S . -B build/codex-auto-check -DPAIMON_BUILD_TESTS=OFF -DPAIMON_ENABLE_ORC=OFF
  • cmake -S . -B build/codex-arrow-system-check -DArrow_SOURCE=SYSTEM -DPAIMON_ENABLE_ORC=OFF fails as expected.
  • cmake -S . -B build/codex-gtest-system-check -DPAIMON_BUILD_TESTS=ON -DPAIMON_ENABLE_ORC=ON -DPAIMON_DEPENDENCY_SOURCE=BUNDLED -DGTest_SOURCE=SYSTEM fails at configure time when the full GTest development package is unavailable.

@suxiaogang223 suxiaogang223 changed the title [codex] Fix dependency source resolution enhance: improve dependency source resolution May 13, 2026
@suxiaogang223 suxiaogang223 marked this pull request as ready for review May 13, 2026 14:22
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR tightens third-party dependency resolution in the CMake toolchain to avoid inadvertently using unpatched system Arrow/ORC and to fail fast when “system” config packages expose library targets without usable development headers.

Changes:

  • Disallow Arrow_SOURCE=SYSTEM / ORC_SOURCE=SYSTEM and force AUTO to resolve to bundled builds for Arrow and ORC.
  • Add a shared paimon_find_target_headers() helper to validate headers for imported CMake targets.
  • Apply the header-validation logic across multiple Find*Alt.cmake modules (including the config-package paths for GTest and others).

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
cmake_modules/ThirdpartyToolchain.cmake Forces Arrow/ORC to bundled (AUTO→BUNDLED) and errors out on SYSTEM for patched deps.
cmake_modules/DefineOptions.cmake Updates Arrow/ORC option enums/descriptions to reflect SYSTEM being unsupported.
cmake_modules/FindPackageUtils.cmake Adds shared helper to locate/validate headers associated with imported targets.
cmake_modules/FindzstdAlt.cmake Validates headers for config targets before accepting system zstd.
cmake_modules/FindZLIBAlt.cmake Validates headers for ZLIB::ZLIB config-package target paths.
cmake_modules/FindTBBAlt.cmake Validates headers for TBB config targets before accepting system TBB.
cmake_modules/FindSnappyAlt.cmake Validates headers for Snappy config targets before accepting system Snappy.
cmake_modules/FindLZ4Alt.cmake Validates headers for LZ4 config targets before accepting system LZ4.
cmake_modules/FindRE2Alt.cmake Validates headers for re2 config targets before accepting system RE2.
cmake_modules/FindRapidJSONAlt.cmake Validates headers for RapidJSON config targets before accepting system RapidJSON.
cmake_modules/FindProtobufAlt.cmake Requires protobuf headers + protoc when using config-package targets.
cmake_modules/FindGTestAlt.cmake Adds config-package header validation for gtest/gmock targets.
cmake_modules/FindglogAlt.cmake Validates headers for glog config targets before accepting system glog.
cmake_modules/FindfmtAlt.cmake Validates headers for fmt config targets before accepting system fmt.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cmake_modules/FindPackageUtils.cmake Outdated
Comment thread cmake_modules/ThirdpartyToolchain.cmake Outdated
Comment thread cmake_modules/FindGTestAlt.cmake
Copy link
Copy Markdown
Collaborator

@zjw1111 zjw1111 left a comment

Choose a reason for hiding this comment

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

+1

@zjw1111
Copy link
Copy Markdown
Collaborator

zjw1111 commented May 15, 2026

Thanks for enhancing the dependency build module. Great work! 👍🏻

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.

3 participants