conan icon indicating copy to clipboard operation
conan copied to clipboard

[bug] Detecting profile crashes

Open jputcu opened this issue 1 year ago • 3 comments

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

jputcu avatar Feb 20 '24 18:02 jputcu

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.

memsharded avatar Feb 20 '24 18:02 memsharded

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.

jputcu avatar Feb 20 '24 19:02 jputcu

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

memsharded avatar Feb 20 '24 22:02 memsharded

Fixed in https://github.com/conan-io/conan/pull/15832 for next Conan 2.2, thanks again for reporting!

memsharded avatar Mar 07 '24 18:03 memsharded