You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "kou (via GitHub)" <gi...@apache.org> on 2023/03/22 01:39:44 UTC

[GitHub] [arrow] kou commented on issue #34670: [Packaging][C++] gdb integration is not compatible with conda packaging

kou commented on issue #34670:
URL: https://github.com/apache/arrow/issues/34670#issuecomment-1478804915

   How about specifying `-DARROW_GDB_INSTALL_DIR=replace_this_section_with_absolute_slashed_path_to_CONDA_PREFIX` with the change instead of patching?
   
   ```diff
   diff --git a/cpp/cmake_modules/DefineOptions.cmake b/cpp/cmake_modules/DefineOptions.cmake
   index d422514d13..50af2736d3 100644
   --- a/cpp/cmake_modules/DefineOptions.cmake
   +++ b/cpp/cmake_modules/DefineOptions.cmake
   @@ -614,6 +614,13 @@ advised that if this is enabled 'install' will fail silently on components;\
    that have not been built"
                    OFF)
    
   +  define_option_string(ARROW_GDB_INSTALL_DIR
   +                       "Use a custom install directory for GDB plugin. \
   +In general, you don't need to specify this because the default \
   +(CMAKE_INSTALL_FULL_BINDIR on Windows, CMAKE_INSTALL_FULL_LIBDIR otherwise) \
   +is reasonable."
   +                       "")
   +
      option(ARROW_BUILD_CONFIG_SUMMARY_JSON "Summarize build configuration in a JSON file"
             ON)
    
   diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt
   index a3e9f7c733..2af8b67d0f 100644
   --- a/cpp/src/arrow/CMakeLists.txt
   +++ b/cpp/src/arrow/CMakeLists.txt
   @@ -675,20 +675,27 @@ add_arrow_lib(arrow
    # So it's disabled for now.
    if(ARROW_BUILD_SHARED AND NOT WIN32)
      configure_file(libarrow_gdb.py.in "${CMAKE_CURRENT_BINARY_DIR}/libarrow_gdb.py" @ONLY)
   +  if(NOT ARROW_GDB_INSTALL_DIR)
   +    if(WIN32)
   +      set(ARROW_GDB_INSTALL_DIR ${CMAKE_INSTALL_FULL_BINDIR})
   +    else()
   +      set(ARROW_GDB_INSTALL_DIR ${CMAKE_INSTALL_FULL_LIBDIR})
   +    endif()
   +  endif()
      set(ARROW_GDB_AUTO_LOAD_LIBARROW_GDB_INSTALL FALSE)
      if(WIN32)
        find_program(cygpath "cygpath")
        if(cygpath)
   -      execute_process(COMMAND cygpath "${CMAKE_INSTALL_FULL_BINDIR}"
   -                      OUTPUT_VARIABLE MSYS2_CMAKE_INSTALL_FULL_BINDIR
   +      execute_process(COMMAND cygpath "${ARROW_GDB_INSTALL_DIR}"
   +                      OUTPUT_VARIABLE MSYS2_ARROW_GDB_INSTALL_DIR
                          OUTPUT_STRIP_TRAILING_WHITESPACE)
          set(ARROW_GDB_AUTO_LOAD_LIBARROW_GDB_DIR
   -          "${ARROW_GDB_AUTO_LOAD_DIR}${MSYS2_CMAKE_INSTALL_FULL_BINDIR}")
   +          "${ARROW_GDB_AUTO_LOAD_DIR}${MSYS2_ARROW_GDB_INSTALL_DIR}")
          set(ARROW_GDB_AUTO_LOAD_LIBARROW_GDB_INSTALL TRUE)
        endif()
      else()
        set(ARROW_GDB_AUTO_LOAD_LIBARROW_GDB_DIR
   -        "${ARROW_GDB_AUTO_LOAD_DIR}/${CMAKE_INSTALL_FULL_LIBDIR}")
   +        "${ARROW_GDB_AUTO_LOAD_DIR}/${ARROW_GDB_INSTALL_DIR}")
        set(ARROW_GDB_AUTO_LOAD_LIBARROW_GDB_INSTALL TRUE)
      endif()
      if(ARROW_GDB_AUTO_LOAD_LIBARROW_GDB_INSTALL)
   ```


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org