-
Notifications
You must be signed in to change notification settings - Fork 361
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
tools.check_min_cppstd: add warning about API usage #2191
Conversation
It requires to check the `cppstd` setting, as sometimes this setting could absent and the api call doesn't check it.
maybe this is something to improve in the tool itself. WDYT @uilianries @SSE4 @jgsogo ?? |
The tool does the work as documented: https://github.com/conan-io/conan/blob/bb5f59050a947c556f75524ea56610e7ae31c0d2/conans/client/tools/settings.py#L5. We shouldn't mix here (Conan client documentation) the way we are using this tool in In CCI we are never providing the The reason why we need that Nevertheless, general usage or the intention of this On the practical side in CCI, the right approach would require us to generate the profiles for all the C++ standards and trigger a build of the package for all of them (not feasible, it'd require running x5 configurations)... and also to patch a lot of libraries where the build-system has a C++ standard requirement hardcoded into the sources. I think the examples here still apply and are a good reading: conan-io/examples#73 |
if we talk not only about CCI, but about general usage, the API seems to be an easy to misuse in general, and warnings in docs isn't going to address that. I would vote to fix the tool, but have no objections to put the warning for the time being. now about CCI experience, we even have this section in FAQ: https://github.com/conan-io/conan-center-index/pull/5146/files#diff-9a0d263d27f331b7f71ed0a2f4e39864d4e1ba6df602130a0094d84b52109612R168
so it's clearly only used in conjunction with this sanity check. |
As cpp_std is still experimental, I see no problem improving/fixing it for Conan Client. I agree by don't mixing CCI with Conan client, we have FAQ and hooks there. |
I'm not opposed to changing the tool implementation and change the docs accordingly. But, if that is the case, the proposal should start in |
not necessarily, it may start as:
|
IMO the tool is doing what is documented and I find the behavior logical. Having the additional conan-center-index check inside the tool would "fake" the purpose of the tool and I consider it is better to have this explicit in the recipe. Unless we want to change the behavior of the tool... |
lemme explain my vision a bit :)
which is not well highlighted and explained in the docs. |
the possible explanation for the current situation might follow the structure:
|
I'm ok with adding a note about that other context where it is used, but the main documentation should follow the implementation. So, something like (extra, like an appendix or footnote): .. note::
In those scenarios where `compiler.cppstd` is not explicitly defined in the profiles and
the C++ standard requirement is managed in the build system, it could be useful to
skip this check so the recipe works as expected for users that provide that `compiler.cppstd`
setting and users that don't:
---
if self.settings.get_safe('compiler.cppstd'):
tools.check...
--- |
I am going to close this as:
We've has lots of conversations over the last two years so hopefully this is satisfactory for everyone! |
It requires to check the
cppstd
setting, as sometimes this setting could absent and the api call doesn't check it.