Repository: conan-io/conan-center-index

Issue:
[package] taglib/1.12: Build fails due to Werror (gcc9/clang11)
### Package and Environment Details (include every applicable attribute)
  * Package Name/Version: **taglib/1.12**
  * Operating System+version: **Linux Ubuntu 16.04**
  * Compiler+version: **GCC 9/Clang 11**
  * Docker image: **conanio/gcc9/clang11-ubuntu16.04:1.39.0**
  * Conan version: **conan 1.39.0**
  * Python version: **Python 3.7.4**

### Steps to reproduce (Include if Applicable)
Try to install taglib from source using "modern" docker images.

### Logs (Include/Attach if Applicable)
<details><summary>Click to expand log</summary>
<pre>
Downloading conan_sources.tgz
taglib/1.12: Configuring sources in /home/conan/.conan/data/taglib/1.12/_/_/source

taglib/1.12: Copying sources to build folder
taglib/1.12: Building your package in /home/conan/.conan/data/taglib/1.12/_/_/build/1d0548617f8360b4dc5236431cc469164e26aaa7
taglib/1.12: Generator cmake created conanbuildinfo.cmake
taglib/1.12: Generator cmake_find_package created FindZLIB.cmake
taglib/1.12: Aggregating env generators
taglib/1.12: Calling build()
-- The C compiler identification is Clang 11.1.0
-- The CXX compiler identification is Clang 11.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/local/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan: called by CMake conan helper
-- Conan: called inside local cache
-- Conan: Adjusting output directories
-- Conan: Using cmake global configuration
-- Conan: Adjusting default RPATHs Conan policies
-- Conan: Adjusting language standard
-- Conan setting CPP STANDARD: 17 WITH EXTENSIONS OFF
-- Conan: Compiler Clang>=8, checking major version 11
-- Conan: Checking correct version: 11
-- Conan: C++ stdlib: libstdc++
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of short
-- Check size of short - done
-- Check size of int
-- Check size of int - done
-- Check size of long long
-- Check size of long long - done
-- Check size of wchar_t
-- Check size of wchar_t - done
-- Check size of float
-- Check size of float - done
-- Check size of double
-- Check size of double - done
-- Performing Test HAVE_GCC_ATOMIC
-- Performing Test HAVE_GCC_ATOMIC - Failed
-- Performing Test HAVE_MAC_ATOMIC
-- Performing Test HAVE_MAC_ATOMIC - Failed
-- Performing Test HAVE_WIN_ATOMIC
-- Performing Test HAVE_WIN_ATOMIC - Failed
-- Performing Test HAVE_IA64_ATOMIC
-- Performing Test HAVE_IA64_ATOMIC - Failed
-- Performing Test HAVE_GCC_BYTESWAP
-- Performing Test HAVE_GCC_BYTESWAP - Failed
-- Performing Test HAVE_GLIBC_BYTESWAP
-- Performing Test HAVE_GLIBC_BYTESWAP - Success
-- Performing Test HAVE_VSNPRINTF
-- Performing Test HAVE_VSNPRINTF - Success
-- Performing Test HAVE_ISO_STRDUP
-- Performing Test HAVE_ISO_STRDUP - Failed
-- Conan: Using autogenerated FindZLIB.cmake
-- Found ZLIB: 1.2.11 (found version "1.2.11") 
-- Library z found /home/conan/.conan/data/zlib/1.2.11/_/_/package/e684bf6c51b647654d0dfc0d274c355fb83e3909/lib/libz.so
-- Found: /home/conan/.conan/data/zlib/1.2.11/_/_/package/e684bf6c51b647654d0dfc0d274c355fb83e3909/lib/libz.so
-- Looking for __RTTI___ in Crun
-- Looking for __RTTI___ in Crun - not found
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_EXPORT_NO_PACKAGE_REGISTRY
    CMAKE_INSTALL_BINDIR
    CMAKE_INSTALL_DATAROOTDIR
    CMAKE_INSTALL_INCLUDEDIR
    CMAKE_INSTALL_LIBDIR
    CMAKE_INSTALL_LIBEXECDIR
    CMAKE_INSTALL_OLDINCLUDEDIR
    CMAKE_INSTALL_SBINDIR


-- Build files have been written to: /home/conan/.conan/data/taglib/1.12/_/_/build/1d0548617f8360b4dc5236431cc469164e26aaa7
Scanning dependencies of target tag
[  0%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/mpeg/mpegfile.cpp.o
[  1%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/mpeg/mpegproperties.cpp.o
[  2%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/mpeg/mpegheader.cpp.o
[  3%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/mpeg/xingheader.cpp.o
[  4%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/mpeg/id3v1/id3v1tag.cpp.o
[  5%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/mpeg/id3v1/id3v1genres.cpp.o
[  6%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/mpeg/id3v2/id3v2framefactory.cpp.o
[  7%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/mpeg/id3v2/id3v2synchdata.cpp.o
[  8%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/mpeg/id3v2/id3v2tag.cpp.o
[  9%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/mpeg/id3v2/id3v2header.cpp.o
[ 10%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/mpeg/id3v2/id3v2frame.cpp.o
[ 11%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/mpeg/id3v2/id3v2footer.cpp.o
[ 12%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/mpeg/id3v2/id3v2extendedheader.cpp.o
[ 13%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/mpeg/id3v2/frames/attachedpictureframe.cpp.o
[ 14%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/mpeg/id3v2/frames/commentsframe.cpp.o
[ 15%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/mpeg/id3v2/frames/eventtimingcodesframe.cpp.o
[ 16%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/mpeg/id3v2/frames/generalencapsulatedobjectframe.cpp.o
[ 17%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/mpeg/id3v2/frames/ownershipframe.cpp.o
[ 18%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/mpeg/id3v2/frames/popularimeterframe.cpp.o
[ 19%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/mpeg/id3v2/frames/privateframe.cpp.o
[ 20%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/mpeg/id3v2/frames/relativevolumeframe.cpp.o
[ 20%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/mpeg/id3v2/frames/synchronizedlyricsframe.cpp.o
[ 21%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/mpeg/id3v2/frames/textidentificationframe.cpp.o
[ 22%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/mpeg/id3v2/frames/uniquefileidentifierframe.cpp.o
[ 23%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/mpeg/id3v2/frames/unknownframe.cpp.o
[ 24%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/mpeg/id3v2/frames/unsynchronizedlyricsframe.cpp.o
[ 25%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/mpeg/id3v2/frames/urllinkframe.cpp.o
[ 26%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/mpeg/id3v2/frames/chapterframe.cpp.o
[ 27%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/mpeg/id3v2/frames/tableofcontentsframe.cpp.o
[ 28%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/mpeg/id3v2/frames/podcastframe.cpp.o
[ 29%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/ogg/oggfile.cpp.o
[ 30%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/ogg/oggpage.cpp.o
[ 31%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/ogg/oggpageheader.cpp.o
[ 32%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/ogg/xiphcomment.cpp.o
[ 33%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/ogg/vorbis/vorbisfile.cpp.o
[ 34%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/ogg/vorbis/vorbisproperties.cpp.o
[ 35%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/ogg/flac/oggflacfile.cpp.o
[ 36%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/mpc/mpcfile.cpp.o
[ 37%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/mpc/mpcproperties.cpp.o
[ 38%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/ape/apetag.cpp.o
[ 39%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/ape/apefooter.cpp.o
[ 40%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/ape/apeitem.cpp.o
[ 40%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/ape/apefile.cpp.o
[ 41%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/ape/apeproperties.cpp.o
[ 42%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/toolkit/tstring.cpp.o
[ 43%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/toolkit/tstringlist.cpp.o
[ 44%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/toolkit/tbytevector.cpp.o
[ 45%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/toolkit/tbytevectorlist.cpp.o
[ 46%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/toolkit/tbytevectorstream.cpp.o
[ 47%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/toolkit/tiostream.cpp.o
[ 48%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/toolkit/tfile.cpp.o
[ 49%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/toolkit/tfilestream.cpp.o
[ 50%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/toolkit/tdebug.cpp.o
[ 51%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/toolkit/tpropertymap.cpp.o
[ 52%] Building CXX object source_subfolder/taglib/CMakeFiles/tag.dir/toolkit/trefcounter.cpp.o
/home/conan/.conan/data/taglib/1.12/_/_/build/1d0548617f8360b4dc5236431cc469164e26aaa7/source_subfolder/taglib/toolkit/trefcounter.cpp:69:14: error: duplicate 'volatile' declaration specifier [-Werror,-Wduplicate-decl-specifier]
    volatile ATOMIC_INT refCount;
             ^
/home/conan/.conan/data/taglib/1.12/_/_/build/1d0548617f8360b4dc5236431cc469164e26aaa7/source_subfolder/taglib/toolkit/trefcounter.cpp:55:21: note: expanded from macro 'ATOMIC_INT'
# define ATOMIC_INT volatile int
                    ^
1 error generated.
make[2]: *** [source_subfolder/taglib/CMakeFiles/tag.dir/toolkit/trefcounter.cpp.o] Error 1
source_subfolder/taglib/CMakeFiles/tag.dir/build.make:783: recipe for target 'source_subfolder/taglib/CMakeFiles/tag.dir/toolkit/trefcounter.cpp.o' failed
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [source_subfolder/taglib/CMakeFiles/tag.dir/all] Error 2
CMakeFiles/Makefile2:225: recipe for target 'source_subfolder/taglib/CMakeFiles/tag.dir/all' failed
make: *** [all] Error 2
Makefile:148: recipe for target 'all' failed
taglib/1.12: 
WARN: mariadb-connector-c/3.1.11: requirement libcurl/7.75.0 overridden by gerbera/None to libcurl/7.78.0 
taglib/1.12: ERROR: Package '1d0548617f8360b4dc5236431cc469164e26aaa7' build failed
taglib/1.12: WARN: Build folder /home/conan/.conan/data/taglib/1.12/_/_/build/1d0548617f8360b4dc5236431cc469164e26aaa7
ERROR: taglib/1.12: Error in build() method, line 64
	cmake.build()
	ConanException: Error 2 while executing cmake --build '/home/conan/.conan/data/taglib/1.12/_/_/build/1d0548617f8360b4dc5236431cc469164e26aaa7' '--' '-j2'
</pre>
</details>

Example full log: https://github.com/gerbera/gerbera/pull/1702/checks?check_run_id=3339554403



Discussion:
Hm. It is fixed for 1.12 https://github.com/taglib/taglib/pull/1012

Resolving patch:
diff --git a/recipes/taglib/all/conanfile.py b/recipes/taglib/all/conanfile.py
--- a/recipes/taglib/all/conanfile.py
+++ b/recipes/taglib/all/conanfile.py
@@ -24,7 +24,7 @@ class TaglibConan(ConanFile):
         "bindings": True,
     }
 
-    exports_sources = "CMakeLists.txt"
+    exports_sources = "CMakeLists.txt", "patches/*"
     generators = "cmake", "cmake_find_package"
     _cmake = None
 
@@ -60,6 +60,8 @@ def _configure_cmake(self):
         return self._cmake
 
     def build(self):
+        for patch in self.conan_data.get("patches", {}).get(self.version, []):
+            tools.patch(**patch)
         cmake = self._configure_cmake()
         cmake.build()
 


Test patch: