Repository: conan-io/conan

Issue:
new clang version 10.0.0 is not supported (settings.compiler.version)
conan version: 1.4.4
clang version: 10.0.0
I've used the following pipeline in Jenkins : https://github.com/jfrog/project-examples/blob/master/jenkins-examples/pipeline-examples/conan-example/Jenkinsfile

If failed with the following output:

(/var/folders/3h/fkh389zj34s7hl6xdpjd1hn0bc436s/T/conan5921226174563491616/.conan/profiles/default)
Found apple-clang 0.0
Default settings
	os=Macos
	os_build=Macos
	arch=x86_64
	arch_build=x86_64
	compiler=apple-clang
	compiler.version=0.0
	compiler.libcxx=libc++
	build_type=Release
*** You can change them in /var/folders/3h/fkh389zj34s7hl6xdpjd1hn0bc436s/T/conan5921226174563491616/.conan/profiles/default ***
*** Or override with -s compiler='other' -s ...s***


**ERROR: Invalid setting '0.0' is not a valid 'settings.compiler.version' value.
Possible values are ['5.0', '5.1', '6.0', '6.1', '7.0', '7.3', '8.0', '8.1', '9.0', '9.1']**



Discussion:
Yes, it seems the parsing of the version only uses 1 digit, and 10.0 overflows.

Resolving patch:
diff --git a/conans/client/conf/__init__.py b/conans/client/conf/__init__.py
--- a/conans/client/conf/__init__.py
+++ b/conans/client/conf/__init__.py
@@ -66,7 +66,7 @@
         version: ["3.3", "3.4", "3.5", "3.6", "3.7", "3.8", "3.9", "4.0", "5.0", "6.0", "7.0"]
         libcxx: [libstdc++, libstdc++11, libc++]
     apple-clang:
-        version: ["5.0", "5.1", "6.0", "6.1", "7.0", "7.3", "8.0", "8.1", "9.0", "9.1"]
+        version: ["5.0", "5.1", "6.0", "6.1", "7.0", "7.3", "8.0", "8.1", "9.0", "9.1", "10.0"]
         libcxx: [libstdc++, libc++]
 
 build_type: [None, Debug, Release, RelWithDebInfo, MinSizeRel]
diff --git a/conans/client/conf/detect.py b/conans/client/conf/detect.py
--- a/conans/client/conf/detect.py
+++ b/conans/client/conf/detect.py
@@ -61,7 +61,7 @@ def _clang_compiler(output, compiler_exe="clang"):
             compiler = "apple-clang"
         elif "clang version" in out:
             compiler = "clang"
-        installed_version = re.search("([0-9]\.[0-9])", out).group()
+        installed_version = re.search("([0-9]+\.[0-9])", out).group()
         if installed_version:
             output.success("Found %s %s" % (compiler, installed_version))
             return compiler, installed_version


Test patch:
diff --git a/conans/test/build_helpers/cpp_std_flags_test.py b/conans/test/build_helpers/cpp_std_flags_test.py
--- a/conans/test/build_helpers/cpp_std_flags_test.py
+++ b/conans/test/build_helpers/cpp_std_flags_test.py
@@ -148,6 +148,8 @@ def test_apple_clang_cppstd_flags(self):
         self.assertEquals(cppstd_flag("apple-clang", "9.1", "14"), '-std=c++14')
         self.assertEquals(cppstd_flag("apple-clang", "9.1", "17"), "-std=c++17")
 
+        self.assertEquals(cppstd_flag("apple-clang", "10.0", "17"), "-std=c++17")
+
     def test_apple_clang_cppstd_defaults(self):
         self.assertEquals(cppstd_default("apple-clang", "2"), "gnu98")
         self.assertEquals(cppstd_default("apple-clang", "3"), "gnu98")
@@ -157,6 +159,7 @@ def test_apple_clang_cppstd_defaults(self):
         self.assertEquals(cppstd_default("apple-clang", "7"), "gnu98")
         self.assertEquals(cppstd_default("apple-clang", "8"), "gnu98")
         self.assertEquals(cppstd_default("apple-clang", "9"), "gnu98")
+        self.assertEquals(cppstd_default("apple-clang", "10"), "gnu98")
 
     def test_visual_cppstd_flags(self):
         self.assertEquals(cppstd_flag("Visual Studio", "12", "11"), None)