Why doesn't asserting CPACK_DEBIAN_DEBUGINFO_PACKAGE result in a .ddeb file?

317 Views Asked by At

I'm attempting to use cpack to create .ddeb files (containing debug symbol info) for my cmake based project using set(CPACK_DEBIAN_DEBUGINFO_PACKAGE ON) and can't tell why I'm not getting a .ddeb file being produced alongside the .deb file that is being produced correctly. The contents of main.cpp is minimal and unimportant; here's my CMakeLists.txt file:

cmake_minimum_required(VERSION 3.13)
  
set(TEST_CPACK_DDEB_VERSION 0.7.6)
set(PROJECT_NAME TestCPackDDEB)
set(TEST_CPACK_DDEB_PROJECT TestCPackDDEBProject)
project(${PROJECT_NAME} VERSION ${TEST_CPACK_DDEB_VERSION} LANGUAGES CXX)

include(GNUInstallDirs)

set(SOURCES main.cpp)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
add_executable(${PROJECT_NAME} ${SOURCES})

set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17)

install(TARGETS ${PROJECT_NAME}
        DESTINATION /usr/bin)

export(PACKAGE ${PROJECT_NAME})
set(CPACK_PACKAGE_NAME "testcpackddeb")
set(CPACK_PACKAGE_CONTACT "L User <[email protected]>")
set(CPACK_PACKAGE_DESCRIPTION "Not just another generator")
set(CPACK_DEB_COMPONENT_INSTALL ON)
set(CPACK_DEBIAN_COMPRESSION_TYPE "gzip")
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
set(CPACK_DEBIAN_DEBUGINFO_PACKAGE ON)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "")
include(CPack)

I've tried this with both cmake versions 3.16.3 (ubuntu 20.04) and 3.19.1 but get identical outcomes. Here's the sequence of commands I run:

mkdir build
cmake -DCMAKE_BUILD_TYPE=Debug ..
make -j 8
cpack -G DEB

Surely a separate .ddeb file should be created, since I sure don't see a .debug file in the .deb package (using dpkg --contents) ...

Edit: In cmake version 3.22.1 (ubuntu 22.04) this bug seems to be fixed; .ddeb files are now being generated yay!

1

There are 1 best solutions below

2
On

Looks like it's not a usage problem at all -- it's just an upstream bug, like, it's broken.