Skip to content
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

Prepare build compatibles refactor #16919

Merged

Conversation

memsharded
Copy link
Member

Changelog: Omit
Docs: Omit

This should be a pure refactor.
In preparation for #16871

  • Move from root_node.cant_build => root_node.conanfile.info.cant_build, so the cant_build information belongs per info, so multiple "compatible" packages can be analyzed if they can be built or not.
  • Split the def _process_compatible_packages(self, node, remotes, update): into _get_compatibles and _compatible_found() so they can be reused

@memsharded memsharded added this to the 2.8.0 milestone Sep 2, 2024
Copy link
Contributor

@perseoGI perseoGI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -328,6 +328,7 @@ class ConanInfo:
def __init__(self, settings=None, options=None, reqs_info=None, build_requires_info=None,
python_requires=None, conf=None, config_version=None):
self.invalid = None
self.cant_build = False # It will set to a str with a reason if the validate_build() fails
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dont we want to serialize/clone this when calling the appropiate methods?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was already being serialized as some "root" information of the node, not as cpp_info field, I thought it is better to not break the serialization output, so it keeps being serialized above in result["invalid_build"] = getattr(getattr(self.conanfile, "info", None), "cant_build", False)

@czoido czoido merged commit 51731ef into conan-io:develop2 Sep 2, 2024
2 checks passed
@memsharded memsharded deleted the feature/build_compatibles_refactor branch September 2, 2024 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants