CPack/Deb: Infinite loop in path algorithm in cpack / debian
Hi, I posted at SO this question https://stackoverflow.com/questions/59019971/cpack-never-finishes-at-100-cpu-infinite-loop-in-path-algorithm about DEB generation being stuck.
There is more information there, but here for the record, for some reason this loop in cmCPackDebGenerator.cxx
never exits if currentPath=="/"
which somehow happens in my case (the input for cpack might be erroneous, but it should nevertheless inform and not get stuck) @ https://gitlab.kitware.com/cmake/cmake/blob/master/Source/CPack/cmCPackDebGenerator.cxx#L194 :
for (std::string currentPath : PackageFiles) {
while (currentPath != WorkDir) {
// the last one IS WorkDir, but we do not want this one:
// XXX/application/usr/bin/myprogram with GEN_WDIR=XXX/application
// should not add XXX/application
orderedFiles.insert(currentPath);
currentPath = cmSystemTools::CollapseCombinedPath(currentPath, "..");
}
}
I don't have a small isolated MWE currently as it is from a project I cannot disclose publicly.
Edited by Brad King