Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declare single library in CMake #134

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

chfast
Copy link

@chfast chfast commented Jun 21, 2020

Fixes #104

This replaces 2 libraries declared in CMake: docopt (SHARED) and
docopt_s (STATIC) with single one docopt which can be built as static or
shared depending on -DBUILD_SHARED_LIBS=ON/OFF.

This replaces 2 libraries declared in CMake: docopt (SHARED) and
docopt_s (STATIC) with single one docopt which can be built as static or
shared depending on -DBUILD_SHARED_LIBS=ON/OFF.
@mibli
Copy link

mibli commented May 16, 2022

So why did this get stuck?

@jktjkt
Copy link

jktjkt commented Feb 2, 2023

Just FYI, various distros (at least Fedora and Arch) have policies which prevent installing static libraries. This is a problem because the resulting RPMs contain just the shared library, but the installed CMake target files attempt to reference the docopt_s target as well. It ends up like this:

CMake Error at /lib64/cmake/docopt/docopt-targets.cmake:90 (message):
  The imported target "docopt_s" references the file

     "/usr/lib64/libdocopt.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

     "/lib64/cmake/docopt/docopt-targets.cmake"

  but not all the files it references.

Call Stack (most recent call first):
  /lib64/cmake/docopt/docopt-config.cmake:1 (include)
  CMakeLists.txt:33 (find_package)

The easiest workaround is to give up on CMake files and just use pkg-config, of course.

jktjkt added a commit to CESNET/velia that referenced this pull request Feb 5, 2023
The upstream project provides a CMake file which attempts to import both
static and shared libraries. This is a problem on any reasonable
distribution because Nobody Ships Static Libraries Anymore (for
reasonable reasons). So we have distros shipping CMake files from
upstream which are broken because distros actively remove the static
library from their packaging.

This was not caught by the CI because I cannot type `Depends-on`
properly, and therefore Zuul would feed oldish prebuilt dependencies
which still included the custom-built docopt library in both static and
shared versions. We need a linter for commit footers :p.

Fixes: Ib246d39f975c00bc6489f683f1f21f34cc808201
Fixes: 4e473f1 CI: use system docopt-cpp
Bug: docopt/docopt.cpp#134
Change-Id: Ief13813210199d8d58b82659e522a941033f6302
jktjkt added a commit to CESNET/netconf-cli that referenced this pull request Feb 10, 2023
The upstream project provides a CMake file which attempts to import both
static and shared libraries. This is a problem on any reasonable
distribution because Nobody Ships Static Libraries Anymore (for
reasonable reasons). So we have distros shipping CMake files from
upstream which are broken because distros actively remove the static
library from their packaging.

This was not caught by the CI because I cannot type `Depends-on`
properly, and therefore Zuul would feed oldish prebuilt dependencies
which still included the custom-built docopt library in both static and
shared versions. We need a linter for commit footers :p.

Fixes: Ib246d39f975c00bc6489f683f1f21f34cc808201
Fixes: 88db08a CI: use system docopt-cpp
Bug: docopt/docopt.cpp#134
Change-Id: Ief13813210199d8d58b82659e522a941033f6302
jktjkt pushed a commit to CESNET/sysrepo-ietf-alarms that referenced this pull request Feb 14, 2023
The upstream project provides a CMake file which attempts to import both
static and shared libraries. This is a problem on any reasonable
distribution because Nobody Ships Static Libraries Anymore (for
reasonable reasons). So we have distros shipping CMake files from
upstream which are broken because distros actively remove the static
library from their packaging.

This was not caught by the CI because `Depends-on` was not typed
properly , and therefore Zuul would feed oldish prebuilt dependencies
which still included the custom-built docopt library in both static and
shared versions. We need a linter for commit footers :p.

Fixes: Ib246d39f975c00bc6489f683f1f21f34cc808201
Fixes: c64c42a CI: use system docopt-cpp
Bug: docopt/docopt.cpp#134
Change-Id: Ia50595b36cfe233fd67a5153ff804d77a0c77b94
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Please respect BUILD_SHARED_LIBS variable, and make both shared ans static library names the same
3 participants