FS#59282 - [msgpack-c] cmake files unconditionally import static libraries
Attached to Project:
Community Packages
Opened by Peter Urban (broken_pipe) - Monday, 09 July 2018, 16:14 GMT
Last edited by Baptiste (zorun) - Friday, 14 September 2018, 07:38 GMT
Opened by Peter Urban (broken_pipe) - Monday, 09 July 2018, 16:14 GMT
Last edited by Baptiste (zorun) - Friday, 14 September 2018, 07:38 GMT
|
Details
Description:
I discovered that the package configuration file contains a target (msgpackc-static) for the statically linked library version but the referenced library (/usr/lib/libmsgpackc.a) is not installed by the arch-package. When I try to use the msgpackc-config.cmake I get the following error: ``` CMake Error at /usr/lib64/cmake/msgpack/msgpack-targets.cmake:90 (message): The imported target "msgpackc-static" references the file "/usr/lib/libmsgpackc.a" but this file does not exist. Possible reasons include: * The file was deleted, renamed, or moved to another location. * An install or uninstall procedure did not complete successfully. * The installation package was faulty and contained "/usr/lib64/cmake/msgpack/msgpack-targets.cmake" but not all the files it references. Call Stack (most recent call first): /usr/lib64/cmake/msgpack/msgpack-config.cmake:52 (include) /usr/share/cmake-3.11/Modules/CMakeFindDependencyMacro.cmake:48 (find_package) ``` Additional info: * package version: 3.0.1-1 Steps to reproduce: * call cmake function `find_package( msgpack-c )` in CMakeLists.txt |
This task depends upon
Closed by Baptiste (zorun)
Friday, 14 September 2018, 07:38 GMT
Reason for closing: Fixed
Additional comments about closing: Fixed in msgpack-c 3.1.1-1
Friday, 14 September 2018, 07:38 GMT
Reason for closing: Fixed
Additional comments about closing: Fixed in msgpack-c 3.1.1-1
It tries to import libmsgpack.a and libmsgpack.so both, with absolutely no checks to see whether it exists and no provisions for turning it off in the cmake file at buildtime, and as a result cmake derps all over itself.
Please report an upstream bug, since cmake should not be looking for static libraries in the first place.
I'd propose to install the static library to fix this (if it does not violate arch policies).
Otherwise msgpack-c cmake logic should be fixed such that it does not export the -static target if its not installed.
@eschwartz In my experience cmake package configurations work really well but are rarely used correctly. If your interested how to use them: https://www.youtube.com/watch?v=bsXLMQ6WgIk
I did not look into the msgpack-c CMakeLists.txt so far. If the problem comes from there, I can file a upstream bug report for msgpack-c if you like.
it always builds and installs the static version of the library.
If having static libraries is not against arch packaging policies the static library should be included!
@eschwartz plz move this back to the Packages Category
The CMake file should not depend specifically on the static libraries; alternatively it should have a build-time option to disable them.
It is impossible to have "cmake package configurations work really well", because the mere concept of a cmake package configuration is fundamentally flawed :p pkg-config exists for a reason, and CMake uses their own Not-In-House reimplementation; NIH reimplementations by definition aren't allowed to compete, no matter how well you use them.
(Yes, I'm opinionated. But regardless of my dislike for CMake package configuration, the fact remains that it hardcodes static libraries while we have a policy against providing them, therefore this is an upstream bug, because it is the upstream cmake logic which breaks when shared libraries but not static libraries are installed.)
CMake does not export the static libs by default. It is explicitly defined in the CMakeLists.txt which targets are exported to the configuration.
In general, the scope of cmake package configurations is far beyond what pkg-config provides. Watch the video ;)
Thanks for your time :)
https://github.com/msgpack/msgpack-c/issues/703
has been fixed with:
https://github.com/msgpack/msgpack-c/pull/713
Please repackage to close this bug.