raulcd commented on code in PR #48250:
URL: https://github.com/apache/arrow/pull/48250#discussion_r2576751577


##########
cpp/cmake_modules/ThirdpartyToolchain.cmake:
##########
@@ -2852,52 +2852,24 @@ function(build_re2)
   set(RE2_VENDORED
       TRUE
       PARENT_SCOPE)
-  set(RE2_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/re2_fc-install")
-  set(RE2_PREFIX
-      "${RE2_PREFIX}"
-      PARENT_SCOPE)
 
   fetchcontent_declare(re2
                        URL ${RE2_SOURCE_URL}
-                       URL_HASH "SHA256=${ARROW_RE2_BUILD_SHA256_CHECKSUM}")
+                       URL_HASH "SHA256=${ARROW_RE2_BUILD_SHA256_CHECKSUM}"
+                       EXCLUDE_FROM_ALL)
   prepare_fetchcontent()
 
   # Unity build causes some build errors
   set(CMAKE_UNITY_BUILD OFF)
-  fetchcontent_makeavailable(re2)
-
-  # This custom target ensures re2 is built before we install
-  add_custom_target(re2_built DEPENDS re2::re2)
-
-  add_custom_command(OUTPUT "${re2_BINARY_DIR}/cmake_install.cmake.saved"
-                     COMMAND ${CMAKE_COMMAND} -E copy_if_different
-                             "${re2_BINARY_DIR}/cmake_install.cmake"
-                             "${re2_BINARY_DIR}/cmake_install.cmake.saved"
-                     COMMAND ${CMAKE_COMMAND} -E echo
-                             "# RE2 install disabled to prevent double 
installation with Arrow"
-                             > "${re2_BINARY_DIR}/cmake_install.cmake"
-                     DEPENDS re2_built
-                     COMMENT "Disabling RE2 install to prevent double 
installation"
-                     VERBATIM)
 
-  add_custom_target(re2_install_disabled ALL
-                    DEPENDS "${re2_BINARY_DIR}/cmake_install.cmake.saved")
+  # Disable install rules for RE2 so it is not installed on our Linux-packages.
+  set(CMAKE_SKIP_INSTALL_RULES ON)

Review Comment:
   We still need the `set(CMAKE_SKIP_INSTALL_RULES ON)` and the file creation 
otherwise it fails on centos-7. I tested on this commit:
   
https://github.com/apache/arrow/pull/48250/commits/645e0a329be8fa9dce241464ff63328aeedc2fc8
   and the failure:
   
https://github.com/apache/arrow/actions/runs/19820760331/job/56782413601?pr=48250
   I'll add it back.



-- 
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