You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Incorrect path generated by PkgConfigDeps when using --deployer option
OS and Connan Version Information:
OS: Mac Sonama
Conan version 2.4.1
How to reproduce it
Create a conanfile.txt with a couple of packages; shouldn't matter what these packages are as long as they are available in the central registry; here is the file contents I used:
# doesn't matter if its direct_deploy or full_deploy, the issue is the same
conan install . --output-folder=third-party --deployer=direct_deploy --deployer-folder=third-party --build=missing
Examine the contents of any *.pc file inside third-party folder and make note of the use of prefix and the values of libdir, includedir, ...
Contents of libuv-static.pc is provided below to illustrate the issue:
Notice that the value of the prefix is repeated for libdir, includedir, bindir...
The causes issues for the build system I am using (gn + ninja). I am not sure how it could work for other build systems either.
Anyway, I chased the bug down and isolated it to the function _get_formatted_dirs(...) in `conan/tools/gnu/pkgconfigdeps.py``. For the version I am on, the code looks as below:
This code above does the right thing only for the shared dependency *.pc file generation.
The fix
I can't claim that I know the implications but I tested the code below and it works now for both use cases correctly. Please review and let me know if you want me to submit a PR. Happy if I don't have to and someone with more knowledge of conan than me can review and fix more quickly.
Thanks a lot for reporting it and the steps to replicate it. I could reproduce it on my own 👍
I'll try to open a PR to fix this today. Indeed, the piece of code that fails is that. Thanks!
Incorrect path generated by PkgConfigDeps when using --deployer option
OS and Connan Version Information:
OS: Mac Sonama
Conan version 2.4.1
How to reproduce it
conanfile.txt
with a couple of packages; shouldn't matter what these packages are as long as they are available in the central registry; here is the file contents I used:The important item to focus on is the use of
PkgConfigDeps
conan install . --output-folder=third-party --build=missing
Examine the contents of any *.pc file inside
third-party
folder and make note of the use ofprefix
and the values oflibdir
,includedir
, ...They are correct.
Examine the contents of any *.pc file inside
third-party
folder and make note of the use ofprefix
and the values oflibdir
,includedir
, ...Contents of libuv-static.pc is provided below to illustrate the issue:
Notice that the value of the
prefix
is repeated forlibdir
,includedir
,bindir
...The causes issues for the build system I am using (gn + ninja). I am not sure how it could work for other build systems either.
Anyway, I chased the bug down and isolated it to the function
_get_formatted_dirs(...)
in `conan/tools/gnu/pkgconfigdeps.py``. For the version I am on, the code looks as below:This code above does the right thing only for the shared dependency
*.pc
file generation.I can't claim that I know the implications but I tested the code below and it works now for both use cases correctly. Please review and let me know if you want me to submit a PR. Happy if I don't have to and someone with more knowledge of conan than me can review and fix more quickly.
With this fix in place, the
*.pc
files are generated correctly. Here islibuv-static.pc
after the fixThe text was updated successfully, but these errors were encountered: