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
from conan.tools.build import valid_max_cppstd
def package_id():
if self.info.settings.get_safe("compiler.cppstd") and not valid_max_cppstd(self, "14"):
self.info.settings.compiler.cppstd = "14"
def generate():
cppstd = self.settings.get_safe("compiler.cppstd")
if cppstd and not valid_max_cppstd(self, "14"):
tc.cache_variables["CMAKE_CXX_STANDARD"] = "14"
This fails because the implementation of valid_max_cppstd() accessses self.settings which is not allowed within a package_id()
Have you read the CONTRIBUTING guide?
I've read the CONTRIBUTING guide
The text was updated successfully, but these errors were encountered:
YES, PLEASE. This is quite a headache when trying to re-use the same checks in package_id and elsewhere. self.settings and self.options should not be modifiable in package_id(), but it would be great to be able to do read-only access to these values as mentioned in the issue.
Doing valid_max_cppstd(self.info, "14") can be used in the above snippet as a workaround, though.
What is your question?
example use case
This fails because the implementation of
valid_max_cppstd()
accesssesself.settings
which is not allowed within apackage_id()
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: