-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[rfc] When should we use validate() and what goes there #4261
Comments
Hooks can be fixed to accept As any other feature, CCI considers the latest Conan version available, so there is no problem using Anyway, we have to fix it, I'm going to send a fix for Hooks. |
I would prefer to keep early checks (raising
It avoids to launch unecessary dependency graph resolution under a recipe, and side effects. |
and version of dependencies are basically not available from |
There is a good explanation about the decision on here: https://blog.conan.io/2020/12/14/New-conan-release-1-32.html |
Correct me if I am wrong but according to the blog we should always throw I guess it's my inexperience but I do not fully understand the motivation and how the I see two distinct uses cases...
Why is the recommendation to always throw
|
if self.settings.os != "Windows": | |
raise ConanInvalidConfiguration("ags doesn't support OS: {}.".format(self.settings.os)) |
conan-center-index/recipes/acado/all/conanfile.py
Lines 116 to 117 in a4d3f50
if self.settings.compiler == "apple-clang": | |
raise ConanInvalidConfiguration("apple-clang not supported") |
conan-center-index/recipes/nanorange/all/conanfile.py
Lines 27 to 28 in 689e266
not any([str(self.settings.compiler.cppstd) == std for std in ["17", "20", "gnu17", "gnu20"]]): | |
raise ConanInvalidConfiguration("nanoRange requires at least c++17") |
self.options
- Local Recipe Options
conan-center-index/recipes/stx/all/conanfile.py
Lines 44 to 46 in fc3b110
if (self.options.panic_handler == 'backtrace' and not self.options.backtrace): raise ConanInvalidConfiguration( - Missing deps
conan-center-index/recipes/libcoap/all/conanfile.py
Lines 44 to 45 in 689e266
elif self.options.dtls_backend == "gnutls": raise ConanInvalidConfiguration("gnu tls not available yet") - Dependency Option
conan-center-index/recipes/libtorrent/all/conanfile.py
Lines 86 to 87 in e6452d8
(self.options["boost"].header_only or self.options["boost"].without_system): raise ConanInvalidConfiguration("libtorrent requires boost with system, which is non-header only in boost < 1.69.0")
self.deps_cpp_info
- Version Requirements
conan-center-index/recipes/simple-websocket-server/all/conanfile.py
Lines 50 to 51 in 45ce303
elif tools.Version(self.version) <= "2.0.1" and "boost" in self.deps_cpp_info.deps and tools.Version(self.deps_cpp_info["boost"].version) >= "1.74.0": raise ConanInvalidConfiguration("simple-websocket-server versions <=2.0.1 require boost < 1.74.0")
Where should the following checks be placed?
Imho, the cleares place to put them are:
Where would you put these ones? |
there are different cases for invalid options, e.g.:
but, perhaps, they all are equivalent in terms of the implementation. in any case, the option could be overridden, e.g.:
I'd expect |
This is something I've seen a lot of recently. We need a consensus and what is the correct procedure.
In the last 24hrs, the usage of this new method, seems to have unearthed a bug where hooks are failing on projects which do no support the platform. #4193
Originally posted by @SpaceIm in #4133 (comment)
Originally posted by @ericLemanissier in #4254 (comment)
The text was updated successfully, but these errors were encountered: