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

Disallow self.cpp_info access in validate_build() method #16135

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 6 additions & 5 deletions conans/client/graph/compute_pid.py
Expand Up @@ -57,11 +57,12 @@ def compute_package_id(node, new_config, config_version):

if hasattr(conanfile, "validate_build"):
with conanfile_exception_formatter(conanfile, "validate_build"):
try:
conanfile.validate_build()
except ConanInvalidConfiguration as e:
# This 'cant_build' will be ignored if we don't have to build the node.
node.cant_build = str(e)
with conanfile_remove_attr(conanfile, ['cpp_info'], "validate_build"):
try:
conanfile.validate_build()
except ConanInvalidConfiguration as e:
# This 'cant_build' will be ignored if we don't have to build the node.
node.cant_build = str(e)

run_validate_package_id(conanfile)

Expand Down