MantisBT - CMake |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0013193 | CMake | CPack | public | 2012-05-05 09:40 | 2013-01-09 10:57 |
|
Reporter | Shlomi Fish | |
Assigned To | Eric NOULARD | |
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | |
Platform | x86-64 | OS | Linux | OS Version | Mageia Linux 2 |
Product Version | CMake 2.8.7 | |
Target Version | CMake 2.8.9 | Fixed in Version | CMake 2.8.9 | |
|
Summary | 0013193: All the Files in the Source Tarballs (from "make package_source" on UNIX-like platforms) Have Close (and Arbitrary) Timestamps |
Description | All the Files in the Source Tarballs (from "make package_source" on UNIX-like platforms) Have Close (and Arbitrary) Timestamps. This is because the files are copied to their directories without preserving their original timestamps, in an arbitrary order (and then they are tarballed).
This interferes with my workflow because I keep some generated files in the source archive (without putting them in my CPACK_SOURCE_IGNORE_FILES ) so they will be available without being needed to be generated again (for example, some documentation files I have require AsciiDoc and the DocBook/XML toolchain to install, and I don't want to require the end-users to have it.). So "make" often tries to build them again and it may interfere with the workflow. |
Steps To Reproduce | On Linux/UNIX: "mkdir build ; cd build ; cmake .. ; make package_source; tar -tvf *.tar.gz | less" |
Additional Information | |
Tags | No tags attached. |
Relationships | related to | 0012865 | closed | Kitware Robot | CPack generated archives don't have correct permissions when cross compiling on windows |
|
Attached Files | 0001-CPack-preserve-timestamp-for-CPACK_INSTALLED_DIRECTO.patch (1,267) 2012-05-09 12:05 https://public.kitware.com/Bug/file/4321/0001-CPack-preserve-timestamp-for-CPACK_INSTALLED_DIRECTO.patch |
|
Issue History |
Date Modified | Username | Field | Change |
2012-05-05 09:40 | Shlomi Fish | New Issue | |
2012-05-07 07:11 | Eric NOULARD | Note Added: 0029409 | |
2012-05-08 03:38 | Shlomi Fish | Note Added: 0029417 | |
2012-05-09 07:16 | Shlomi Fish | Note Added: 0029429 | |
2012-05-09 12:00 | Eric NOULARD | Note Added: 0029432 | |
2012-05-09 12:05 | Eric NOULARD | Assigned To | => Eric NOULARD |
2012-05-09 12:05 | Eric NOULARD | Status | new => assigned |
2012-05-09 12:05 | Eric NOULARD | File Added: 0001-CPack-preserve-timestamp-for-CPACK_INSTALLED_DIRECTO.patch | |
2012-05-09 12:06 | Eric NOULARD | Note Added: 0029433 | |
2012-05-09 14:51 | Shlomi Fish | Note Added: 0029437 | |
2012-05-09 16:57 | Eric NOULARD | Note Added: 0029461 | |
2012-05-09 16:57 | Eric NOULARD | Status | assigned => resolved |
2012-05-09 16:57 | Eric NOULARD | Resolution | open => fixed |
2012-05-09 16:58 | Eric NOULARD | Status | resolved => feedback |
2012-05-09 16:58 | Eric NOULARD | Resolution | fixed => reopened |
2012-05-09 16:58 | Eric NOULARD | Status | feedback => resolved |
2012-05-09 16:58 | Eric NOULARD | Resolution | reopened => fixed |
2012-05-09 16:58 | Eric NOULARD | Target Version | => CMake 2.8.9 |
2012-08-09 19:34 | David Cole | Fixed in Version | => CMake 2.8.9 |
2012-08-12 03:12 | Eric NOULARD | Relationship added | related to 0012865 |
2013-01-09 10:57 | Robert Maynard | Note Added: 0032046 | |
2013-01-09 10:57 | Robert Maynard | Status | resolved => closed |
Notes |
|
(0029409)
|
Eric NOULARD
|
2012-05-07 07:11
|
|
It would be nice to fulfill your need but currently source packaging is done
by CPack using a copy to a temp place (as you noticed).
The "real" trouble is that currently CPack know nothing about "Source" package,
for CPack sources packages are "normal" packages which are "installed" using a directory name.
If you look at CPackSourceConfig.cmake generated by CPack.cmake you'll see that this file sets CPACK_INSTALLED_DIRECTORIES (and not CPACK_INSTALL_CMAKE_PROJECTS as CPackConfig.cmake does).
This makes CPack copy the content of the specified directories (in this case a single one, the source directory) to <buildtree>/_CPack_Packages/xxxx-Source/<GENNAME>/TOPDIR/.
The copy filters the files matching "CPACK_SOURCE_IGNORE_FILES".
Then this directory is "packaged" using the choosen CPack generator.
Changing this workflow for "source" package may not be that simple
in the general case.
I don't know if it's even worth the effort.
If you want to distribute source which does not need some tool to be there
to be compiled then I suggest you add some CMake option
REGENERATE_WHATEVER_FILE
whose default is "OFF".
your custom target/command may be guarded by an
IF(REGENERATE_WHATEVER_FILE)
...
ENDIF()
developer have then to know that they must toggle REGENERATE_WHATEVER_FILE to ON whereas "standard" user won't be bothered by the regeneration of those files.
I know it's a workaround, but what do you think? |
|
|
(0029417)
|
Shlomi Fish
|
2012-05-08 03:38
|
|
@Eric: I have read your message (though I have yet to read it thoroughly) and I will make a full reply to it as soon as I get to it. Please stay tuned. |
|
|
(0029429)
|
Shlomi Fish
|
2012-05-09 07:16
|
|
|
|
(0029432)
|
Eric NOULARD
|
2012-05-09 12:00
|
|
Hi Shlomi,
Yes you are almost right.
You are right we could copy file time, a function is already there for
that in the CMake source: cmSystemTools::CopyFileTime.
But I doubt that any CPack code do take care of that.
The "FILE(INSTALL" command used in cmake_install.cmake script generated
by CMake.
What happen is that files installed with "cmake_install.cmake" scripts
do get appropriate timestamp but CPACK_INSTALLED_DIRECTORIES don't.
The function to be modified for CPack is this one:
cmCPackGenerator::InstallProjectViaInstalledDirectories
for which we may add the extra cmSystemTools::CopyFileTime where it is missing.
I'll try a patch, stay tuned. |
|
|
(0029433)
|
Eric NOULARD
|
2012-05-09 12:06
|
|
Patch against CMake master is attached.
Would you be able to try whether if it works for you? |
|
|
(0029437)
|
Shlomi Fish
|
2012-05-09 14:51
|
|
Hi Eric,
your patch works fine for me and my use case. "make test" passes with blazing colours.
Regards,
-- Shlomi Fish |
|
|
(0029461)
|
Eric NOULARD
|
2012-05-09 16:57
|
|
Merge topic 'CPack-preserveTimestampInSourcePackage' into next
3d10f65 CPack - preserve timestamp for CPACK_INSTALLED_DIRECTORIES. fixes: 0013193 |
|
|
(0032046)
|
Robert Maynard
|
2013-01-09 10:57
|
|
Closing resolved issues that have not been updated in more than 4 months. |
|