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
I'm probably doing something wrong or missing a Conan concept, but I have the following problem and can't image why this should be a "feature":
1.) I have some advanced logic to load requirements from a YAML file, therefore I'm implementing the requirements method
2.) conan install works as expected when using the package development flow
3.) conan build does not work as expected. I was expecting the requirements to be accessible in the self.requires attribute, but it is just empty. It seems the requirements method is not called when using the conan build step. I - of course - can work around that by calling the requirements method again if self.requires is empty, but I don't see any reason why this needs to be done manually by the developer.
I would be very interested in knowing the details why the behavior is as it is or if it is a bug or a feature.
Many thanks for clarification.
Environment Details (include every applicable attribute)
Operating System+version: Ubuntu 18.04
Compiler+version: -
Conan version: 1.38.0
Python version: 3.6.9
Steps to reproduce (Include if Applicable)
1.) Load a requirement via the requirements method
2.) Print the content of self.requires during the build method
3.) Use the package development flow
4.) Expected: self.requires contains the requirement that is loaded in the requirements method
5.) Actual: self.requires is empty in the build method
The text was updated successfully, but these errors were encountered:
The rationale for this was that conan build had to be very fast, just calling the build command. As the conan install resolution might take some time, what we did in the past was to serialize some necessary information at conan install and conan build just reads it, instead of computing the whole graph. As a result, not all the information is available, just the bare minimum, and this has been the source of some issues, similar to this one in the last years. This was not a bug, the build() method was not supposed to have access to the self.requires, only the generators at "install" time had full access to dependencies information.
So then, we decided to remove this for Conan 2.0. This was discussed with the Tribe here: conan-io/tribe#19
The necessary changes have already been implemented in the develop2 branch, and will be part of the first Conan 2.0-alpha. It will basically compute a full dependency graph for every conan build command, so all the information will be there. So this issue can be considered fixed by #8589
Hi there,
I'm probably doing something wrong or missing a Conan concept, but I have the following problem and can't image why this should be a "feature":
1.) I have some advanced logic to load requirements from a YAML file, therefore I'm implementing the
requirements
method2.)
conan install
works as expected when using the package development flow3.)
conan build
does not work as expected. I was expecting the requirements to be accessible in theself.requires
attribute, but it is just empty. It seems therequirements
method is not called when using theconan build
step. I - of course - can work around that by calling therequirements
method again ifself.requires
is empty, but I don't see any reason why this needs to be done manually by the developer.I would be very interested in knowing the details why the behavior is as it is or if it is a bug or a feature.
Many thanks for clarification.
Environment Details (include every applicable attribute)
Steps to reproduce (Include if Applicable)
1.) Load a requirement via the
requirements
method2.) Print the content of
self.requires
during thebuild
method3.) Use the package development flow
4.) Expected:
self.requires
contains the requirement that is loaded in therequirements
method5.) Actual:
self.requires
is empty in thebuild
methodThe text was updated successfully, but these errors were encountered: