question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[bug] Conan is not able to generate pkg-config variables

See original GitHub issue

Environment Details (include every applicable attribute)

  • Operating System+version: CentOS 8
  • Compiler+version: Clang 10.0.1
  • Conan version: 1.29.1
  • Python version: 3.8.3

Steps to reproduce (Include if Applicable)

Building pulseaudio fails because the glib dependency is using the pkg-conf generator as opposed to packaging the native .pc files, and therefore a variable needed by pulseaudio is missing. Removing the pkg-conf files is the right approach, this is in accordance with the Conan philosophy of letting the package manager generate these files to make the recipes agnostic to the consumer. However the native gio-2.0.pc file defines some variables including:

...
glib_compile_schemas=${bindir}/glib-compile-schemas
...

And pulseaudio uses this variable, therefor resulting in build failure:

configure:26162: error: glib-compile-schemas not found.

We can see that the configure script of pulseaudio is looking for that variable:

pkg_cv_GLIB_COMPILE_SCHEMAS=`$PKG_CONFIG --variable="glib_compile_schemas" "gio-2.0" 2>/dev/null`

Therefor we need to have a way to define arbitrary pkg_config variables for a specific component. Something like this:

self.cpp_info.components["gio-2.0"].glib_compile_schemas = os.path.join(self.package_folder, "bin", "glib-compile-schemas")

Logs (Executed commands with output) (Include/Attach if Applicable)

Output of pulseaudio configure: config.log

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ericLemanissiercommented, Sep 18, 2020

@memsharded these variables are generator specific, so we would need something like components["component"].vars["generator"]["variable_name"] = "variable value I guess cmake generators too would gain a lot of new possibilities with this feature

0reactions
daravicommented, Aug 26, 2021

@ericLemanissier Thanks!

I would prefer the cleaner syntax above but I think this ticket can be closed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[bug] PKG Config approach 5 not working · Issue #6440 - GitHub
Hi @derived-coder,. I have checked the source code and the PKG_CONFIG_PATH variable is being set in the environment with the value of the...
Read more >
pkg-config and .pc files — conan 1.53.0 documentation
This approach is cleaner than approach 1, because the packaged files are already prepared to be reused with or without Conan by declaring...
Read more >
CLion fails to find some of my headers. Where does it search ...
CLion searches through the same places CMake does. Set the include_directories variable in CMake to provide the headers path to the IDE.
Read more >
meson cannot find a conan package, despite setting ...
meson.build:97:0: ERROR: Dependency "vulkan-memory-allocator" not found, tried pkgconfig and cmake A full log can be found at ...
Read more >
B2 User Manual - 1.78.0 - Boost C++ Libraries
A C++11 capable compiler is needed to build the b2 engine. ... Building a project does not automatically cause its sub-projects to be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found