-
Notifications
You must be signed in to change notification settings - Fork 45
feat: add flexible dependency source resolution #259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
suxiaogang223
wants to merge
14
commits into
alibaba:main
Choose a base branch
from
suxiaogang223:codex/issue-103-dependency-source
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
99e153c
Add configurable dependency source resolution
suxiaogang223 6528ec6
Add ORC and Protobuf dependency source resolution
suxiaogang223 592bc2a
Add phase 3 dependency source resolution
suxiaogang223 33bf610
cmake review
suxiaogang223 a00e901
Refine dependency source scope
suxiaogang223 c147a68
Document dependency source scope
suxiaogang223 a3002a0
Remove CMake review notes from dependency PR
suxiaogang223 b3b5cea
Fix dependency CMake formatting and jieba target
suxiaogang223 bfd2720
Fix sanitizer object dependency propagation
suxiaogang223 1937222
Merge branch 'main' into codex/issue-103-dependency-source
lucasfang 8a2b8ec
Potential fix for pull request finding
suxiaogang223 50c182c
Merge branch 'main' into codex/issue-103-dependency-source
lxy-9602 7231318
Merge branch 'main' into codex/issue-103-dependency-source
lucasfang e23df80
fix cmake dependency review issues
suxiaogang223 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| # Copyright 2026-present Alibaba Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| set(_PAIMON_ARROW_ROOTS ${Arrow_ROOT} ${ARROW_ROOT} ${PAIMON_PACKAGE_PREFIX}) | ||
| list(REMOVE_ITEM _PAIMON_ARROW_ROOTS "") | ||
| if(_PAIMON_ARROW_ROOTS) | ||
| set(_PAIMON_ARROW_FIND_ARGS HINTS ${_PAIMON_ARROW_ROOTS} NO_DEFAULT_PATH) | ||
| endif() | ||
|
|
||
| find_package(Arrow CONFIG QUIET ${_PAIMON_ARROW_FIND_ARGS}) | ||
| find_package(Parquet CONFIG QUIET ${_PAIMON_ARROW_FIND_ARGS}) | ||
| find_package(ArrowDataset CONFIG QUIET ${_PAIMON_ARROW_FIND_ARGS}) | ||
| find_package(ArrowAcero CONFIG QUIET ${_PAIMON_ARROW_FIND_ARGS}) | ||
|
|
||
| function(_paimon_select_first_target OUT_VAR) | ||
| foreach(_target IN LISTS ARGN) | ||
| if(TARGET ${_target}) | ||
| set(${OUT_VAR} | ||
| ${_target} | ||
| PARENT_SCOPE) | ||
| return() | ||
| endif() | ||
| endforeach() | ||
| endfunction() | ||
|
|
||
| if(PAIMON_DEPENDENCY_USE_SHARED) | ||
| _paimon_select_first_target(_PAIMON_ARROW_TARGET Arrow::arrow_shared Arrow::arrow) | ||
| _paimon_select_first_target(_PAIMON_PARQUET_TARGET Parquet::parquet_shared | ||
| Parquet::parquet) | ||
| _paimon_select_first_target(_PAIMON_ARROW_DATASET_TARGET | ||
| ArrowDataset::arrow_dataset_shared | ||
| Arrow::arrow_dataset_shared ArrowDataset::arrow_dataset) | ||
| _paimon_select_first_target(_PAIMON_ARROW_ACERO_TARGET ArrowAcero::arrow_acero_shared | ||
| Arrow::arrow_acero_shared ArrowAcero::arrow_acero) | ||
| else() | ||
| _paimon_select_first_target(_PAIMON_ARROW_TARGET Arrow::arrow_static Arrow::arrow) | ||
| _paimon_select_first_target(_PAIMON_PARQUET_TARGET Parquet::parquet_static | ||
| Parquet::parquet) | ||
| _paimon_select_first_target(_PAIMON_ARROW_DATASET_TARGET | ||
| ArrowDataset::arrow_dataset_static | ||
| Arrow::arrow_dataset_static ArrowDataset::arrow_dataset) | ||
| _paimon_select_first_target(_PAIMON_ARROW_ACERO_TARGET ArrowAcero::arrow_acero_static | ||
| Arrow::arrow_acero_static ArrowAcero::arrow_acero) | ||
| endif() | ||
|
|
||
| include(FindPackageHandleStandardArgs) | ||
| find_package_handle_standard_args( | ||
| ArrowAlt REQUIRED_VARS _PAIMON_ARROW_TARGET _PAIMON_PARQUET_TARGET | ||
| _PAIMON_ARROW_DATASET_TARGET _PAIMON_ARROW_ACERO_TARGET) | ||
|
|
||
| if(ArrowAlt_FOUND) | ||
| get_target_property(ARROW_INCLUDE_DIR ${_PAIMON_ARROW_TARGET} | ||
| INTERFACE_INCLUDE_DIRECTORIES) | ||
|
|
||
| if(NOT TARGET arrow) | ||
| add_library(arrow INTERFACE IMPORTED) | ||
| if(ARROW_INCLUDE_DIR) | ||
| set_target_properties(arrow PROPERTIES INTERFACE_INCLUDE_DIRECTORIES | ||
| "${ARROW_INCLUDE_DIR}") | ||
| endif() | ||
| target_link_libraries(arrow INTERFACE ${_PAIMON_ARROW_TARGET}) | ||
| endif() | ||
|
|
||
| if(NOT TARGET arrow_acero) | ||
| add_library(arrow_acero INTERFACE IMPORTED) | ||
| target_link_libraries(arrow_acero INTERFACE ${_PAIMON_ARROW_ACERO_TARGET} arrow) | ||
| endif() | ||
|
|
||
| if(NOT TARGET arrow_dataset) | ||
| add_library(arrow_dataset INTERFACE IMPORTED) | ||
| target_link_libraries(arrow_dataset INTERFACE ${_PAIMON_ARROW_DATASET_TARGET} | ||
| arrow_acero) | ||
| endif() | ||
|
|
||
| if(NOT TARGET parquet) | ||
| add_library(parquet INTERFACE IMPORTED) | ||
| target_link_libraries(parquet INTERFACE ${_PAIMON_PARQUET_TARGET} arrow_dataset) | ||
| endif() | ||
| endif() | ||
|
|
||
| unset(_PAIMON_ARROW_ACERO_TARGET) | ||
| unset(_PAIMON_ARROW_DATASET_TARGET) | ||
| unset(_PAIMON_ARROW_FIND_ARGS) | ||
| unset(_PAIMON_ARROW_ROOTS) | ||
| unset(_PAIMON_ARROW_TARGET) | ||
| unset(_PAIMON_PARQUET_TARGET) | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.