You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Linux, using detect_api.detect_clang_compiler in profiles results in the minor version of the compiler being included. On Ubuntu 22.04, it provides 14.0 and on Ubuntu 24.04 it provides 18.1. This is problematic because these versions don't exist in the default settings.yml file and because it isn't consistent with how the detect_api.detect_gcc_compiler returns its version, i.e. just the major version.
How to reproduce it
Use {% set compiler, compiler_version, compiler_exe = detect_api.detect_clang_compiler() %} in a Conan profile with Clang installed on Linux. On Debian, sudo apt -y install clang.
The text was updated successfully, but these errors were encountered:
I am not sure this is a bug, but intended. The api is designed to return the version with the minor.
If you want to obtain the equivalent default version that the conan profile detect is returning, you need to pass it to the detect_api.default_compiler_version().
This is done this way, because this way allows user to decide if they want to keep the minor or not.
Thanks, I think I missed default_compiler_version. Does detect_api.detect_gcc_compiler() work the same way? It didn't seem to for me, just including the major version only.
No, it is true that detect_gcc_compiler is using gcc -dumpversion which happened to change and only return the major version since gcc 7.1, and it stayed this way. It should be possible to use gcc -dumpfullversion, but I am concerned this could also break some users, not sure what would be the best way to change this, if a newer api method or an argument or other approach.
Describe the bug
On Linux, using
detect_api.detect_clang_compiler
in profiles results in the minor version of the compiler being included. On Ubuntu 22.04, it provides14.0
and on Ubuntu 24.04 it provides18.1
. This is problematic because these versions don't exist in the defaultsettings.yml
file and because it isn't consistent with how thedetect_api.detect_gcc_compiler
returns its version, i.e. just the major version.How to reproduce it
Use
{% set compiler, compiler_version, compiler_exe = detect_api.detect_clang_compiler() %}
in a Conan profile with Clang installed on Linux. On Debian,sudo apt -y install clang
.The text was updated successfully, but these errors were encountered: