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

[package] glib/*: Error: duplicate definition of variable 'bindir' #18604

Closed
valgur opened this issue Jul 17, 2023 · 2 comments
Closed

[package] glib/*: Error: duplicate definition of variable 'bindir' #18604

valgur opened this issue Jul 17, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@valgur
Copy link
Contributor

valgur commented Jul 17, 2023

Description

I'm not too familiar with Meson, so I'm not sure what the correct way to handle this error should be. Commenting out https://github.com/conan-io/conan-center-index/blob/07ebcf40e/recipes/glib/all/conanfile.py#L262 fixes the build at least.

@SpaceIm do you have any ideas?

Package and Environment Details

  • Package Name/Version: glib/2.76.3
  • Operating System+version: Linux Ubuntu 20.04
  • Compiler+version: GCC 11
  • Conan version: conan 2.0.7
  • Python version: Python 3.8.10

Conan profile

[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=20
compiler.libcxx=libstdc++11
compiler.version=11
os=Linux

Steps to reproduce

conan create . --version 2.76.3

Logs

Click to expand log
ERROR: glib/2.76.3 (test package): Error in test() method, line 58
	gdbus_codegen = pkg_config.variables["gdbus_codegen"]
	ConanException: Command 'pkg-config --print-variables gio-2.0 --print-errors' failed with errorcode '1'
b"Duplicate definition of variable 'bindir' in '/home/martin/projects/conan-center-index/recipes/glib/all/test_package/build/gcc-11-x86_64-20-release/generators/gio-2.0.pc'\n"
Command exited with non-zero status 1
@valgur valgur added the bug Something isn't working label Jul 17, 2023
@SpaceIm
Copy link
Contributor

SpaceIm commented Jul 17, 2023

I guess it's a side effect of conan-io/conan#13623 (conan 2.0.7). glib recipe has a workaround to define bindir in .pc file generated by PkgConfigDeps (because several downstream libraries use this variable in pc files of glib), but since conan-io/conan#13623 this bindir is also defined by PkgConfigDeps leading to duplicated bindir definition in pc files of glib, which might lead to your error.
So the fix would be to define bindir in pc files of glib recipe only if conan_version < 2.0.7, for these 2 lines:

'bindir': '${prefix}/bin',

'bindir': '${prefix}/bin',

@valgur
Copy link
Contributor Author

valgur commented Jul 18, 2023

Thank you very much, @SpaceIm! That appears to have been the cause, indeed.

The good news is that it no longer fails after upgrading to v2.0.8, so this issue can be closed.

@valgur valgur closed this as completed Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants