Skip to content

ORC-1440: Check for protobuf config based module - #1529

Closed
nehaljwani wants to merge 1 commit into
apache:mainfrom
nehaljwani:protobuf+cmake
Closed

nehaljwani wants to merge 1 commit into
apache:mainfrom
nehaljwani:protobuf+cmake

Conversation

@nehaljwani

Copy link
Copy Markdown
Contributor

The recent versions of libprotobuf (>=4.22.0) provide their own CMake configs. We should check for the existence of the config and use the hand-rolled version as a fallback as it does not capture all deps.

See also: https://gitlab.kitware.com/cmake/cmake/-/issues/24321

@github-actions github-actions Bot added the BUILD label Jun 4, 2023
Comment thread cmake_modules/FindProtobuf.cmake Resolved
@dongjoon-hyun

Copy link
Copy Markdown
Member

Also, cc @wgtmac

@dongjoon-hyun dongjoon-hyun added this to the 2.0.0 milestone Jun 4, 2023
@nehaljwani
nehaljwani force-pushed the protobuf+cmake branch 2 times, most recently from 2efcae0 to 53afb4e Compare June 4, 2023 15:02
@wgtmac

wgtmac commented Jun 4, 2023

Copy link
Copy Markdown
Member

Thanks @nehaljwani and @dongjoon-hyun!

These changes look fine to me. However, we are still on a very old version of protobuf (3.5.1). I am not sure if it will work properly with higher versions of protobuf. I have seen issues when Apache Arrow tried to compile ORC with a different protobuf version.

@nehaljwani

Copy link
Copy Markdown
Contributor Author

I also maintain the conda-forge recipe for orc. The latest build there was successful with this patch and protobuf v4.23.2

Comment thread cmake_modules/FindProtobuf.cmake Resolved
Comment thread cmake_modules/FindProtobuf.cmake Resolved
@stiga-huang

Copy link
Copy Markdown
Contributor

I also maintain the conda-forge recipe for orc. The latest build there was successful with this patch and protobuf v4.23.2

Do you build the entire orc lib (including tools) or just e.g. liborc.a? Just curious if all the functionality work with protobuf v4.23.2. If so, we can add tests to guard them.

@wgtmac

wgtmac commented Jun 5, 2023

Copy link
Copy Markdown
Member

Probably it is a good time to upgrade protobuf version as well. @stiga-huang

@wgtmac

wgtmac commented Jun 5, 2023

Copy link
Copy Markdown
Member

BTW, I was thinking the possibility to migrate the proto file to use proto3 in v2.0.0 once we split the repo for format. @dongjoon-hyun

The recent versions of `libprotobuf` (>=4.22.0) provide their own CMake
configs. We should check for the existence of the config and use the
hand-rolled version as a fallback as it does not capture all deps.

See also: https://gitlab.kitware.com/cmake/cmake/-/issues/24321
@nehaljwani

Copy link
Copy Markdown
Contributor Author

Do you build the entire orc lib (including tools) or just e.g. liborc.a? Just curious if all the functionality work with protobuf v4.23.2. If so, we can add tests to guard them.

I used the following steps locally (not sure if it covers all targets):

cmake -S/path/to/orc -B/tmp/build -GNinja \
   -DCMAKE_PREFIX_PATH=$CONDA_PREFIX \
   -DPROTOBUF_HOME=$CONDA_PREFIX \
   -DBUILD_JAVA=OFF \
   -DZLIB_HOME=$CONDA_PREFIX \
   -DSNAPPY_HOME=$CONDA_PREFIX \
   -DLZ4_HOME=$CONDA_PREFIX \
   -DZSTD_HOME=$CONDA_PREFIX \
   -DSTOP_BUILD_ON_WARNING=OFF \
   -DBUILD_CPP_TESTS=OFF

cmake --build /tmp/build

@wgtmac

wgtmac commented Jun 7, 2023

Copy link
Copy Markdown
Member

Could you please have a try with -DBUILD_CPP_TESTS=ON -DBUILD_TOOLS=ON?

@nehaljwani

Copy link
Copy Markdown
Contributor Author

Done, the build succeeds with both options turned on with my patch applied.

@wgtmac wgtmac left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! LGTM

@dongjoon-hyun dongjoon-hyun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1, LGTM.

@dongjoon-hyun

Copy link
Copy Markdown
Member

Thank you, @nehaljwani , @wgtmac , @stiga-huang . Merged to main for Apache ORC 2.0.

cxzl25 pushed a commit to cxzl25/orc that referenced this pull request Jan 11, 2024
The recent versions of `libprotobuf` (>=4.22.0) provide their own CMake configs. We should check for the existence of the config and use the hand-rolled version as a fallback as it does not capture all deps.

See also: https://gitlab.kitware.com/cmake/cmake/-/issues/24321

Closes apache#1529 from nehaljwani/protobuf+cmake.

Authored-by: Nehal J Wani <nehaljw.kkd1@gmail.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants