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] conan profile show fails on Windows #15720

Closed
jwillikers opened this issue Feb 21, 2024 · 7 comments · Fixed by #16065
Closed

[bug] conan profile show fails on Windows #15720

jwillikers opened this issue Feb 21, 2024 · 7 comments · Fixed by #16065
Assignees
Milestone

Comments

@jwillikers
Copy link
Contributor

jwillikers commented Feb 21, 2024

Environment details

  • Operating System+version: Windows 11 Pro 23H2
  • Compiler+version: msvc 193
  • Conan version: 2.1.0
  • Python version: 3.12.2

Steps to reproduce

  1. conan profile detect
  2. conan profile show --profile:host default --profile:build default

Note that I can't reproduce if I completely delete my ~/.conan2 directory.

Logs

$ conan profile show --profile:host default
ERROR: Traceback (most recent call last):
  File "C:\Users\Quickemu\AppData\Local\Programs\Python\Python312\Lib\site-packages\conan\cli\cli.py", line 281, in main
    cli.run(args)
  File "C:\Users\Quickemu\AppData\Local\Programs\Python\Python312\Lib\site-packages\conan\cli\cli.py", line 191, in run
    command.run(self._conan_api, args[0][1:])
  File "C:\Users\Quickemu\AppData\Local\Programs\Python\Python312\Lib\site-packages\conan\cli\command.py", line 158, in run
    sub.run(conan_api, parser, *args)
  File "C:\Users\Quickemu\AppData\Local\Programs\Python\Python312\Lib\site-packages\conan\cli\command.py", line 172, in run
    info = self._method(conan_api, parent_parser, self._parser, *args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Quickemu\AppData\Local\Programs\Python\Python312\Lib\site-packages\conan\cli\commands\profile.py", line 40, in profile_show
    result = conan_api.profiles.get_profiles_from_args(args)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Quickemu\AppData\Local\Programs\Python\Python312\Lib\site-packages\conan\api\subapi\profiles.py", line 60, in get_profiles_from_args
    cache_settings = self._conan_api.config.settings_yml
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Quickemu\AppData\Local\Programs\Python\Python312\Lib\site-packages\conan\api\subapi\config.py", line 122, in settings_yml
    return Settings(settings)
           ^^^^^^^^^^^^^^^^^^
  File "C:\Users\Quickemu\AppData\Local\Programs\Python\Python312\Lib\site-packages\conans\model\settings.py", line 189, in __init__
    self._data = {k: SettingsItem(v, "%s.%s" % (name, k))
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Quickemu\AppData\Local\Programs\Python\Python312\Lib\site-packages\conans\model\settings.py", line 35, in __init__
    self._definition[k] = Settings(v, name, k)
                          ^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Quickemu\AppData\Local\Programs\Python\Python312\Lib\site-packages\conans\model\settings.py", line 189, in __init__
    self._data = {k: SettingsItem(v, "%s.%s" % (name, k))
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Quickemu\AppData\Local\Programs\Python\Python312\Lib\site-packages\conans\model\settings.py", line 38, in __init__
    self._definition = [str(v) if v is not None else None for v in definition]
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable

ERROR: 'NoneType' object is not iterable
@AbrilRBS AbrilRBS added the bug label Feb 21, 2024
@AbrilRBS AbrilRBS self-assigned this Feb 21, 2024
@AbrilRBS
Copy link
Member

Hi! Thanks for the report. I've tried to reproduce locally and I'm not able to get it to crash - Maybe this is something to do with the detected profile? Could you please share the default profile that conan is detecting? Thanks!

@jwillikers
Copy link
Contributor Author

I figured out that deleting my entire ~/.conan2 directory and running conan profile detect followed by conan profile show ... works.

Host profile:
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=14
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=193
os=Windows

Build profile:
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=14
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=193
os=Windows

@jwillikers
Copy link
Contributor Author

It's an issue with settings_user.yml. If I delete my file for that it works.

@memsharded
Copy link
Member

Can you please share a settings_user.yml file that would make it crash? Thanks!

@jwillikers
Copy link
Contributor Author

jwillikers commented Feb 21, 2024

Yes, I believe I narrowed it down to me not including square brackets:

os:
    Windows:
        libc: null

The following doesn't crash:

os:
    Windows:
        libc: [null]

It seems to require that I add libc for Windows since I have it for Linux, which is why I added it like that:

$ conan profile show --profile:host windows/msvc/2022/debug --profile:build windows/msvc/2022/release
ERROR: 'settings.os.libc' doesn't exist for 'Windows'
'settings.os' possible configurations are ['subsystem']

@memsharded
Copy link
Member

Makes sense, kind of expected.

os:
    Windows:
        libc:
            null:

will probably not crash either.

So this is more a UX thing that a bug, might be worth checking if it can be easily improved.

@memsharded
Copy link
Member

Closed by #16065, will be in Conan 2.3

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.

3 participants