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] avahi/0.8: shadows standard headers #26265

Open
nine opened this issue Dec 25, 2024 · 1 comment
Open

[package] avahi/0.8: shadows standard headers #26265

nine opened this issue Dec 25, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@nine
Copy link
Contributor

nine commented Dec 25, 2024

Description

With integration of pull request #20741 all avahi headers were exposed without avahi-* prefix. This causes a collision with standard headers. E.g. <avahi-common/malloc.h> collides with <malloc.h> shipped with glibc on GNU/Linux.

f.y.i @jwillikers, @AbrilRBS

Package and Environment Details

  • Package Name/Version: avahi/0.8
  • Operating System+version: Linux Debian 12.8
  • Compiler+version: GCC 12.2.0
  • Conan version: conan 2.11.0
  • Python version: Python 3.11.2

Conan profile

Host profile:

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

Build profile:

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

Steps to reproduce

git clone https://github.com/nine/conan-center-index.git
git checkout 26265_fix_shadowed_headers
cd conan-center-index
conan create recipes/avahi/all --version=0.8

Logs

Click to expand log
avahi/0.8 (test package): Running CMake.build()
avahi/0.8 (test package): RUN: cmake --build "/home/nine/src/github.com/nine/conan-center-index/recipes/avahi/all/test_package/build/gcc-12-x86_64-gnu17-release" -- -j8
[ 25%] Building C object CMakeFiles/test_package.dir/test_package.c.o
[ 50%] Building C object CMakeFiles/client-browse-services.dir/client-browse-services.c.o
/home/nine/src/github.com/nine/conan-center-index/recipes/avahi/all/test_package/client-browse-services.c: In function ‘main’:
/home/nine/src/github.com/nine/conan-center-index/recipes/avahi/all/test_package/client-browse-services.c:183:5: error: implicit declaration of function ‘malloc_trim’ [-Werror=implicit-function-declaration]
  183 |     malloc_trim(0);
      |     ^~~~~~~~~~~
[ 75%] Linking C executable test_package
cc1: some warnings being treated as errors
gmake[2]: *** [CMakeFiles/client-browse-services.dir/build.make:76: CMakeFiles/client-browse-services.dir/client-browse-services.c.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:111: CMakeFiles/client-browse-services.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
[ 75%] Built target test_package
gmake: *** [Makefile:91: all] Error 2

ERROR: avahi/0.8 (test package): Error in build() method, line 21
	cmake.build()
	ConanException: Error 2 while executing
@nine nine added the bug Something isn't working label Dec 25, 2024
nine added a commit to nine/conan-center-index that referenced this issue Dec 25, 2024
@nine
Copy link
Contributor Author

nine commented Dec 25, 2024

Possible fix:

From 331abcd8fa364dd6b297629304be8bb7cff39b81 Mon Sep 17 00:00:00 2001
Subject: [PATCH 1/1] avahi: fix shadowing of headers (#26265)

---
 recipes/avahi/all/conanfile.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/recipes/avahi/all/conanfile.py b/recipes/avahi/all/conanfile.py
index 2920eabb9..c8b93b9df 100644
--- a/recipes/avahi/all/conanfile.py
+++ b/recipes/avahi/all/conanfile.py
@@ -113,7 +113,8 @@ class AvahiConan(ConanFile):
             self.cpp_info.components[lib].names["cmake_find_package"] = lib
             self.cpp_info.components[lib].names["cmake_find_package_multi"] = lib
             self.cpp_info.components[lib].libs = [avahi_lib]
-            self.cpp_info.components[lib].includedirs = ["include", os.path.join("include", avahi_lib)]
+            if lib != "common":
+                self.cpp_info.components[lib].includedirs = ["include", os.path.join("include", avahi_lib)]
         self.cpp_info.components["compat-libdns_sd"].libs = ["dns_sd"]
 
         self.cpp_info.components["client"].requires = ["common", "dbus::dbus"]
-- 
2.39.5

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

1 participant