Repository: conan-io/conan

Issue:
Release of clang 7.1
To help us debug your issue please explain:

- [x] I've read the [CONTRIBUTING guide](https://github.com/conan-io/conan/blob/develop/.github/CONTRIBUTING.md).
- [x] I've specified the Conan version, operating system version and any tool that can be relevant.
- [x] I've explained the steps to reproduce the error or the motivation/use case of the question/suggestion.

It looks like Clang 7.1 was released (just today!?), and as such there is now a missing entry in the default `default_settings_yml`

Appears to be a completely separate issue from https://github.com/conan-io/conan/issues/4909

At first blush this seems relatively trivial so I have a fork with the changes here:
https://github.com/cstratopoulos/conan/commit/e2038f8aa8dc194793d09668d1810e2afa67b7fe

However I saw in the PR contrib guidelines it's preferred to have an issue open first. Maybe I'm overlooking some subtleties about if this merits adding new test cases or changing entries in other files. In that case it may be easier for another maintainer to just do the updates rather than opening a PR off mine.


Discussion:
Hi @cstratopoulos 

Could you please point to the source of the clang release? It seemed that clang was going to release only patches now (which are totally binary compatible, and don't need such modelling in the default settings.yml). This is the reason why clang settings only contain 5.0, 6.0, and 7.0 versions. 

From http://releases.llvm.org/, it seems that you are referring to 7.0.1.

Please check, thanks!"
I haven't seen the release of 7.1.0 yet but the LLVM/clang team is definitely in process of releasing it.  To the best of my knowledge release candidate 1 gets currently tested [1]. I mentioned it already briefly in slack some time ago [2] but it went unnoticed.

[1] http://lists.llvm.org/pipermail/llvm-dev/2019-March/131375.html
[2] https://cpplang.slack.com/archives/C41CWV9HA/p1549648557824700?thread_ts=1549647369.817200&cid=C41CWV9HA

This is against their own policy, and unexpected: http://blog.llvm.org/2016/12/llvms-new-versioning-scheme.html, isnt it?

In any case, we should probably wait until it is really released.
Indeed, it was not planed but 7.0.0 has a bad ABI incompatibility with gcc which they can not fix without breaking their own ABI [1]. Considering that gcc and clang are expected to be ABI compatible, and that many Linux distributions do not permit to perform major compiler upgrades, releasing 7.1.0 is more or less the only sane option.

[1] https://bugs.llvm.org/show_bug.cgi?id=39427

Then yes, it seems that the version will have to be added to settings.
The only thing is that it might be necessary to take that into account in other places, not only adding to ``settings.yml``:

- Automatic detection of default profile
- Checking of compiler version by CMake conanbuildinfo.cmake code
- etc (not sure where else, need to check)
Basically I've been following the steps on https://apt.llvm.org/ to add the apt repository with clang 7, then doing `sudo apt install clang-7`. As of  the 9th, this has been grabbing clang 7.1 rather than 7.0.1.

Maybe I've unwittingly been grabbing from the nightly or development channel or something like that? It seem indeed as you've indicated that clang 7.1 has yet to be officially released.

```
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key
+ sudo apt-key add -
--2019-04-11 10:08:55--  https://apt.llvm.org/llvm-snapshot.gpg.key
Resolving apt.llvm.org (apt.llvm.org)... 151.101.50.49, 2a04:4e42:c::561
Connecting to apt.llvm.org (apt.llvm.org)|151.101.50.49|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3145 (3.1K) [application/octet-stream]
Saving to: ‘STDOUT’

     0K ...                                                   100%  141M=0s

2019-04-11 10:08:55 (141 MB/s) - written to stdout [3145/3145]

OK
+ sudo apt-add-repository 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-7 main'
+ sudo apt update
```
after this 
```
+ clang++-7 --version
clang version 7.1.0-svn353565-1~exp1~20190408084827.60 (branches/release_70)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
```

It seems that conan grabs the minor version:
```
Auto detecting your dev setup to initialize the default profile (/home/vsts/.conan/profiles/default)
CC and CXX: None, clang++-7 
Found clang 7.1
Default settings
	os=Linux
	os_build=Linux
	arch=x86_64
	arch_build=x86_64
	compiler=clang
	compiler.version=7.1
	compiler.libcxx=libstdc++
	build_type=Release
*** You can change them in /home/vsts/.conan/profiles/default ***
*** Or override with -s compiler='other' -s ...s***


ERROR: Invalid setting '7.1' is not a valid 'settings.compiler.version' value.
Possible values are ['3.3', '3.4', '3.5', '3.6', '3.7', '3.8', '3.9', '4.0', '5.0', '6.0', '7.0', '8']
Read "http://docs.conan.io/en/latest/faq/troubleshooting.html#error-invalid-setting"
Traceback (most recent call last):
  File "/home/vsts/work/_temp/9b5e83e5-c1fa-47ee-bbbe-7f648b5c06e1.py", line 7, in <module>
    subprocess.check_call(args)
  File "/usr/lib/python2.7/subprocess.py", line 541, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['conan', 'install', '/home/vsts/work/1/s', '-o', 'boost:header_only=True', '--build', 'missing', '-s', 'build_type=Debug', '-s', 'compiler.libcxx=libc++']' returned non-zero exit status 1
```
FYI, 7.1.0 has been tagged (see http://lists.llvm.org/pipermail/llvm-dev/2019-April/131724.html).
Is there any update on that issue? Travis CI builds are failing because there is only a clang 7.1 (no 7.0 anymore) that still is not supported according to settings.yml.
Yes, seems that it is officially released: http://releases.llvm.org/download.html#7.0.1

I was confused, as the main site doesn't link it! http://releases.llvm.org/

Sorry for the delay in handling this. Lets try to add it to next 1.17.1 patch release

Resolving patch:
diff --git a/conans/client/cmd/new_ci.py b/conans/client/cmd/new_ci.py
--- a/conans/client/cmd/new_ci.py
+++ b/conans/client/cmd/new_ci.py
@@ -365,7 +365,7 @@ def ci_get_files(name, version, user, channel, visual_versions, linux_gcc_versio
             circleci_clang_versions or circleci_osx_versions):
         return {}
     gcc_versions = ["4.9", "5", "6", "7", "8"]
-    clang_versions = ["3.9", "4.0", "5.0", "6.0", "7.0"]
+    clang_versions = ["3.9", "4.0", "5.0", "6.0", "7.0", "7.1"]
     if visual_versions is True:
         visual_versions = ["12", "14", "15"]
     if linux_gcc_versions is True:
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
@@ -78,7 +78,7 @@
         cppstd: [None, 14, 17, 20]
     clang:
         version: ["3.3", "3.4", "3.5", "3.6", "3.7", "3.8", "3.9", "4.0",
-                  "5.0", "6.0", "7.0",
+                  "5.0", "6.0", "7.0", "7.1",
                   "8"]
         libcxx: [libstdc++, libstdc++11, libc++, c++_shared, c++_static]
         cppstd: [None, 98, gnu98, 11, gnu11, 14, gnu14, 17, gnu17, 20, gnu20]
diff --git a/conans/client/migrations_settings.py b/conans/client/migrations_settings.py
--- a/conans/client/migrations_settings.py
+++ b/conans/client/migrations_settings.py
@@ -538,4 +538,85 @@
 cppstd: [None, 98, gnu98, 11, gnu11, 14, gnu14, 17, gnu17, 20, gnu20]  # Deprecated, use compiler.cppstd
 """
 
-settings_1_17_1 = settings_1_17_0
+settings_1_17_1 = """
+# Only for cross building, 'os_build/arch_build' is the system that runs Conan
+os_build: [Windows, WindowsStore, Linux, Macos, FreeBSD, SunOS, AIX]
+arch_build: [x86, x86_64, ppc32be, ppc32, ppc64le, ppc64, armv5el, armv5hf, armv6, armv7, armv7hf, armv7s, armv7k, armv8, armv8_32, armv8.3, sparc, sparcv9, mips, mips64, avr, s390, s390x, sh4le]
+
+# Only for building cross compilation tools, 'os_target/arch_target' is the system for
+# which the tools generate code
+os_target: [Windows, Linux, Macos, Android, iOS, watchOS, tvOS, FreeBSD, SunOS, AIX, Arduino, Neutrino]
+arch_target: [x86, x86_64, ppc32be, ppc32, ppc64le, ppc64, armv5el, armv5hf, armv6, armv7, armv7hf, armv7s, armv7k, armv8, armv8_32, armv8.3, sparc, sparcv9, mips, mips64, avr, s390, s390x, asm.js, wasm, sh4le]
+
+# Rest of the settings are "host" settings:
+# - For native building/cross building: Where the library/program will run.
+# - For building cross compilation tools: Where the cross compiler will run.
+os:
+    Windows:
+        subsystem: [None, cygwin, msys, msys2, wsl]
+    WindowsStore:
+        version: ["8.1", "10.0"]
+    WindowsCE:
+        platform: ANY
+        version: ["5.0", "6.0", "7.0", "8.0"]
+    Linux:
+    Macos:
+        version: [None, "10.6", "10.7", "10.8", "10.9", "10.10", "10.11", "10.12", "10.13", "10.14"]
+    Android:
+        api_level: ANY
+    iOS:
+        version: ["7.0", "7.1", "8.0", "8.1", "8.2", "8.3", "9.0", "9.1", "9.2", "9.3", "10.0", "10.1", "10.2", "10.3", "11.0", "11.1", "11.2", "11.3", "11.4", "12.0", "12.1"]
+    watchOS:
+        version: ["4.0", "4.1", "4.2", "4.3", "5.0", "5.1"]
+    tvOS:
+        version: ["11.0", "11.1", "11.2", "11.3", "11.4", "12.0", "12.1"]
+    FreeBSD:
+    SunOS:
+    AIX:
+    Arduino:
+        board: ANY
+    Emscripten:
+    Neutrino:
+        version: ["6.4", "6.5", "6.6", "7.0"]
+arch: [x86, x86_64, ppc32be, ppc32, ppc64le, ppc64, armv4, armv4i, armv5el, armv5hf, armv6, armv7, armv7hf, armv7s, armv7k, armv8, armv8_32, armv8.3, sparc, sparcv9, mips, mips64, avr, s390, s390x, asm.js, wasm, sh4le]
+compiler:
+    sun-cc:
+        version: ["5.10", "5.11", "5.12", "5.13", "5.14"]
+        threads: [None, posix]
+        libcxx: [libCstd, libstdcxx, libstlport, libstdc++]
+    gcc:
+        version: ["4.1", "4.4", "4.5", "4.6", "4.7", "4.8", "4.9",
+                  "5", "5.1", "5.2", "5.3", "5.4", "5.5",
+                  "6", "6.1", "6.2", "6.3", "6.4",
+                  "7", "7.1", "7.2", "7.3",
+                  "8", "8.1", "8.2", "8.3",
+                  "9", "9.1"]
+        libcxx: [libstdc++, libstdc++11]
+        threads: [None, posix, win32] #  Windows MinGW
+        exception: [None, dwarf2, sjlj, seh] # Windows MinGW
+        cppstd: [None, 98, gnu98, 11, gnu11, 14, gnu14, 17, gnu17, 20, gnu20]
+    Visual Studio:
+        runtime: [MD, MT, MTd, MDd]
+        version: ["8", "9", "10", "11", "12", "14", "15", "16"]
+        toolset: [None, v90, v100, v110, v110_xp, v120, v120_xp,
+                  v140, v140_xp, v140_clang_c2, LLVM-vs2012, LLVM-vs2012_xp,
+                  LLVM-vs2013, LLVM-vs2013_xp, LLVM-vs2014, LLVM-vs2014_xp,
+                  LLVM-vs2017, LLVM-vs2017_xp, v141, v141_xp, v141_clang_c2, v142]
+        cppstd: [None, 14, 17, 20]
+    clang:
+        version: ["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"]
+        libcxx: [libstdc++, libstdc++11, libc++, c++_shared, c++_static]
+        cppstd: [None, 98, gnu98, 11, gnu11, 14, gnu14, 17, gnu17, 20, gnu20]
+    apple-clang:
+        version: ["5.0", "5.1", "6.0", "6.1", "7.0", "7.3", "8.0", "8.1", "9.0", "9.1", "10.0", "11.0"]
+        libcxx: [libstdc++, libc++]
+        cppstd: [None, 98, gnu98, 11, gnu11, 14, gnu14, 17, gnu17, 20, gnu20]
+    qcc:
+        version: ["4.4", "5.4"]
+        libcxx: [cxx, gpp, cpp, cpp-ne, accp, acpp-ne, ecpp, ecpp-ne]
+
+build_type: [None, Debug, Release, RelWithDebInfo, MinSizeRel]
+cppstd: [None, 98, gnu98, 11, gnu11, 14, gnu14, 17, gnu17, 20, gnu20]  # Deprecated, use compiler.cppstd
+"""


Test patch: