Repository: conan-io/conan

Issue:
why does conan detect gcc 1 ?
This is running in a docker linux container, clang 6 is installed. gcc is not.

```bash
`[openssl] $ sh -c "conan create -s build_type=Debug -s compiler=clang -s compiler.libcxx=libstdc++11 -s compiler.version=6.0 . turboit/openssl "
OpenSSL/1.0.2o@turboit/openssl: Exporting package recipe
Linter warnings
    WARN: Linter. Line 101: Anomalous backslash in string: '\$'. String constant might be missing an r prefix.
    WARN: Linter. Line 101: Anomalous backslash in string: '\$'. String constant might be missing an r prefix.
    WARN: Linter. Line 101: Anomalous backslash in string: '\$'. String constant might be missing an r prefix.
    WARN: Linter. Line 101: Anomalous backslash in string: '\$'. String constant might be missing an r prefix.
    WARN: Linter. Line 102: Anomalous backslash in string: '\$'. String constant might be missing an r prefix.
    WARN: Linter. Line 102: Anomalous backslash in string: '\$'. String constant might be missing an r prefix.

OpenSSL/1.0.2o@turboit/openssl: A new conanfile.py version was exported

OpenSSL/1.0.2o@turboit/openssl: Folder: /root/workspace/conan/openssl@tmp/conan.tmp6052754136315568067/.conan/data/OpenSSL/1.0.2o/turboit/openssl/export

Auto detecting your dev setup to initialize the default profile (/root/workspace/conan/openssl@tmp/conan.tmp6052754136315568067/.conan/profiles/default)

Found gcc 1
Found clang 6.0
Default settings
	os=Linux
	os_build=Linux
	arch=x86_64
	arch_build=x86_64
	compiler=gcc
	compiler.version=1
	compiler.libcxx=libstdc++
	build_type=Release

*** You can change them in /root/workspace/conan/openssl@tmp/conan.tmp6052754136315568067/.conan/profiles/default ***

*** Or override with -s compiler='other' -s ...s***
```


Discussion:
it works fine if i set 

export CC=/usr/bin/clang
export CXX=/usr/bin/clang++

which I don't mind doing, it's quite easy via jenkins to set it on the docker container via the cloud plugin, i'm just trying to understand why conan isn't honouring the command line passed to it and why it's detecting gcc 1. It's caught me out a few times now
Could you please type ``gcc --version`` and ``gcc -dumpversion`` in your system and copy here the output?
root@a6faa521dc8c:~/conan-openssl# gcc --version
bash: gcc: command not found
root@a6faa521dc8c:~/conan-openssl# gcc -dumpversion
bash: gcc: command not found


Resolving patch:
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
@@ -33,7 +33,9 @@ def _gcc_compiler(output, compiler_exe="gcc"):
             if "clang" in out:
                 return None
 
-        _, out = _execute('%s -dumpversion' % compiler_exe)
+        ret, out = _execute('%s -dumpversion' % compiler_exe)
+        if ret != 0:
+            return None
         compiler = "gcc"
         installed_version = re.search("([0-9](\.[0-9])?)", out).group()
         # Since GCC 7.1, -dumpversion return the major version number
@@ -52,7 +54,9 @@ def _gcc_compiler(output, compiler_exe="gcc"):
 
 def _clang_compiler(output, compiler_exe="clang"):
     try:
-        _, out = _execute('%s --version' % compiler_exe)
+        ret, out = _execute('%s --version' % compiler_exe)
+        if ret != 0:
+            return None
         if "Apple" in out:
             compiler = "apple-clang"
         elif "clang version" in out:


Test patch: