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

Raises ConanException for check_min_cppstd #1559

Merged
merged 3 commits into from Mar 31, 2020

Conversation

uilianries
Copy link
Member

@uilianries uilianries commented Feb 14, 2020

Related PR: conan-io/conan#6548

Signed-off-by: Uilian Ries <uilianries@gmail.com>
reference/tools.rst Outdated Show resolved Hide resolved
Co-Authored-By: James <james@conan.io>
@@ -1659,6 +1659,7 @@ It raises a ``ConanInvalidConfiguration`` when is not supported.
* If the current cppstd does not support C++17, ``check_min_cppstd`` will raise an ``ConanInvalidConfiguration`` error.
* If ``gnu_extensions`` is True, it is required that the applied ``cppstd`` supports the gnu extensions.
(e.g. gnu17), otherwise, an :ref:`ConanInvalidConfiguration<conditional_settings_options_requirements>` will be raised. The ``gnu_extensions`` is checked in any OS.
* If no compiler has been specified or the compiler is unknown, it raises a ``ConanInvalidConfiguration`` exception.
Copy link
Member

@jgsogo jgsogo Mar 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it will raise a ConanException:

        compiler = conanfile.settings.get_safe("compiler")
        compiler_version = conanfile.settings.get_safe("compiler.version")
        if not compiler or not compiler_version:
            raise ConanException("Could not obtain cppstd because there is no declared "
                                 "compiler in the 'settings' field of the recipe.")

If it is a ConanException, I'm not sure if we should document it

Copy link
Member Author

@uilianries uilianries Mar 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right! Thanks Javi, I'll update it.

reference/tools.rst Outdated Show resolved Hide resolved
@@ -1659,6 +1659,7 @@ It raises a ``ConanInvalidConfiguration`` when is not supported.
* If the current cppstd does not support C++17, ``check_min_cppstd`` will raise an ``ConanInvalidConfiguration`` error.
* If ``gnu_extensions`` is True, it is required that the applied ``cppstd`` supports the gnu extensions.
(e.g. gnu17), otherwise, an :ref:`ConanInvalidConfiguration<conditional_settings_options_requirements>` will be raised. The ``gnu_extensions`` is checked in any OS.
* If no compiler has been specified or the compiler is unknown, it raises a ``ConanException`` exception.
Copy link
Member

@danimtb danimtb Mar 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have the ConanExeception mentioned here https://docs.conan.io/en/latest/reference/commands/return_codes.html#general-error and we mention it in other tools, so I think it is fine

@czoido czoido merged commit ac1bf8a into conan-io:develop Mar 31, 2020
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants