MantisBT - CMake
View Issue Details
0013412CMakeCPackpublic2012-07-17 16:562016-06-10 14:31
imMute 
Eric NOULARD 
normalblockalways
closedmoved 
Ubuntu12.04
CMake 2.8.7 
 
0013412: [regression] cpack silently fails to build debian
cpack silently fails:

    imMute@blah$ cpack --config blah.cmake
    CPack: Create package using DEB
    CPack: Install projects
    CPack: - Run preinstall target for: ALL
    CPack: - Install project: ALL
    CPack: Create package
    imMute@blah$

--debug --verbose brings a little more useful information:

    imMute@blah$ cpack --config blah.cmake
    /tmp/cmake-2.8.9-rc2/Source/CPack/cmCPackGenerator.cxx:1048 Done install project
    /tmp/cmake-2.8.9-rc2/Source/CPack/cmCPackGenerator.cxx:1056 Find files
    CPack: /tmp/cmake-2.8.9-rc2/Source/CPack/cmCPackGenerator.cxx:1069 Create package
    CPack Verbose: /tmp/cmake-2.8.9-rc2/Source/CPack/cmCPackGenerator.cxx:1071 Package files to: /home/blah/blah/build/_CPack_Packages/Linux/DEB/blah_2.4.2-r1.10_armel.deb
    /tmp/cmake-2.8.9-rc2/Source/CPack/cmCPackGenerator.cxx:1203 Warning, GetOption return NULL for: CPACK_INCLUDE_TOPLEVEL_DIRECTORY
    CPack Verbose: /tmp/cmake-2.8.9-rc2/Source/CPack/cmCPackGenerator.cxx:1110 Copying final package(s) [0]:

Looking at cmCPackGenerator.cxx around those lines, it appears tempPackageFileName is set by line 1017 (it's seen in the output rather than "(NULL)") but on line 1055 it appears packageFileNames is empty (or at least .size() returns zero).
packageFileNames is modified on line 1040:
    packageFileNames.push_back(tempPackageFileName);


This bug exists in both 2.8.7 (ubuntu 12.04) and 2.8.9-rc2 (compiled from source).
the blah.cmake is as follows:

SET(CPACK_BINARY_BUNDLE "")
SET(CPACK_BINARY_CYGWIN "")
SET(CPACK_BINARY_DEB "")
SET(CPACK_BINARY_DRAGNDROP "")
SET(CPACK_BINARY_NSIS "")
SET(CPACK_BINARY_OSXX11 "")
SET(CPACK_BINARY_PACKAGEMAKER "")
SET(CPACK_BINARY_RPM "")
SET(CPACK_BINARY_STGZ "")
SET(CPACK_BINARY_TBZ2 "")
SET(CPACK_BINARY_TGZ "")
SET(CPACK_BINARY_TZ "")
SET(CPACK_BINARY_ZIP "")
SET(CPACK_CMAKE_GENERATOR "Unix Makefiles")
SET(CPACK_COMPONENTS_ALL "blah;blah1;blah2;blah3;blah4")
SET(CPACK_COMPONENT_UNSPECIFIED_HIDDEN "TRUE")
SET(CPACK_COMPONENT_UNSPECIFIED_REQUIRED "TRUE")
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "armel")
SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "---snipped---")
SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Blah package")
SET(CPACK_DEBIAN_PACKAGE_ESSENTIAL "no")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Me")
SET(CPACK_DEBIAN_PACKAGE_PROVIDES "blah")
SET(CPACK_DEBIAN_PACKAGE_SECTION "applications")
SET(CPACK_DEBIAN_PACKAGE_VERSION "2.4.2-r1.10")
SET(CPACK_DEB_COMPONENT_INSTALL "ON")
SET(CPACK_GENERATOR "DEB")
SET(CPACK_INSTALL_CMAKE_PROJECTS "/home/blah/blah/build;ALL;blah;/home/blah/blah/source")
SET(CPACK_INSTALL_PREFIX "/home/blah/blah/build/install/usr")
SET(CPACK_MODULE_PATH "")
SET(CPACK_MONOLITHIC_INSTALL "0")
SET(CPACK_NSIS_DISPLAY_NAME "blah 2")
SET(CPACK_NSIS_INSTALLER_ICON_CODE "")
SET(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "")
SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
SET(CPACK_NSIS_PACKAGE_NAME "blah 2")
SET(CPACK_OUTPUT_CONFIG_FILE "/home/blah/blah/build/blah.cmake")
SET(CPACK_PACKAGE_DEFAULT_LOCATION "/")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "/usr/share/cmake-2.8/Templates/CPack.GenericDescription.txt")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "")
SET(CPACK_PACKAGE_FILE_NAME "blah_2.4.2-r1.10_armel")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "blah 2")
SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "blah 2")
SET(CPACK_PACKAGE_NAME "blah")
SET(CPACK_PACKAGE_RELOCATABLE "true")
SET(CPACK_PACKAGE_VENDOR "Humanity")
SET(CPACK_PACKAGE_VERSION "2")
SET(CPACK_PACKAGE_VERSION_MAJOR "4")
SET(CPACK_PACKAGE_VERSION_MINOR "2")
SET(CPACK_PACKAGE_VERSION_PATCH "r1.10")
SET(CPACK_RESOURCE_FILE_LICENSE "/usr/share/cmake-2.8/Templates/CPack.GenericLicense.txt")
SET(CPACK_RESOURCE_FILE_README "/usr/share/cmake-2.8/Templates/CPack.GenericDescription.txt")
SET(CPACK_RESOURCE_FILE_WELCOME "/usr/share/cmake-2.8/Templates/CPack.GenericWelcome.txt")
SET(CPACK_SET_DESTDIR "OFF")
SET(CPACK_SOURCE_CYGWIN "")
SET(CPACK_SOURCE_GENERATOR "TGZ;TBZ2;TZ")
SET(CPACK_SOURCE_OUTPUT_CONFIG_FILE "/home/blah/blah/build/CPackSourceConfig.cmake")
SET(CPACK_SOURCE_TBZ2 "ON")
SET(CPACK_SOURCE_TGZ "ON")
SET(CPACK_SOURCE_TZ "ON")
SET(CPACK_SOURCE_ZIP "OFF")
SET(CPACK_SYSTEM_NAME "Linux")
SET(CPACK_TOPLEVEL_TAG "Linux")
No tags attached.
Issue History
2012-07-17 16:56imMuteNew Issue
2012-07-17 17:50Rolf Eike BeerNote Added: 0030067
2012-07-17 17:50Rolf Eike BeerAssigned To => Eric NOULARD
2012-07-17 17:50Rolf Eike BeerStatusnew => assigned
2012-07-17 17:50Rolf Eike BeerSummarycpack silently fails to build debian => [regression] cpack silently fails to build debian
2012-07-17 18:58Eric NOULARDNote Added: 0030068
2012-07-30 09:22imMuteNote Added: 0030153
2012-08-07 13:31Eric NOULARDNote Added: 0030186
2012-08-14 17:26Eric NOULARDNote Added: 0030658
2012-08-14 17:26Eric NOULARDStatusassigned => feedback
2012-12-20 11:07Eric NOULARDCategoryCMake => CPack
2016-06-10 14:28Kitware RobotNote Added: 0042090
2016-06-10 14:28Kitware RobotStatusfeedback => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0030067)
Rolf Eike Beer   
2012-07-17 17:50   
User said on IRC it worked in 2.8.4.
(0030068)
Eric NOULARD   
2012-07-17 18:58   
I'll have a look at this this week-end (I won't have time before that).

Would it be possible to have more informations:
 
- Do other CPack generators fails as well (RPM, TGZ, ZIP ???)
  on the very same project if they don't do they produce
  package with the expected content ?

- What does
  make DESTDIR=/tmp/bb install
  do ?
  Does this install something or not?

- Does the packaging work with
  CPACK_DEB_COMPONENT_INSTALL set to OFF?

- Is this a cross-packaging or native packaging?
  I.e. is "armel" the architecture of the host and targt system?

- Worked with 2.8.4 on Ubuntu 12.04? Or on previous version of Ubuntu?

- Is it possible to have stripped down sample project that exhibit
  the problem or does the concerned project have public source accessibility?
(0030153)
imMute   
2012-07-30 09:22   
> Do other CPack generators fails as well (RPM, TGZ, ZIP ???)
  on the very same project if they don't do they produce
  package with the expected content ?

Did not attempt.

> What does
  make DESTDIR=/tmp/bb install
  do ?
  Does this install something or not?

When should I run this command? As I said in the original report, the problem seems to be with cpack...

> Does the packaging work with
  CPACK_DEB_COMPONENT_INSTALL set to OFF?

I added `SET(CPACK_DEB_COMPONENT_INSTALL "OFF")` to the generated blah.cmake, and that seemed to make it work

> Is this a cross-packaging or native packaging?

It's for a cross-compiled application.


> Worked with 2.8.4 on Ubuntu 12.04? Or on previous version of Ubuntu?

It works with cpack 2.8.4 on Ubuntu 10.04 I have not tried cpack 2.8.4 on Ubuntu 12.04, but I could try that if I have time this week.


> Is it possible to have stripped down sample project that exhibit
  the problem or does the concerned project have public source accessibility?

It's a closed source project, so I can't share the original cmake project, sorry.

-----

So it seems that CPACK_DEB_COMPONENT_INSTALL was the culprit.
(0030186)
Eric NOULARD   
2012-08-07 13:31   
>> make DESTDIR=/tmp/bb install
>> Does this install something or not?

> When should I run this command?

In the build tree instead of running cpack.

> As I said in the original report, the problem
> seems to be with cpack...

CPack is using the same kind of command "internally"
so I was trying to get more information from this one.

>> Is this a cross-packaging or native packaging?
> It's for a cross-compiled application.

Cross-packaging is not supported by CPack,
it may incidentally work but be prepared for weird behavior.
By the way what is the host and what is the target?

Do you use some embbeded toolkit for compiling/building?

> So it seems that CPACK_DEB_COMPONENT_INSTALL was the culprit.

There may be a bug in the "componentize" packaging for deb.
But without a test case it will be difficult to find out.

Did you face similar issue with non-cross-compiled package content?
(0030658)
Eric NOULARD   
2012-08-14 17:26   
Waiting for feedback before trying to go further.

If the error is "only" appear when cross-packaging then
this will have to wait until "plain" package have their
bug/feature requests planned for 2.8.10 fixed.
(0042090)
Kitware Robot   
2016-06-10 14:28   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.