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

[bug] Default cppstd not working due to non-existent _cppstd_default #12298

Closed
mzukovec opened this issue Oct 13, 2022 · 3 comments · Fixed by #12446
Closed

[bug] Default cppstd not working due to non-existent _cppstd_default #12298

mzukovec opened this issue Oct 13, 2022 · 3 comments · Fixed by #12446
Assignees
Milestone

Comments

@mzukovec
Copy link

mzukovec commented Oct 13, 2022

Environment Details (include every applicable attribute)

  • Operating System+version: Windows 10
  • Compiler+version: Visual Studio 2022
  • Conan version: 1.53.0
  • Python version: 3.8

Description

Conan v1.53.0 default cppstd is not working. It returns None due to the call of the non-existent _cppstd_default method.

See the definition:

def default_cppstd(conanfile, compiler=None, compiler_version=None):
    """
    Get the default ``compiler.cppstd`` for the "conanfile.settings.compiler" and "conanfile
    settings.compiler_version" or for the parameters "compiler" and "compiler_version" if specified.
    :param conanfile: The current recipe object. Always use ``self``.
    :param compiler: Name of the compiler e.g. gcc
    :param compiler_version: Version of the compiler e.g. 12
    :return: The default ``compiler.cppstd`` for the specified compiler
    """
    from conans.client.conf.detect import _cppstd_default
    compiler = compiler or conanfile.settings.get_safe("compiler")
    compiler_version = compiler_version or conanfile.settings.get_safe("compiler.version")
    if not compiler or not compiler_version:
        raise ConanException("Called default_cppstd with no compiler or no compiler.version")
    return _cppstd_default(compiler, Version(compiler_version))

Method _cppstd_default does not exist anywhere, therefore None is always returned.

@mzukovec
Copy link
Author

After re-checking, this seems to be dead code, since it's not really used anywhere. Is this some future feature?

Please let me know if this issue should be closed.

@memsharded
Copy link
Member

No, please don't close it, the idea is that this function was there as part of the upgrade of tools, but you are right this code is not even tested, so we should have a look.

@memsharded memsharded added this to the 1.54 milestone Oct 13, 2022
@memsharded
Copy link
Member

Fixed in #12446, will be in 1.54 soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants