conan-package-tools icon indicating copy to clipboard operation
conan-package-tools copied to clipboard

Error when using Docker

Open Jochen0x90h opened this issue 3 years ago • 1 comments

Description of Problem, Request, or Question

I try to run conan package tools with export CONAN_USE_DOCKER=1, but get an error:

>> Running builds...
Page: 1/1
+-----+--------------------+--------------+--------+------------+
|   # |   compiler.version | build_type   | arch   | compiler   |
|-----+--------------------+--------------+--------+------------|
|   1 |                  6 | Release      | x86_64 | gcc        |
+-----+--------------------+--------------+--------+------------+


>> Build: 1/1
Traceback (most recent call last):
  File "/home/mapcam/jw/havoc-github/puzzle/build.py", line 19, in <module>
    builder.run()
  File "/home/mapcam/.local/lib/python3.9/site-packages/cpt/packager.py", line 584, in run
    self.run_builds(base_profile_name=base_profile_name)
  File "/home/mapcam/.local/lib/python3.9/site-packages/cpt/packager.py", line 682, in run_builds
    docker_image = self._get_docker_image(build)
  File "/home/mapcam/.local/lib/python3.9/site-packages/cpt/packager.py", line 729, in _get_docker_image
    docker_image = self._autodetect_docker_base_image(compiler_name, compiler_version)
  File "/home/mapcam/.local/lib/python3.9/site-packages/cpt/packager.py", line 750, in _autodetect_docker_base_image
    if compiler_name == "gcc" and Version(compiler_version) > Version("5"):
  File "/home/mapcam/.local/lib/python3.9/site-packages/conans/model/version.py", line 12, in __new__
    return str.__new__(cls, content.strip())
AttributeError: 'int' object has no attribute 'strip'

Environment Details

  • Conan Package Tools Version: 0.35.1
  • Operating System: Linux
  • Operation System Version: Ubuntu 18.04
  • Conan version: 0.35.2
  • Python version: 3.9.0

Steps to reproduce (Include if Applicable)

in build.py, I have

builder = ConanMultiPackager(reference="myproject/0.1.0@")
builder.add(settings={"arch": "x86_64", "build_type": "Release", "compiler": "gcc", "compiler.version": 6}, options={}, env_vars={}, build_requires={})
builder.run()

Does anybody have an idea?

Thanks, Jochen

Jochen0x90h avatar Apr 21 '21 13:04 Jochen0x90h

I found the problem, the compiler version has to be a string and not an int, i.e. "compiler.version": "6"

Jochen0x90h avatar Apr 23 '21 15:04 Jochen0x90h