conan-io / conan-package-tools

Conan Package Tools. Helps with massive package creation and CI integration (Travis CI, Appveyor...)
MIT License
165 stars 70 forks source link

fail when using profile includes #574

Open dvirtz opened 3 years ago

dvirtz commented 3 years ago

Description of Problem, Request, or Question

when using profile includes, as described in the docs and using docker, cpt doesn't find the included profile.

This seems to because the runner reads the profile before installing config

https://github.com/conan-io/conan-package-tools/blob/7eff1ff01baacbe4ec1056340eea5a49ed3e82a2/cpt/runner.py#L65

Alternatively, it could try to resolve the includes when setting CPT_PROFILE.

Environment Details

Steps to reproduce (Include if Applicable)

use a config in which a profile includes another one

include(base/centos7)

[settings]
compiler=gcc
compiler.libcxx=libstdc++11
compiler.version=7

Build logs (Include if Available)

Traceback (most recent call last):
  File "/opt/pyenv/versions/3.6.14/lib/python3.6/site-packages/conans/client/profile_loader.py", line 121, in read_profile
    return _load_profile(text, profile_path, default_folder)
  File "/opt/pyenv/versions/3.6.14/lib/python3.6/site-packages/conans/client/profile_loader.py", line 140, in _load_profile
    profile, included_vars = read_profile(include, cwd, default_folder)
  File "/opt/pyenv/versions/3.6.14/lib/python3.6/site-packages/conans/client/profile_loader.py", line 116, in read_profile
    profile_path = get_profile_path(profile_name, default_folder, cwd)
  File "/opt/pyenv/versions/3.6.14/lib/python3.6/site-packages/conans/client/profile_loader.py", line 104, in get_profile_path
    raise ConanException("Profile not found: %s" % profile_name)
conans.errors.ConanException: Profile not found: base/centos7

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/pyenv/versions/3.6.14/bin/run_create_in_docker", line 11, in <module>
    load_entry_point('conan-package-tools==0.35.1', 'console_scripts', 'run_create_in_docker')()
  File "/opt/pyenv/versions/3.6.14/lib/python3.6/site-packages/cpt/run_in_docker.py", line 64, in run
    lockfile=lockfile)
  File "/opt/pyenv/versions/3.6.14/lib/python3.6/site-packages/cpt/runner.py", line 65, in __init__
    self._profile = load_profile(profile_abs_path, cache)
  File "/opt/pyenv/versions/3.6.14/lib/python3.6/site-packages/cpt/profiles.py", line 88, in load_profile
    client_cache.profiles_path)
  File "/opt/pyenv/versions/3.6.14/lib/python3.6/site-packages/conans/client/profile_loader.py", line 140, in _load_profile
    profile, included_vars = read_profile(include, cwd, default_folder)
  File "/opt/pyenv/versions/3.6.14/lib/python3.6/site-packages/conans/client/profile_loader.py", line 125, in read_profile
    raise ConanException("Error reading '%s' profile: %s" % (profile_name, exc))