[cmake-developers] CPackRPM not dealing correctly with symlinks

Attila Krasznahorkay attila.krasznahorkay at gmail.com
Wed Mar 23 08:44:52 EDT 2016


Dear All,

Not sure what's the best way to post this issue, so I thought I'd send around an e-mail first.

We've been struggling with some RPM building errors in some of our projects for a while now. Finally I was able to understand what the cause of the issue is.

In some cases we put symbolic links into the installation area of our projects that themselves point to other symbolic links, outside of the project. When this happens, the RPM building dies with a message like:

CMake Error at /afs/cern.ch/sw/lcg/contrib/CMake/3.3.2/Linux-x86_64/share/cmake-3.3/Modules/CPackRPM.cmake:906 (string):
string begin index: 164 is out of range 0 - 156 
Call Stack (most recent call first): 
/afs/cern.ch/sw/lcg/contrib/CMake/3.3.2/Linux-x86_64/share/cmake-3.3/Modules/CPackRPM.cmake:1535 (cpack_rpm_prepare_install_files) 
/afs/cern.ch/sw/lcg/contrib/CMake/3.3.2/Linux-x86_64/share/cmake-3.3/Modules/CPackRPM.cmake:1697 (cpack_rpm_generate_package)

For some of the files this is actually a bug on our end, as we need to make sure that we install actual files with the project, not a symlink to a file.

But I also ran into another case where avoiding CPackRPM to deal with such a link-to-a-link setup is not easily avoidable. Does anyone have an idea how the CPackRPM.cmake code should be protected against such issues? Printing warnings about such files, saying that the produced RPM will not be fully relocatable, is fine. We just need to avoid outright errors during the RPM building.

Cheers,
             Attila


More information about the cmake-developers mailing list