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] Detecting profile crashes #15712

Closed
jputcu opened this issue Feb 20, 2024 · 4 comments · Fixed by #15832
Closed

[bug] Detecting profile crashes #15712

jputcu opened this issue Feb 20, 2024 · 4 comments · Fixed by #15832
Assignees
Milestone

Comments

@jputcu
Copy link
Contributor

jputcu commented Feb 20, 2024

Environment details

  • GhostBSD 24.01.1, FreeBSD jorisp-ghostbsd 14.0-STABLE FreeBSD 14.0-STABLE GENERIC amd64
  • /usr/local/bin/clang++15 (15.0.7) /usr/local/bin/gcc12 (12.2.0)
  • Conan version: 2.1.0
  • Python version: 3.9.18

Steps to reproduce

conan profile detect

Logs

ERROR: Traceback (most recent call last):
File "/home/jorisp/.local/lib/python3.9/site-packages/conan/cli/cli.py", line 281, in main
cli.run(args)
File "/home/jorisp/.local/lib/python3.9/site-packages/conan/cli/cli.py", line 191, in run
command.run(self._conan_api, args[0][1:])
File "/home/jorisp/.local/lib/python3.9/site-packages/conan/cli/command.py", line 158, in run
sub.run(conan_api, parser, *args)
File "/home/jorisp/.local/lib/python3.9/site-packages/conan/cli/command.py", line 172, in run
info = self._method(conan_api, parent_parser, self._parser, *args)
File "/home/jorisp/.local/lib/python3.9/site-packages/conan/cli/commands/profile.py", line 68, in profile_detect
detected_profile = conan_api.profiles.detect()
File "/home/jorisp/.local/lib/python3.9/site-packages/conan/api/subapi/profiles.py", line 142, in detect
settings = detect_defaults_settings()
File "/home/jorisp/.local/lib/python3.9/site-packages/conans/client/conf/detect.py", line 17, in detect_defaults_settings
compiler, version, compiler_exe = detect_default_compiler()
TypeError: cannot unpack non-iterable NoneType object

ERROR: cannot unpack non-iterable NoneType object

@memsharded memsharded self-assigned this Feb 20, 2024
@memsharded memsharded added this to the 2.2.0 milestone Feb 20, 2024
@memsharded
Copy link
Member

Thanks for reporting this @jputcu

It seems there is a gap for FreeBSD if it cannot detect the clang compiler:

   if platform.system() in ["Darwin", "FreeBSD"]:
        clang, clang_version, compiler_exe = _clang_compiler()  # prioritize clang
        if clang:
            return clang, clang_version, compiler_exe
        return

That last return is the offending one, lets fix it for next release.
In the meantime, you can avoid it by manually creating your default profile, please ask for help if you need with that.

@jputcu
Copy link
Contributor Author

jputcu commented Feb 20, 2024

Apparently on GhostBSD, I need to install the following:
sudo pkg install os-generic-userland-devtools

Then conan profile detect gives me:

detect_api: Found clang 16.0
detect_api: clang>=8, using the major as version

Detected profile:
[settings]
arch=x86_64
build_type=Release
compiler=clang
compiler.cppstd=gnu17
compiler.libcxx=libc++
compiler.version=16
os=FreeBSD

WARN: This profile is a guess of your environment, please check it.
WARN: The output of this command is not guaranteed to be stable and can change in future Conan versions.
WARN: Use your own profile files for stability.

@memsharded
Copy link
Member

Yes, if the compiler is installed, then clang, clang_version, compiler_exe = _clang_compiler() doesn't raise, because the compiler is detected.

@memsharded
Copy link
Member

Fixed in #15832 for next Conan 2.2, thanks again for reporting!

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 a pull request may close this issue.

5 participants