MantisBT - CMake
View Issue Details
0013700CMakeCPackpublic2012-11-18 07:252015-10-13 15:52
Konstantin Cherenkov 
Raffi Enficiaud 
normalminoralways
closedfixed 
Ubuntu12.04
CMake 2.8.7 
CMake 3.4 
0013700: CPack fails from fakeroot
CPackDeb fails if deb files are created from fakeroot

CPack: Create package
CPack Error: Problem running tar command: /usr/bin/fakeroot "/usr/bin/cmake" -E tar cfz data.tar.gz ./usr
Please check [...]/build/_CPack_Packages/Linux/DEB/Deb.log for errors
CPack Error: Problem compressing the directory

Deb.log contains this message:
fakeroot: nested operation not yet supported
fakeroot
mkdir build
cd build
cmake ..
cpack
No tags attached.
related to 0010325closed Eric NOULARD DEB packaging Set files ownership 
Issue History
2012-11-18 07:25Konstantin CherenkovNew Issue
2012-11-18 07:41Eric NOULARDAssigned To => Eric NOULARD
2012-11-18 07:41Eric NOULARDStatusnew => assigned
2012-11-18 07:44Eric NOULARDRelationship addedrelated to 0010325
2012-11-18 07:52Eric NOULARDNote Added: 0031601
2012-11-18 07:54Eric NOULARDNote Edited: 0031601bug_revision_view_page.php?bugnote_id=31601#r923
2012-11-18 10:22Konstantin CherenkovNote Added: 0031602
2012-11-18 10:24Konstantin CherenkovNote Edited: 0031602bug_revision_view_page.php?bugnote_id=31602#r925
2012-11-18 10:29Konstantin CherenkovNote Edited: 0031602bug_revision_view_page.php?bugnote_id=31602#r926
2012-11-18 11:11Eric NOULARDNote Added: 0031603
2012-11-18 11:11Eric NOULARDProduct VersionCMake-2-6 => CMake 2.8.7
2015-09-13 15:58Raffi EnficiaudAssigned ToEric NOULARD => Raffi Enficiaud
2015-09-20 10:21Raffi EnficiaudNote Added: 0039451
2015-10-13 15:52Raffi EnficiaudNote Added: 0039597
2015-10-13 15:52Raffi EnficiaudStatusassigned => closed
2015-10-13 15:52Raffi EnficiaudResolutionopen => fixed
2015-10-13 15:52Raffi EnficiaudFixed in Version => CMake 3.4

Notes
(0031601)
Eric NOULARD   
2012-11-18 07:52   
(edited on: 2012-11-18 07:54)
Hi Konstantin,

Could you confirm the CMake version you use is 2.6.x ?
Since CMake 2.8.6 CPack is calling fakeroot automagically so may
be this leads to
"fakeroot: nested operation not yet supported"
because CPack is calling fakeroot while you already did.

Note that from my understanding calling cmake from within a fakeroot
may not be a good idea. See the documentation from fakeroot:

"GNU configure (and other such programs)
    fakeroot, in effect, is changing the way the system behaves. Programs that probe the system like GNU configure may get confused by this (or if they don't, they may stress fakeroot so much that fakeroot itself becomes confused). So, it's advisable not to run "configure" from within fakeroot. As configure should be called in the "debian/rules build" target, running "dpkg-buildpackage -rfakeroot" correctly takes care of this."

So CPackDeb may already be doing a better jobs because it only calls
fakeroot for installing and packaging and not "globally".

That said I may modify the "automatic fakeroot" call in order to avoid
calling it again if we already are fakerooting.

Checking for the definition of FAKEROOTKEY env var should be enough
what do you think?

(0031602)
Konstantin Cherenkov   
2012-11-18 10:22   
(edited on: 2012-11-18 10:29)
Hi Eric,

You are right, it seems like we are calling fakeroot twice. I am trying to automatically build package on Launchpad with cmake/cpack, so they are doing this through fakeroot by default.
I think that checking if we are already fakeroot to avoid calling it again is the best solution.
If I am not mistaken, cmake version is 2.8.7.

Thank you for your quick response.

Also could you give me advice if it is possible to workaround this issue on Launchpad?
build log is here https://launchpadlibrarian.net/123334744/buildlog_ubuntu-precise-i386.simple-gmail-notifier_0.1.3_FAILEDTOBUILD.txt.gz [^]

(0031603)
Eric NOULARD   
2012-11-18 11:11   
Obviously you are not the only one to be stricken by this
https://bugs.launchpad.net/bzr-builder/+bug/709146 [^]

I'm not aware of any workaround for that, but I'm not launchpad user.

I'll try a fix in CPackDeb.
(0039451)
Raffi Enficiaud   
2015-09-20 10:21   
Now using the libarchive functionality for creating archives (instead of creating archives from cmake command line under fakeroot)

See commit:

http://www.cmake.org/gitweb?p=cmake.git;a=commit;h=3b099fd [^]
(0039597)
Raffi Enficiaud   
2015-10-13 15:52   
cmake 3.4.0 rc1 includes the appropriate changes.
Commit 7044e8ee

https://cmake.org/gitweb?p=cmake.git;a=commit;h=7044e8ee [^]