[cmake-developers] [CPack] CPackDeb and fakeroot

Raffi Enficiaud raffi.enficiaud at mines-paris.org
Tue Aug 25 09:42:01 EDT 2015


Hi Domen, Brad and CMake developers,

I am trying to create my packages in Launchpad, which uses a pbuilder 
environment for building the packages, directly using CMake>=3.3 (which 
contains the nice recent fixes).

I got the following error when I execute the build of a source package 
from pbuilder:

------------
CPack Error: 
/build/cmake-AHTLnO/cmake-3.3travisci1/Source/CPack/cmCPackDebGenerator.cxx:483 
Problem running tar command: /usr/bin/fakeroot "/usr/bin/cmake" -E tar 
czf data.tar.gz
Please check /«BUILDDIR»/build_dir/_CPack_Packages/Linux/DEB/Deb.log for 
errors
------------

The full logs for the curious ppl may be found here:
https://launchpadlibrarian.net/215456337/buildlog_ubuntu-trusty-amd64.yayi_0.8.8.1_BUILDING.txt.gz

Basically in my case, the debian/rule file calls cmake and cpack to 
generate the deb packages.
pbuilder mimics a clean build environment that is used on Launchpad for 
isolating the build, and I believe (not sure) it calls fakeroot under 
the hood.

To my understanding fakeroot is a "workaround" to have the proper 
credentials in the tar of the .deb packages since the libarchive used in 
cmake was not allowing that at that time:

- http://public.kitware.com/Bug/view.php?id=11766
- http://public.kitware.com/Bug/view.php?id=13118
- http://public.kitware.com/Bug/view.php?id=12901


I am wondering if, instead of always using fakeroot:
- there is now the possibility to set the user in libarchive (even if it 
is the case, this would mean that cmake -E tar is able to understand 
those options)
- if we can get rid of the fakeroot in some circumstances? eg. a 
variable that would avoid using the fakeroot or detecting that the user 
is already root
- unifying the tool used for creating the tar: from the code in 
cmCPackDebGenerator.cxx, some compression schemes use the native tar 
while some others use the cmake tar.

What would be the best option for you?

I believe it would address this issues already in the backlog (and help 
ppl deploy things on Launchpad with cmake):
- http://public.kitware.com/Bug/view.php?id=13700
- http://public.kitware.com/Bug/view.php?id=11766


Thanks for your feedbacks,
Best,
Raffi Enficiaud



More information about the cmake-developers mailing list