Conan: [bug] compiler version mismatch when X.Y.Z version is in profile

Created on 29 Apr 2020  路  6Comments  路  Source: conan-io/conan

Environment Details (include every applicable attribute)

  • Centos linux 8:
  • Compiler+version: clang 8.0.1
  • Conan version: 1.24.1
  • Python version: 3.6.8

Steps to reproduce (Include if Applicable)

  • Use major.minor.patch compiler version in the profile
  • Try to compile a package with cmake

Logs (Executed commands with output) (Include/Attach if Applicable)

INFO  :cmake_flags.py [253]: Setting Cross build flags:  [2020-04-29 09:18:35,231]
-- The C compiler identification is Clang 8.0.1
-- The CXX compiler identification is Clang 8.0.1
-- Check for working C compiler: /home/xxx/.conan/data/llvm/8.0.1/ncr/stable/package/b913856ceabcea86d734a6498b8d4fbfefc47cb2/bin/clang
-- Check for working C compiler: /home/xxx/.conan/data/llvm/8.0.1/ncr/stable/package/b913856ceabcea86d734a6498b8d4fbfefc47cb2/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /home/xxx/.conan/data/llvm/8.0.1/ncr/stable/package/b913856ceabcea86d734a6498b8d4fbfefc47cb2/bin/clang++
-- Check for working CXX compiler: /home/xxx/.conan/data/llvm/8.0.1/ncr/stable/package/b913856ceabcea86d734a6498b8d4fbfefc47cb2/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan: called by CMake conan helper
-- Conan: called inside local cache
-- Conan: Adjusting output directories
-- Conan: Using cmake global configuration
-- Conan: Adjusting default RPATHs Conan policies
-- Conan: Adjusting language standard
-- Conan setting CPP STANDARD: 11 WITH EXTENSIONS OFF
-- Conan: Adjusting fPIC flag (ON)
-- Conan: Compiler Clang>=8, checking major version 8.0.1
-- Conan: Checking correct version: 8.0
CMake Error at conanbuildinfo.cmake:960 (message):
  Detected a mismatch for the compiler version between your conan profile
  settings and CMake:

  Compiler version specified in your conan profile: 8.0.1

  Compiler version detected in CMake: 8.0

I have found this similar issue:

However, since it was fixed I assume this is something else. I have actually checked the cmake file that reports the problem and clearly there is no patch version considered. The check would always fail when X.Y.Z compiler version is used by the profile.

low medium bug

All 6 comments

Hi @kobalicek

Yes, the cmake generator is not prepared for this compiler version check including down to the minor. Lets try to fix it.

In the meantime, you can avoid the checks (they are just there to ensure that your current env and cmake is matching your defined Conan settings for the dependencies), by defining the CMake variable: CONAN_DISABLE_CHECK_COMPILER

Quick question, just to be sure: Besides having

Use major.minor.patch compiler version in the profile

You also had to define a custom settings.yml that define such version including the patch, right?

Yeah, I inherited some projects and they use custom settings. At the moment we have clang 8.0.0 and 8.0.1 profiles for both debug and release, so they really differ in patch version.

I would be actually fine with major.minor to be honest and CONAN_DISABLE_CHECK_COMPILER is sufficient in my case, would be nice that variable appeared in the error message :)

CONAN_DISABLE_CHECK_COMPILER is sufficient in my case, would be nice that variable appeared in the error message :)

Yes, lets add this variable in the error message too, good idea

To summarize the fix:

  • Check only the major.minor (always drop the patch). It will be simpler to check. If users are adding the patch version, they know what they are doing already
  • Add CONAN_DISABLE_CHECK_COMPILER env-var explanation to the error message

Thanks't a lot, I think this is definitely sufficient!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

uilianries picture uilianries  路  3Comments

niosHD picture niosHD  路  3Comments

uilianries picture uilianries  路  3Comments

zlalanne picture zlalanne  路  3Comments

tonka3000 picture tonka3000  路  3Comments