-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
[arrow] Update to 10.0.0 #27687
[arrow] Update to 10.0.0 #27687
Conversation
NOTE: I'm one of Apache Arrow developers. I'll upstream the updated patches as much as possible after this is merged. We'll be able to remove most patches with Apache Arrow 11.0.0. |
ports/arrow/portfile.cmake
Outdated
@@ -42,48 +34,44 @@ if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) | |||
list(APPEND FEATURE_OPTIONS "-DARROW_USE_NATIVE_INT128=OFF") | |||
endif() | |||
|
|||
set(MALLOC_OPTIONS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this commands unsets MALLOC_OPTIONS in the current scope.
To actually start with an emtpy value, this needs to be set(MALLOC_OPTIONS "")
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I didn't know it.
ports/arrow/portfile.cmake
Outdated
|
||
if("jemalloc" IN_LIST FEATURES) | ||
set(MALLOC_OPTIONS -DARROW_JEMALLOC=ON) | ||
list(APPEND MALLOC_OPTIONS -DARROW_JEMALLOC=ON) | ||
else() | ||
set(MALLOC_OPTIONS -DARROW_JEMALLOC=OFF) | ||
list(APPEND MALLOC_OPTIONS -DARROW_JEMALLOC=OFF) | ||
endif() | ||
|
||
if("mimalloc" IN_LIST FEATURES) | ||
set(MALLOC_OPTIONS ${MALLOC_OPTIONS} -DARROW_MIMALLOC=ON) | ||
list(APPEND MALLOC_OPTIONS -DARROW_MIMALLOC=ON) | ||
else() | ||
set(MALLOC_OPTIONS ${MALLOC_OPTIONS} -DARROW_MIMALLOC=OFF) | ||
list(APPEND MALLOC_OPTIONS -DARROW_MIMALLOC=OFF) | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shoud be integrated into vcpgk_check_features(...)
if possible, or get its own invocation of that command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm can arrow actually be build with jemalloc and mimalloc? I would assume those are exclusive options and thus forbidden.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apache Arrow can build with jemalloc and mimalloc. Users can choose their allocation backend at runtime.
I've removed them and used vcpkg_check_features()
instead.
ports/arrow/portfile.cmake
Outdated
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/arrow) | ||
if("parquet" IN_LIST FEATURES) | ||
vcpkg_cmake_config_fixup( | ||
PACKAGE_NAME Parquet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can change this to lower-case parquet
. It is only the directory name in /share
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. vcpkg prefers to lowercase for /share/PACKAGE
name, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, and there is even a PR to add a check for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see!
ports/arrow/portfile.cmake
Outdated
DO_NOT_DELETE_PARENT_CONFIG_PATH | ||
) | ||
endif() | ||
vcpkg_cmake_config_fixup(PACKAGE_NAME Arrow CONFIG_PATH lib/cmake/Arrow) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can change this to lower-case arrow
. It is only the directory name in /share
, and it will integrate this into the port's existing folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
ports/arrow/utf8proc.patch
Outdated
+ find_package(unofficial-utf8proc ${find_package_args} REQUIRED) | ||
+ if(unofficial-utf8proc_FOUND) | ||
+ set(utf8proc_FOUND TRUE) | ||
+ add_library(utf8proc::utf8proc ALIAS utf8proc) | ||
+ return() | ||
+ endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can trim this to
find_package(utf8proc NAMES unofficial-utf8proc REQUIRED)
add_library(utf8proc::utf8proc ALIAS utf8proc)
return()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed REQUIRED
and added NAMES
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(same comment as the brotli changes #27687 (comment))
ports/arrow/utf8proc.patch
Outdated
return() | ||
endif() | ||
|
||
+if(ARROW_PACAKGE_KIND STREQUAL vcpkg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without quotes, this will break when a variable named vcpkg
is defined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
ports/arrow/brotli.patch
Outdated
return() | ||
endif() | ||
|
||
+if(ARROW_PACAKGE_KIND STREQUAL vcpkg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without quotes, this will break when a variable named vcpkg
is defined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
ports/arrow/brotli.patch
Outdated
+ find_package(unofficial-brotli ${find_package_args} REQUIRED) | ||
+ if(unofficial-brotli_FOUND) | ||
+ set(Brotli_FOUND TRUE) | ||
+ add_library(Brotli::brotlicommon ALIAS unofficial::brotli::brotlicommon) | ||
+ add_library(Brotli::brotlienc ALIAS unofficial::brotli::brotlienc) | ||
+ add_library(Brotli::brotlidec ALIAS unofficial::brotli::brotlidec) | ||
+ return() | ||
+ endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can trim this to
find_package(Brotli NAMES unofficial-brotli REQUIRED)
add_library(Brotli::brotlicommon ALIAS unofficial::brotli::brotlicommon)
add_library(Brotli::brotlienc ALIAS unofficial::brotli::brotlienc)
add_library(Brotli::brotlidec ALIAS unofficial::brotli::brotlidec)
return()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I should have removed REQUIRED
.
Wow, I have never used NAMES
for find_package()
!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use INTERFACE
instead of ALIAS
.
Also return()
in Find<X>.cmake
?
also you need to define everything from find_package_handle_standard_args
:
find_package_handle_standard_args(
Brotli REQUIRED_VARS BROTLI_COMMON_LIBRARY BROTLI_ENC_LIBRARY BROTLI_DEC_LIBRARY
BROTLI_INCLUDE_DIR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, REQUIRED
and return()
need extra care.
- In Find modules, one must not use
return()
. It will exit the scope wherefind_package
is called, not just the Find module. (That's the reason why we cannot usefind_dependency
in Find modules.) - In Find modules, one should pass on
REQUIRED
only if it was passed in. (In Config files, it can be delegated tofind_dependency
.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use
INTERFACE
instead ofALIAS
.
Why? Is it for old CMake?
Use
INTERFACE
instead ofALIAS
. Alsoreturn()
inFind<X>.cmake
? also you need to define everything fromfind_package_handle_standard_args
:
Why do we need to use find_package_handle_standard_args()
here? It seems that find_package(Brotli NAMES unofficial-brotli)
does needed things because this file is called by find_package(Brotli)
. (Same package name is used.)
- In Find modules, one must not use
return()
. It will exit the scope wherefind_package
is called, not just the Find module.
Oh, I didn't know it.
I tried the return()
behavior with Apache Arrow but it seems that it works as expected for Apache Arrow (exited only from a Find module).
In Apache Arrow, this file (FileBrotli.cmake
) is called from resolve_dependency()
macro https://github.com/apache/arrow/blob/apache-arrow-10.0.0/cpp/cmake_modules/ThirdpartyToolchain.cmake#L261 .
If I call return()
from FindBrotli.cmake
, the next line https://github.com/apache/arrow/blob/apache-arrow-10.0.0/cpp/cmake_modules/ThirdpartyToolchain.cmake#L262 is also evaluated instead of returning from resolve_dependency()
.
So it seems that we can use return()
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use
INTERFACE
instead ofALIAS
.Why? Is it for old CMake?
It may not be a problem here, but...
It does behave differently at least on CMake Config export: It will export the original target name (here unofficial::...
), not the alias name. This may cause problems when the exported CMake config is used, depending on the completeness of find_dependency
stuff.
(Here, both target names are namespaced, so CMake knows they are targets. But we have seen this with internal names like libfoo
, and then CMake has no choice but must pass this blindly to the linker, which may succeed on Windows (libfoo.lib
) but fail on linux (libfoo.so
).)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation. I understand.
I confirmed that we can use ALIAS
In Apache Arrow use case. Can we use ALIAS
here? (Can we merge this pull request with the current changes?) Or should we use INTERFACE
for better manner?
d9f7db8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!
PRs must add only one version and must not modify any published versions
When making any changes to a library, the version or port-version in vcpkg.json
or CONTROL
must be modified.
error: checked-in files for arrow have changed but the version was not updated
version: 10.0.0
old SHA: 11ae7347b3d708803a9562ef48f1734796bb56f6
new SHA: ab325846893f2dc3382b7b403bf195645ab93a39
Did you remember to update the version or port version?
Use --overwrite-version to bypass this check
***No files were updated***
Feature |
Thanks for confirming these features! |
… vcpkg vcpkg provides CMake packages for Brotli and utf8proc with "unofficial-" prefix. So we need to care about them separately. See also: microsoft/vcpkg#27687
I'm awaiting this for #26501 |
+ if(Brotli_FIND_QUIETLY) | ||
+ list(APPEND find_package_args QUIET) | ||
+ endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Next time, would you mind making this REQUIRED? :)
Other than that, this looks good to me!
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This spot is in a find module forwarding to vcpkg's unofficial config. IMO REQUIRED
is only possible if the original call was REQUIRED
and the absence of vcpkg config shall raise an immediate error despite other search options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I'll add the following:
if(Brotli_FIND_REQUIRED)
list(APPEND find_package_args REQUIRED)
endif()
… vcpkg (#14609) vcpkg provides CMake packages for Brotli and utf8proc with "unofficial-" prefix. So we need to care about them separately. See also: microsoft/vcpkg#27687 Authored-by: Sutou Kouhei <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
Describe the pull request
What does your PR fix?
None
Which triplets are supported/not supported? Have you updated the CI baseline?
Not changed, No
Does your PR follow the maintainer guide?
Yes
If you have added/updated a port: Have you run
./vcpkg x-add-version --all
and committed the result?Yes
If you are still working on the PR, open it as a Draft: https://github.blog/2019-02-14-introducing-draft-pull-requests/