kou commented on PR #43417:
URL: https://github.com/apache/arrow/pull/43417#issuecomment-2254751489

   Hmm. It seems that 
https://github.com/apache/orc/blob/23044d79a26cf8792bcb1936ab601308b0781962/cmake_modules/ThirdpartyToolchain.cmake#L416-L418
 wasn't used. It means that `Protobuf_ROOT` is an empty string in this case: 
https://github.com/apache/arrow/blob/187197c369058f7d1377c1b161c469a9e4542caf/cpp/cmake_modules/ThirdpartyToolchain.cmake#L4524-L4529
   
   Could you debug print `Protobuf_ROOT` value?
   
   BTW, the ORC code should be fixed:
   
   ```diff
   diff --git a/cmake_modules/ThirdpartyToolchain.cmake 
b/cmake_modules/ThirdpartyToolchain.cmake
   index 79324984a..f0808715b 100644
   --- a/cmake_modules/ThirdpartyToolchain.cmake
   +++ b/cmake_modules/ThirdpartyToolchain.cmake
   @@ -466,13 +466,13 @@ if (ORC_PACKAGE_KIND STREQUAL "conan")
    elseif (NOT "${PROTOBUF_HOME}" STREQUAL "")
      find_package (Protobuf REQUIRED)
    
   -  if (ORC_PREFER_STATIC_PROTOBUF AND ${PROTOBUF_STATIC_LIB})
   +  if (ORC_PREFER_STATIC_PROTOBUF AND PROTOBUF_STATIC_LIB)
        add_resolved_library (orc_protobuf ${PROTOBUF_STATIC_LIB} 
${PROTOBUF_INCLUDE_DIR})
      else ()
        add_resolved_library (orc_protobuf ${PROTOBUF_LIBRARY} 
${PROTOBUF_INCLUDE_DIR})
      endif ()
    
   -  if (ORC_PREFER_STATIC_PROTOBUF AND ${PROTOC_STATIC_LIB})
   +  if (ORC_PREFER_STATIC_PROTOBUF AND PROTOC_STATIC_LIB)
        add_resolved_library (orc_protoc ${PROTOC_STATIC_LIB} 
${PROTOBUF_INCLUDE_DIR})
      else ()
        add_resolved_library (orc_protoc ${PROTOC_LIBRARY} 
${PROTOBUF_INCLUDE_DIR})
   ```
   
   @wgtmac Could you fix the ORC side problem (that is not related to this PR's 
failure)? We should not use `${...}` in these `if (...)`s because it may be 
"not defined" or "an empty string". In these case, the `if (...)` becomes `if 
(A AND)`. It's a syntax error. ORC has similar problem for other libraries such 
as LZ4: 
https://github.com/apache/orc/blob/37201cb8a186d2111a5ccf49b213003c4c947859/cmake_modules/ThirdpartyToolchain.cmake#L313


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to