You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the latter does not get the include(/path/to/EmbeddedTollchain.cmake) line in conan_toolchain.cmake (the user_toolchain block is missing).
I think the issue is that _receive_conf called (to integrate the info from build_requires) during write_toolchain, which runs after the self._generator_manager.write_generators, so generates which run via the generators = attribute will not see the effects of any build_requires' conf_info, wheras the same generator invoked from generate() will have these values. This seems like an undesirable inconsistency.
Thanks for the report, and the detailed investigation. Indeed a bug, fixed in #9573, and scheduled for next patch release 1.40.1.
Beware that this is quite experimental, there are quite a few unknowns, check the very simple implementation with a few TODOS:
def_receive_conf(conanfile):
""" collect conf_info from the immediate build_requires, aggregate it and injects/update current conf """# TODO: Open question 1: Only build_requires can define config?# TODO: Only direct build_requires?# TODO: Is really the best mechanism to define this info? Better than env-vars?# Conf only for first level build_requiresforbuild_requireinconanfile.dependencies.direct_build.values():
ifbuild_require.conf_info:
conanfile.conf.compose(build_require.conf_info)
Beware that this is quite experimental, there are quite a few unknowns
Yeah :-). I just figured it was perhaps far enough along that I should try getting one of our cross-compiler/toolchain setups expressed using the new way and see what did/didn't work :-)
Environment Details (include every applicable attribute)
Steps to reproduce (Include if Applicable)
I have a package (represending a Yocto cross-compiler, further wrapped by winegcc) wants to inject custom embedded toolchain's CMAKE_TOOLCHAIN_FILE
Consumers (or really a profiles) would build_require this package target the system described by those settings.
This works if the consumer uses
but not if it uses
the latter does not get the
include(/path/to/EmbeddedTollchain.cmake)
line in conan_toolchain.cmake (the user_toolchain block is missing).I think the issue is that
_receive_conf
called (to integrate the info from build_requires) duringwrite_toolchain
, which runs after the self._generator_manager.write_generators, so generates which run via thegenerators =
attribute will not see the effects of any build_requires' conf_info, wheras the same generator invoked from generate() will have these values. This seems like an undesirable inconsistency.conan/conans/client/generators/__init__.py
Lines 229 to 236 in ff7b8e6
conan/conans/client/installer.py
Lines 133 to 137 in ff7b8e6
The text was updated successfully, but these errors were encountered: