vector-of-bool/pmm

conan has inconsistent permitted values for settings.compiler.version for clang - pmm fails

Closed this issue · 0 comments

Environment

  • pmm 1.5.1
  • clang 11.0

Problem

When setting my compiler to clang 11.0, conan install fails with the following error:

[cmake] ERROR: Invalid setting '11.0' is not a valid 'settings.compiler.version' value.
[cmake] Possible values are ['10', '11', '3.3', '3.4', '3.5', '3.6', '3.7', '3.8', '3.9', '4.0', '5.0', '6.0', '7.0', '7.1', '8', '9']

Why this happens

pmm conveniently creates a conan profile for me, but always sets compiler.version to <major>.<minor>. However, as you can see in the conan output above, 11.0 is not a valid value.

How we could possibly fix it

Obviously this isn't your fault, conan is just inconsistent with their permitted values (maybe they follow some guideline set by clang itself, I don't know tbh), but maybe we can work around this issue.

I think it wouldn't do any harm stealing the list of allowed values from conan, checking if <major>.<minor> is inside and if it isn't, trying again with <major> (provided that <minor> is zero of course).

Thanks for making this awesome integration!