Skip to content

Remove libdwarf headers from logduration install#36

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/remove-libdwarf-headers
Draft

Remove libdwarf headers from logduration install#36
Copilot wants to merge 2 commits intomainfrom
copilot/remove-libdwarf-headers

Conversation

Copy link

Copilot AI commented Mar 16, 2026

kerneldb copies system libdwarf headers into its install include directory so downstream builds can find them — a workaround that bundles a system dependency into the logduration install package.

Changes

  • CMakeLists.txt: Adds a post-install step that removes the libdwarf headers kerneldb copies into include/kerneldb/. The find_path(LIBDWARF_INCLUDE_DIR) in src/CMakeLists.txt already handles locating system libdwarf headers at build time, so bundling them is unnecessary.
if(LIBDWARF_INCLUDE_DIR)
  install(CODE "
    file(GLOB _libdwarf_headers \"${LIBDWARF_INCLUDE_DIR}/*.h\")
    foreach(header IN LISTS _libdwarf_headers)
      get_filename_component(header_name \"\${header}\" NAME)
      set(installed_header \"\${CMAKE_INSTALL_PREFIX}/include/kerneldb/\${header_name}\")
      if(EXISTS \"\${installed_header}\")
        file(REMOVE \"\${installed_header}\")
      endif()
    endforeach()
  ")
endif()

The glob path (${LIBDWARF_INCLUDE_DIR}) is baked in at configure time, matching exactly what kerneldb copied and covering distro-specific layouts (e.g. libdwarf-0/ on Ubuntu vs libdwarf/ on RHEL).

Note

The root cause lives in external/kerneldb/src/CMakeLists.txt — the install(DIRECTORY ${LIBDWARF_INCLUDE_DIR}/ ...) block should be removed there in a follow-up PR to the kerneldb repo, at which point this workaround can be dropped.

Original prompt

This section details on the original issue you should resolve

<issue_title>Remove libdwarf headers from logduration install</issue_title>
<issue_description>I encountered some issues resolving the path to libdwarf headers when using the installed version of logduration, building worked fine. Put this off and copied headers to install, but we should come back and fix this as it's a sloppy fix</issue_description>

Comments on the Issue (you are @copilot in this section)

@rwvo @copilot Check the CMake and build files to see if there's any copying of libdwarf headers going on.

📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

kerneldb copies system libdwarf headers into the kerneldb include
directory as a workaround. This adds a post-install step that removes
them: libdwarf is a system dependency that consumers should install via
their package manager (libdwarf-dev / libdwarf-devel).

The find_path(LIBDWARF_INCLUDE_DIR) in src/CMakeLists.txt already
locates libdwarf headers at build time without bundling them.

Co-authored-by: rwvo <21990117+rwvo@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove libdwarf headers from logduration install Remove libdwarf headers from logduration install Mar 16, 2026
Copilot AI requested a review from rwvo March 16, 2026 20:37
Copilot finished work on behalf of rwvo March 16, 2026 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove libdwarf headers from logduration install

2 participants