Skip to content
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

ORC-1732: [C++] Fix detecting Homebrew-installed Protobuf on MacOS #1963

Closed
wants to merge 10 commits into from

Conversation

luffy-zh
Copy link
Contributor

What changes were proposed in this pull request?

Detect Protobuf installed by Homebrew on macOS.

Why are the changes needed?

Deal with the issue discussed here

How was this patch tested?

Test it locally.

Was this patch authored or co-authored using generative AI tooling?

NO

@wgtmac
Copy link
Member

wgtmac commented Jun 28, 2024

@kou Could you help review this? Thanks!

Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

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

message(FATAL_ERROR "Cannot determine Protobuf include directory.")
endif ()

if (Protobuf_LIBRARIES MATCHES "\\.a$")
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for looking at that, '.a' has been replaced with CMAKE_STATIC_LIBRARY_SUFFIX

if (NOT PROTOBUF_INCLUDE_DIR)
set (PROTOBUF_INCLUDE_DIR ${Protobuf_INCLUDE_DIRS})
if (NOT PROTOBUF_INCLUDE_DIR)
message(FATAL_ERROR "Cannot determine Protobuf include directory.")
Copy link
Member

Choose a reason for hiding this comment

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

How about showing detection sources too for easy to debug?

Suggested change
message(FATAL_ERROR "Cannot determine Protobuf include directory.")
message(FATAL_ERROR "Cannot determine Protobuf include directory from protobuf::libprotobuf and Protobuf_INCLUDE_DIRS.")

@github-actions github-actions bot added the INFRA label Jul 1, 2024
@wgtmac
Copy link
Member

wgtmac commented Jul 2, 2024

The new github action doesn't run. I found the error message below:

Invalid workflow file: .github/workflows/build_and_test.yml#L224
The workflow is not valid. .github/workflows/build_and_test.yml (Line: 224, Col: 7): 'run' is already defined .github/workflows/build_and_test.yml (Line: 225, Col: 7): 'run' is already defined

https://github.com/apache/orc/actions/runs/9746489872

@wgtmac wgtmac changed the title ORC-1732:[C++] fix failure to detect Protobuf installed by Homebrew o… ORC-1732:[C++] Fix detecting Homebrew-installed Protobuf on MacOS Jul 3, 2024
@wgtmac wgtmac changed the title ORC-1732:[C++] Fix detecting Homebrew-installed Protobuf on MacOS ORC-1732: [C++] Fix detecting Homebrew-installed Protobuf on MacOS Jul 4, 2024
luffy-zh and others added 2 commits July 8, 2024 10:33
Co-authored-by: Gang Wu <ustcwg@gmail.com>
Co-authored-by: Gang Wu <ustcwg@gmail.com>
Copy link
Member

@wgtmac wgtmac left a comment

Choose a reason for hiding this comment

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

+1

Thanks @luffy-zh for the fix and @kou for reviewing it!

Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

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

+1

cmake_modules/FindProtobuf.cmake Outdated Show resolved Hide resolved
cmake_modules/FindProtobuf.cmake Outdated Show resolved Hide resolved
cmake_modules/FindProtobuf.cmake Outdated Show resolved Hide resolved
luffy-zh and others added 3 commits July 9, 2024 12:07
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
strategy:
fail-fast: false
matrix:
version: [12, 14]
Copy link
Member

Choose a reason for hiding this comment

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

Why do we skip 13?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no significant difference between 13 and 12 for C++ compilation.

Copy link
Member

Choose a reason for hiding this comment

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

Then, please add 13 too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

+1, LGTM.

dongjoon-hyun pushed a commit that referenced this pull request Jul 11, 2024
### What changes were proposed in this pull request?
Detect Protobuf installed by Homebrew on macOS.

### Why are the changes needed?
Deal with the issue discussed [here](apache/arrow#42149)

### How was this patch tested?
Test it locally.

### Was this patch authored or co-authored using generative AI tooling?
NO

Closes #1963 from luffy-zh/ORC-1732.

Lead-authored-by: luffy-zh <zhnice@outlook.com>
Co-authored-by: Hao Zou <34559830+luffy-zh@users.noreply.github.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
(cherry picked from commit a9e0351)
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
@dongjoon-hyun
Copy link
Member

Thank you, @luffy-zh , @wgtmac , @kou .
Merged to main/2.0.

@dongjoon-hyun dongjoon-hyun added this to the 2.0.2 milestone Jul 11, 2024
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.

4 participants