View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0016051CMakeCPackpublic2016-04-06 09:462016-06-10 14:31
Reporterbenoit.barbier 
Assigned ToKitware Robot 
PriorityhighSeveritymajorReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSOS Version
Product VersionCMake 3.4 
Target VersionFixed in Version 
Summary0016051: Incorrect archive generated with CPACK_ARCHIVE_COMPONENT_INSTALL=ON with non-empty directory behind a symlink
Descriptioncmake_minimum_required(VERSION 3.0.0)

# generate files & folders
make_directory(${CMAKE_CURRENT_BINARY_DIR}/sample)
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/sample/dummy.txt "")
execute_process(
    COMMAND mkdir folder
    COMMAND ln -s folder alias
    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/sample)

FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/sample/folder/file.txt "")

# install 2 different components
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/sample/dummy.txt DESTINATION "." COMPONENT cmp1)

install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/sample/alias DESTINATION "." COMPONENT cmp2)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/sample/folder DESTINATION "." COMPONENT cmp2)

set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)

include(cpack)

=======================

Run cmake, then cpack -G TGZ or ZIP. Open the archive of the second component (cmp2), and you get an error:

 >> unzip Project-0.1.1-Darwin-cmp2.zip
"
Archive: Project-0.1.1-Darwin-cmp2.zip
    linking: alias -> folder
checkdir error: alias exists but is not directory
                 unable to process alias/dummy.txt.
   creating: folder/
  inflating: folder/dummy.txt
finishing deferred symbolic links:
  alias -> folder
"
=======================

This append only if you specify CPACK_ARCHIVE_COMPONENT_INSTALL= ON and there is a file created into the folder (folder/file.txt). If the folder is empty, no error are generated by the unzip.

Seems to be appear when this feature have been introduced in CPack (cmake 3.4 release notes) :
The CPack module learned to package empty directories.

Often append if you package a bundle with frameworks...
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0042977)
Kitware Robot (administrator)
2016-06-10 14:29

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.

 Issue History
Date Modified Username Field Change
2016-04-06 09:46 benoit.barbier New Issue
2016-06-10 14:29 Kitware Robot Note Added: 0042977
2016-06-10 14:29 Kitware Robot Status new => resolved
2016-06-10 14:29 Kitware Robot Resolution open => moved
2016-06-10 14:29 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team