Skip to content

Commit

Permalink
Disallow self.cpp_info access in validate_build() method (#16135)
Browse files Browse the repository at this point in the history
Disallow cpp_info access in validate_build()
  • Loading branch information
RubenRBS committed Apr 29, 2024
1 parent f3cc480 commit d818b6e
Showing 1 changed file with 6 additions and 5 deletions.
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

0 comments on commit d818b6e

Please sign in to comment.