[CMake] Issues using CPack for making a debian package
Hi, (I'm using CMake 3.2) I have a project which is using CMake and CPack to create a debian package. It currently seems to be working fine but when I set CPACK_DEBIAN_PACKAGE_DEBUG to ON and dig in the logs, I see this: dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory dpkg-shlibdeps: warning: couldn't find library libparameter.so needed by ./usr/bin/domainGeneratorConnector (ELF format: 'elf64-x86-64'; RPATH: '') dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory dpkg-shlibdeps: warning: couldn't find library libparameter.so needed by ./usr/lib/libcparameter.so (ELF format: 'elf64-x86-64'; RPATH: '') [...] Despite these warnings, the "Depends:" field is correctly filled. Now, I would like to add version information to my shared libraries like so: set_target_properties(parameter PROPERTIES VERSION 3.2.4) After that, when I run cpack again, I get this: dpkg-shlibdeps: error: couldn't find library libparameter.so.3.2.4 needed by ./usr/bin/test-platform (ELF format: 'elf64-x86-64'; RPATH: '') dpkg-shlibdeps: warning: couldn't find library libremote-processor.so needed by ./usr/bin/test-platform (ELF format: 'elf64-x86-64'; RPATH: '') dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory dpkg-shlibdeps: error: couldn't find library libparameter.so.3.2.4 needed by ./usr/lib/python2.7/dist-packages/_PyPfw.so (ELF format: 'elf64-x86-64'; RPATH: '') dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory [...] I don't know why but dpkg-shlibeps has a special treatment for libraries that have a version number in their name, turning warnings into errors. So, I've done some research and I found two things: - There's a closed bug entry and a very recent patch (https://cmake.org/Bug/view.php?id=12431; https://cmake.org/gitweb?p=cmake.git;a=log) that will help fixing this; - The documentation advises setting the CMAKE_INSTALL_RPATH variable (but doesn't give any clue as to what value it should be set to). However, I don't want to do that because: a) it impacts the other use-cases; b) the rpath will stay in the binaries delivered through the debian package. I'd like to point out that dpkg-shlibdeps has a `-l` option that looks to me like the best tool for the job (compared to the rpath solution); this option is used in actual debian packages. -ldirectory Add directory to the list of directories to search for private shared libraries (since dpkg 1.17.0). This option can be used multiple times. I'm considering working my problem around by shipping a patched copy of CPackDeb.cmake, using this `-l` option. Has anyone another solution? Thanks David -- David Wagner complex != complicated - Intel Corporation SAS (French simplified joint stock company) Registered headquarters: "Les Montalets"- 2, rue de Paris, 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 4,572,000 Euros This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] Issues using CPack for making a debian package
> So, I've done some research and I found two things: > - There's a closed bug entry and a very recent patch > (https://cmake.org/Bug/view.php?id=12431; > https://cmake.org/gitweb?p=cmake.git;a=log) that will help fixing this; > - The documentation advises setting the CMAKE_INSTALL_RPATH variable (but > doesn't give any clue as to what value it should be set to). > > However, I don't want to do that because: > a) it impacts the other use-cases; > b) the rpath will stay in the binaries delivered through the debian > package. > > I'd like to point out that dpkg-shlibdeps has a `-l` option that looks to me > like the best tool for the job (compared to the rpath solution); this option > is used in actual debian packages. > >> -ldirectory >>Add directory to the list of directories to search for private >> shared libraries (since dpkg 1.17.0). This option can be used multiple >> times. > > > I'm considering working my problem around by shipping a patched copy of > CPackDeb.cmake, using this `-l` option. Has anyone another solution? Other than disabling use of dpkg-shlibdeps with CPACK_DEBIAN_PACKAGE_SHLIBDEPS nothing comes to mind. Would you be willing to provide the patch with `-l` option for inclusion into CPack and a minimal test CMakeLists.txt showing its usage? Thanks, Domen -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] Issues using CPack for making a debian package
On 23/03/2016 16:15, Domen Vrankar wrote: I'd like to point out that dpkg-shlibdeps has a `-l` option that looks to me like the best tool for the job (compared to the rpath solution); this option is used in actual debian packages. -ldirectory Add directory to the list of directories to search for private shared libraries (since dpkg 1.17.0). This option can be used multiple times. I'm considering working my problem around by shipping a patched copy of CPackDeb.cmake, using this `-l` option. Has anyone another solution? Other than disabling use of dpkg-shlibdeps with CPACK_DEBIAN_PACKAGE_SHLIBDEPS nothing comes to mind. Would you be willing to provide the patch with `-l` option for inclusion into CPack and a minimal test CMakeLists.txt showing its usage? I'll try and do that. David -- David Wagner PEG->IPG->EIG->cAVS (Audio CoE)->FDK MiddleWare Core complex != complicated - Intel Corporation SAS (French simplified joint stock company) Registered headquarters: "Les Montalets"- 2, rue de Paris, 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 4,572,000 Euros This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] Issues using CPack for making a debian package
On 23/03/2016 16:15, Domen Vrankar wrote: I'm considering working my problem around by shipping a patched copy of CPackDeb.cmake, using this `-l` option. Has anyone another solution? Other than disabling use of dpkg-shlibdeps with CPACK_DEBIAN_PACKAGE_SHLIBDEPS nothing comes to mind. Would you be willing to provide the patch with `-l` option for inclusion into CPack and a minimal test CMakeLists.txt showing its usage? It just so happens that the presence of the DEBIAN directory also fixes my use-case (withouth any RPATH): now, dpkg-shlibdeps finds my private libraries. However, I notice a strange behaviour from dpkg-shlibdeps: $ ls debian DEBIAN usr $ dpkg-shlibdeps --ignore-missing-info -O ./usr/lib/libparameter.so shlibs:Depends=libc6 (>= 2.14), libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.6), libxml2 (>= 2.7.4) $ dpkg-shlibdeps --ignore-missing-info -O usr/lib/libparameter.so dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory dpkg-shlibdeps: warning: symbol _ZN31BackgroundRemoteProcessorServerC1EtOSt10unique_ptrI21IRemoteCommandHandlerSt14default_deleteIS1_EE used by usr/lib/libparameter.so found in none of the libraries shlibs:Depends=libc6 (>= 2.14), libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.6), libxml2 (>= 2.7.4) Note how it works ok when the path to the binary starts with ./ but fails otherwise. I narrowed it down to the `relative_to_pkg_root` function in Dpkg/Path.pm but I don't understand Perl enoough to go further. Fortunately, the way CPackDeb.cmake calls dpkg-shlibdeps has these leading './'. Bottom line: it works but I don't know how robust it is. BR David -- David Wagner complex != complicated - Intel Corporation SAS (French simplified joint stock company) Registered headquarters: "Les Montalets"- 2, rue de Paris, 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 4,572,000 Euros This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake