View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008790CMakeCPackpublic2009-03-25 07:422011-05-02 14:46
ReporterThomas Wunschel 
Assigned ToMathieu Malaterre 
PrioritynormalSeverityminorReproducibilitysometimes
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake-2-6 
Target VersionFixed in VersionCMake 2.8.4 
Summary0008790: Generated deb packages sometimes cannot be installed correctly
DescriptionWhen using the deb generator, some resulting packages cannot be installed correctly using "dpkg -i <packagename>": Alltough the package contents are listed correctly using "dpkg --contents <packagename>", some files get installed in the root ("/") directory instead of their correct location.

I contacted a dpkg developer regarding that problem. According to him the reason for the problem is because debian packages should be created using the gnu tar format and cpack is currently using it's built-in tar command.

The problem already has been addressed in dpkg (see http://git.debian.org/?p=dpkg/dpkg.git;a=commit;h=53b1f8871fea748e0360bf9183735ab54f7a1f64 [^] for more details) and dpkg built from source now handles the package correctly.

However, as the problem occurs during package installation time, users of deb-based distros will currently not be able to correctly install the package produced by cmake.

The attached patch tries to circumvent the problem by using the system-installed tar command when creating debian packages.
Additional InformationI've uploaded an example of a package showing the described behaviour to http://212.227.78.199/~wuschi/blackray-thirdparty_0.8.0_Linux-i686.deb [^]
TagsNo tags attached.
Attached Filespatch file icon cpack_deb_use_system_tar.patch [^] (1,601 bytes) 2009-03-25 07:42 [Show Content]
gz file icon cpack-deb-bug.tar.gz [^] (552 bytes) 2010-06-16 15:53

 Relationships

  Notes
(0023692)
Mathieu Malaterre (developer)
2010-12-03 07:33

Hi,

  I perfectly understand the problem. However my initial patch did use BSD-tar in its first implementation. There must have been a regression that now tar is now GNU tar. I believe there should be a better patch for this issue, like using libarchive with the proper flag to generate a BSD-tar compatible archive.

HTH
(0024488)
Bill Hoffman (manager)
2011-01-06 16:36

Is this still an issue?
(0024503)
Eric NOULARD (developer)
2011-01-07 02:33

I don't know.
But clearly the patch (against 2.6.3) didn't make it to the source.
The patch proposed to replace "cmake -E tar" with "system tar"
command (if found).

Currently the cmake -E tar command uses cmlibarchive wrapper
(CreateTar in cmSystemTools.cxx uses cmArchiveWrite.h/cxx)
to create a "pax" format tar i.e. "POSIX pax interchange".

As Mathieu noted we may try to replace that with direct
[cm]libarchive call and specify either:

archive_write_set_format_gnutar --> GNU Tar
archive_write_set_format_ar_bsd --> BSD Tar

I may try to check whether if the problem still exist this week-end unless Thomas or Mathieu can do it.

I won't probably be able to propose a patch though.
The probable patch may need to create an extra "cmArchive Type"
TypeGNUTar and/or TypeBSDTar (instead of current TypeTAR) in order
to use the existing libarchive wrapper (see cmArchiveWrite.cxx/h)
not a big deal but need some work + test.

Sidenote: At the same time it would be nice to throw away OpenBSD ar
copy/paste code inside CPack/cmCPackDebGenerator.cxx and use cmlibarchive
with BSD Tar format.
(0024524)
Eric NOULARD (developer)
2011-01-08 19:24

I did just test using CMake 2.8.3 on Ubuntu 10.04
I have no problem with the installed .deb
(I did use the cpack-deb-bug.tar.gz)

Note that I did try the should-be-buggy "http://212.227.78.199/~wuschi/blackray-thirdparty_0.8.0_Linux-i686.deb" [^]

And I cannot reproduce the problem either.
I think I won't be able to help until being able to reproduce the problem...

As a side note I did have a look at CMake 2.6.3 code and
at that time the -E tar command was implemented by "libtar" there was
not cmlibarchive usage at all.
So there are many difference.

I would suggest to Thomas to try to reproduce the bug with CMake 2.8.3
if it is not possible I suggest closing the bug because it is at best
obsolete w.r.t. the current CMake source code.
(0025014)
David Cole (manager)
2011-01-21 19:01

Marking as resolved, assuming fixed in CMake 2.8.4 based on the recently added notes.

Please re-open this issue if there is still a problem with CMake 2.8.4 or later.
(0026374)
David Cole (manager)
2011-05-02 14:46

Closing resolved issues that have not been updated in more than 3 months.

 Issue History
Date Modified Username Field Change
2009-03-25 07:42 Thomas Wunschel New Issue
2009-03-25 07:42 Thomas Wunschel File Added: cpack_deb_use_system_tar.patch
2009-09-14 15:06 Bill Hoffman Status new => assigned
2009-09-14 15:06 Bill Hoffman Assigned To => Mathieu Malaterre
2010-06-16 15:53 Di-an Jan File Added: cpack-deb-bug.tar.gz
2010-12-03 07:33 Mathieu Malaterre Note Added: 0023692
2010-12-03 07:33 Mathieu Malaterre Status assigned => feedback
2011-01-06 16:36 Bill Hoffman Note Added: 0024488
2011-01-07 02:33 Eric NOULARD Note Added: 0024503
2011-01-08 19:24 Eric NOULARD Note Added: 0024524
2011-01-21 19:01 David Cole Note Added: 0025014
2011-01-21 19:01 David Cole Status feedback => resolved
2011-01-21 19:01 David Cole Fixed in Version => CMake 2.8.4
2011-01-21 19:01 David Cole Resolution open => fixed
2011-05-02 14:46 David Cole Note Added: 0026374
2011-05-02 14:46 David Cole Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team