Conan: Dependency results in a double build?

Created on 13 Jun 2017  路  10Comments  路  Source: conan-io/conan

I have added zlib/1.2.8@lasote/stable as a dependency for my Assimp package.

That has some strange consequences with Travis, because after an otherwise successful build, Conan decides to boot itself up again, and can't seem to find anything:

-- Build files have been written to: /home/conan/project/test_package/build/da39a3ee5e6b4b0d3255bfef95601890afd80709
Scanning dependencies of target example
[ 50%] Building CXX object CMakeFiles/example.dir/example.cpp.o
[100%] Linking CXX executable bin/example
[100%] Built target example
Hello Assimp!

It seems to be the first time you've ran conan
Auto detecting your dev setup to initialize conan.conf
Found gcc 4.9
Default conan.conf settings
os=Linux
arch=x86_64
compiler=gcc
compiler.version=4.9
compiler.libcxx=libstdc++
build_type=Release
* You can change them in ~/.conan/conan.conf
Or override with -s compiler='other' -s ...s*
WARN: Remotes registry file missing, creating default one in /home/conan/.conan/registry.txt
Current 'conan-center' user: None (anonymous)
Current 'conan-transit' user: None (anonymous)
Exporting package recipe
Linter warnings
WARN: Linter. Line 2: Unused replace_in_file imported from conans.tools
WARN: Conanfile doesn't have 'description'.
It is recommended to add it as attribute
Assimp/3.3.1@jacmoe/testing: The stored package has not changed
Requirements
Assimp/3.3.1@jacmoe/testing from local
zlib/1.2.8@lasote/stable from local
Packages
Assimp/3.3.1@jacmoe/testing:55b076e244101059f1a4ed1c8053beccba78f95c
zlib/1.2.8@lasote/stable:c6d75a933080ca17eb7f076813e7fb21aaa740f2
ERROR: Error while trying to get recipe sources for zlib/1.2.8@lasote/stable. No remote defined

As you can probably see, the test_package target is built and all is well.

Until the system seems to be rebooted ?? Because, no: it's not the first time that we have run conan.

What am I missing?

bug

All 10 comments

Assimp package:

class AssimpConan(ConanFile):
    name = "Assimp"
    version = "3.3.1"
    license = "MIT"
    url = "https://github.com/jacmoe/conan-assimp"
    requires = "zlib/1.2.8@lasote/stable"
    settings = "os", "compiler", "build_type", "arch"
    options = {"shared": [True, False]}
    default_options = "shared=False"
    generators = "cmake"

TestPackage:

class AssimpTestConan(ConanFile):
    settings = "os", "compiler", "build_type", "arch"
    requires = "Assimp/3.3.1@jacmoe/testing", "zlib/1.2.8@lasote/stable"
    generators = "cmake"

My build.py:

if __name__ == "__main__":
    builder = ConanMultiPackager(args="--build missing")
    builder.add_common_builds(pure_c=False)
    builder.builds = [
        [settings, options, env_vars, build_requires]
        for settings, options, env_vars, build_requires in builder.builds
        if not (os_info.is_linux and settings["arch"] == "x86")
    ]
    builder.run()

Not sure if this has to do with #1380 or not, because - obviously - it works "on my machine" 馃樃

I think the issue is that conan-package-tools is building 2 configurations per page: you can check them in lines 421 and 422:

[('settings', {'compiler.version': '4.9', 'compiler.libcxx': 'libstdc++', 'arch': 'x86_64', 'build_type': 'Debug', 'compiler': 'gcc'}), ('options', {}), ('env_vars', {}), ('build_requires', {})]
[('settings', {'compiler.version': '4.9', 'compiler.libcxx': 'libstdc++', 'arch': 'x86_64', 'build_type': 'Release', 'compiler': 'gcc'}), ('options', {}), ('env_vars', {}), ('build_requires', {})]

So in each page/travis job, it will launch 2 builds fo conan, one to build the debug version and the other one for the Release version.

What is really weird is the error ERROR: Error while trying to get recipe sources for zlib/1.2.8@lasote/stable. No remote defined. I am investigating it

I think the scripts could be getting confused by: CONAN_CURRENT_PAGE=1. Can you please remove it and try?

Saw it failing again. Will launch my own test.

Yes, able to reproduce it, something very weird is ongoing. It could be something related to the docker images being used. Locally it works fine. We might need the help of @lasote here.

It doesn't happen in Appveyor (docker not used)

It seems that the cache is being reset, so conan.conf and registry.txt are being wiped, but the package data and files remain there, confusing conan about the cache status.

Probably this is more related to conan-package-tools, but I think we can leave the conversation here till knowing.

Good to know!

I will just keep it in that branch until the package tools have been updated :)

I have fired my builds again, adapting to the new changes of conan-package-tools (already released), and everything seems good now.

Changed:

  • CONAN_UPLOAD to point to my bintray upload remote, instead of 1
  • Do not use CONAN_REMOTE
  • Removed my old manual adding of the bintray remote

Can you please try it too? Thanks!

Yes!
That did the trick - thanks for fixing it - the new Conan package tools rocks! 馃憤

Was this page helpful?
0 / 5 - 0 ratings