New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[question] Is new cmake_layout compatible with cpp_info.components ? #9331
Comments
Hi @Hopobcn I have managed to reproduce this, indeed seems a bug. Thanks for the complete |
Apparently doing: settings = "os", "arch", "compiler", "build_type"
def layout(self):
self.cpp.package.components["say"].includedirs = ["include"] Fixes the issue. However, I think we intended to keep supporting the other |
BTW, the test to reproduce is: def test_components_error():
# https://github.com/conan-io/conan/issues/9331
client = TestClient()
conan_hello = textwrap.dedent("""
import os
from conans import ConanFile
from conan.tools.files import save
class Pkg(ConanFile):
settings = "os", "arch", "compiler", "build_type"
def layout(self):
pass
def package_info(self):
self.cpp_info.components["say"].includedirs = ["include"]
""")
client.save({"conanfile.py": conan_hello})
client.run("create . hello/1.0@") It is fixed by adding |
Thanks for the fast reply! Yep, can confirm that using the |
@memsharded I'm not sure that the generator ( Using a test_package like this:
The resulting |
Hi @Hopobcn yes, please check the warning notes in https://docs.conan.io/en/latest/reference/conanfile/methods.html#layout. It is extremely risky to try to introduce the |
@lasote This error also happens here: conan-io/conan-center-index#6578 Probably the workaround suggested by @memsharded would work here, but that would require a full refactor of the |
on my way! |
Hi, I've been using CMakeToolchain for a while with the CMake build helper that comes with it.
But after updating today I saw that
CMake
build helper does not accept abuild_folder
parameter anymore.Looking at why it happened I arrived at https://github.com/conan-io/conan/pull/8554/files#diff-d72013a45b00a0adf06f4536d6a8c8844461e51b72911937d63e6dda9a3d440aR64 this means that the new way of providing the folder topology is via
def layout(self)
right?My first move was to employ the new
cmake_layout
utility, but I was unable to create a package if this one usedself.cpp_info.components
Conanfile example:
So, I am doing something wrong? Is this intended or just a bug/missing feature?
Thanks!
The text was updated successfully, but these errors were encountered: