Conan-center-index: [package] expat/2.2.9: default builds dynamic library

Created on 4 Mar 2020  路  13Comments  路  Source: conan-io/conan-center-index

the builds of expat are static libraries, not dynamic libs

Package and Environment Details (include every applicable attribute)

  • Package Name/Version: expat/2.2.9
  • Operating System+version: macos
  • Compiler+version: appleclang-10
  • Conan version: 1.22.2

Conan profile (output of conan profile show default or conan profile show <profile> if custom profile is in use)

Configuration for profile default:

[settings]
os=Macos
os_build=Macos
arch=x86_64
arch_build=x86_64
compiler=apple-clang
compiler.version=10.0
compiler.libcxx=libc++
build_type=Release
[options]
[build_requires]
[env]

Steps to reproduce (Include if Applicable)

built expat

Logs (Include/Attach if Applicable)

Click to expand log

-- Library boost_unit_test_framework found /Users/tim/.conan/data/boost/1.72.0/_/_/package/5f670f32dd3b28135ecffff67833b959fedb9483/lib/libboost_unit_test_framework.a
-- Library expat found /Users/tim/.conan/data/expat/2.2.9/_/_/package/05f2becfb3546b96a9d17ef745b219d416c14659/lib/libexpat.dylib
-- Library expat.1 found /Users/tim/.conan/data/expat/2.2.9/_/_/package/05f2becfb3546b96a9d17ef745b219d416c14659/lib/libexpat.1.dylib
-- Library expat.1.6.11 found /Users/tim/.conan/data/expat/2.2.9/_/_/package/05f2becfb3546b96a9d17ef745b219d416c14659/lib/libexpat.1.6.11.dylib
-- Library jansson found /Users/tim/.conan/data/jansson/2.12/_/_/package/a617accb6a8d0289f5b812cb3d1ab5dc42c9bd9e/lib/libjansson.a

bug

All 13 comments

Hi @timblechmann !

The default option for expat is static, not shared: https://github.com/conan-io/conan-center-index/blob/master/recipes/expat/all/conanfile.py#L15

Also, Conan Center Index has a hook which checks for any possible wrong library extension.

Could you please share your entire log, including command line and conanfile?

tim@moka-mac:~/dev/con$ cat conanfile.txt
[requires]
expat/2.2.9

[generators]
cmake
tim@moka-mac:~/dev/con$ conan install -b missing conanfile.txt
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=apple-clang
compiler.libcxx=libc++
compiler.version=10.0
os=Macos
os_build=Macos
[options]
[build_requires]
[env]

conanfile.txt: Installing package
Requirements
    expat/2.2.9 from 'conan-center' - Cache
Packages
    expat/2.2.9:534dcc368c999e07e81f146b3466b8f656ef1f55 - Download

expat/2.2.9: Retrieving package 534dcc368c999e07e81f146b3466b8f656ef1f55 from remote 'conan-center'
Downloading conanmanifest.txt completed [0.48k]
Downloading conaninfo.txt completed [0.40k]
Downloading conan_package.tgz completed [86.80k]
Decompressing conan_package.tgz completed [0.00k]
expat/2.2.9: Package installed 534dcc368c999e07e81f146b3466b8f656ef1f55
expat/2.2.9: Downloaded package revision 0
conanfile.txt: Generator cmake created conanbuildinfo.cmake
conanfile.txt: Generator txt created conanbuildinfo.txt
conanfile.txt: Generated conaninfo.txt
conanfile.txt: Generated graphinfo
tim@moka-mac:~/dev/con$ find ~/.conan/data/expat/ | grep  534dcc368c999e07e81f146b3466b8f656ef1f55
/Users/tim/.conan/data/expat//2.2.9/_/_/locks/534dcc368c999e07e81f146b3466b8f656ef1f55
/Users/tim/.conan/data/expat//2.2.9/_/_/package/534dcc368c999e07e81f146b3466b8f656ef1f55
/Users/tim/.conan/data/expat//2.2.9/_/_/package/534dcc368c999e07e81f146b3466b8f656ef1f55/bin
/Users/tim/.conan/data/expat//2.2.9/_/_/package/534dcc368c999e07e81f146b3466b8f656ef1f55/bin/xmlwf
/Users/tim/.conan/data/expat//2.2.9/_/_/package/534dcc368c999e07e81f146b3466b8f656ef1f55/licenses
/Users/tim/.conan/data/expat//2.2.9/_/_/package/534dcc368c999e07e81f146b3466b8f656ef1f55/licenses/COPYING
/Users/tim/.conan/data/expat//2.2.9/_/_/package/534dcc368c999e07e81f146b3466b8f656ef1f55/include
/Users/tim/.conan/data/expat//2.2.9/_/_/package/534dcc368c999e07e81f146b3466b8f656ef1f55/include/expat_config.h
/Users/tim/.conan/data/expat//2.2.9/_/_/package/534dcc368c999e07e81f146b3466b8f656ef1f55/include/expat_external.h
/Users/tim/.conan/data/expat//2.2.9/_/_/package/534dcc368c999e07e81f146b3466b8f656ef1f55/include/expat.h
/Users/tim/.conan/data/expat//2.2.9/_/_/package/534dcc368c999e07e81f146b3466b8f656ef1f55/conanmanifest.txt
/Users/tim/.conan/data/expat//2.2.9/_/_/package/534dcc368c999e07e81f146b3466b8f656ef1f55/lib
/Users/tim/.conan/data/expat//2.2.9/_/_/package/534dcc368c999e07e81f146b3466b8f656ef1f55/lib/libexpat.dylib
/Users/tim/.conan/data/expat//2.2.9/_/_/package/534dcc368c999e07e81f146b3466b8f656ef1f55/lib/libexpat.1.6.11.dylib
/Users/tim/.conan/data/expat//2.2.9/_/_/package/534dcc368c999e07e81f146b3466b8f656ef1f55/lib/libexpat.1.dylib
/Users/tim/.conan/data/expat//2.2.9/_/_/package/534dcc368c999e07e81f146b3466b8f656ef1f55/conaninfo.txt

we end up with a dylib, not with a .a (i've seen similar behaviour on linux)

Hi @timblechmann ! Thanks for sharing your details. Indeed it's wrong, I've checked the build log from CI and dylib is present when building: https://c3i.jfrog.io/c3i/misc/logs/pr/603/1/expat/2.2.9/534dcc368c999e07e81f146b3466b8f656ef1f55/

We will need to fix expat package, but also fix the Conan Center hook.

Seems like wrong branching is taken during execution of _configure_cmake (but on CI only, locally it works):

        if Version(self.version) < "2.2.8":
            cmake.definitions["BUILD_doc"] = "Off"
            cmake.definitions["BUILD_examples"] =  "Off"
            cmake.definitions["BUILD_shared"] = self.options.shared
            cmake.definitions["BUILD_tests"] = "Off"
            cmake.definitions["BUILD_tools"] = "Off"
        else:
            # These options were renamed in 2.2.8 to be more consistent
            cmake.definitions["EXPAT_BUILD_DOCS"] = "Off"
            cmake.definitions["EXPAT_BUILD_EXAMPLES"] =  "Off"
            cmake.definitions["EXPAT_SHARED_LIBS"] = self.options.shared
            cmake.definitions["EXPAT_BUILD_TESTS"] = "Off"
            cmake.definitions["EXPAT_BUILD_TOOLS"] = "Off"

in the CI log of 2.2.9:

CMake Warning:
  Manually-specified variables were not used by the project:

    BUILD_doc
    BUILD_examples
    BUILD_shared
    BUILD_tests
    BUILD_tools
    CMAKE_EXPORT_NO_PACKAGE_REGISTRY
BUILD_shared

Yes, probably that's it. Thanks @SpaceIm !

How to fix this issue? Fix in CI? It's not the first time I see wrong branching in CI (but not locally) based on tools.Version(self.version) comparison.

Something is wrong in CI. The conanfile shared for OSX is outdated!

@danimtb If you try to build expat by install command, you will see dylib present. However, the Conanfile installed is outdated with the current version on master branch

conan remove expat -f && conan install expat/2.2.9@ -r conan-center --build expat

Thanks for the information gathered here guys. I am taking a look!

I've submitted a PR https://github.com/conan-io/conan-center-index/pull/1167. Seems to work well so far (static libs are properly built), I've just replaced Version by tools.Version...

@SpaceIm thanks! Yes, taking a look I think the easiest solution is to fire a rebuild for all configurations of the library with the latest changes in the recipe. That PR should do it!

For some reason, the latest PR merged regarding expat https://github.com/conan-io/conan-center-index/pull/468 only generated on package per version. That might be the cause of the issue. After merging #1167 the isssue seems to be fixed. Please @timblechmann could you confirm that from your side? Thanks

@danimtb looks good here! thank you all for looking into this issue

Thanks a lot for testing that and reporting the issue! 馃槃

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GordonJess picture GordonJess  路  3Comments

gocarlos picture gocarlos  路  3Comments

Croydon picture Croydon  路  3Comments

IceflowRE picture IceflowRE  路  3Comments

Croydon picture Croydon  路  3Comments