We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN 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***
```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `conans/client/conf/detect.py`
Content:
```
1 import os
2 import platform
3 import re
4 from subprocess import Popen, PIPE, STDOUT
5 
6 from conans.client.output import Color
7 from conans.model.version import Version
8 from conans.tools import vs_installation_path
9 
10 
11 def _execute(command):
12     proc = Popen(command, shell=True, bufsize=1, stdout=PIPE, stderr=STDOUT)
13 
14     output_buffer = []
15     while True:
16         line = proc.stdout.readline()
17         if not line:
18             break
19         # output.write(line)
20         output_buffer.append(str(line))
21 
22     proc.communicate()
23     return proc.returncode, "".join(output_buffer)
24 
25 
26 def _gcc_compiler(output, compiler_exe="gcc"):
27 
28     try:
29         if platform.system() == "Darwin":
30             # In Mac OS X check if gcc is a fronted using apple-clang
31             _, out = _execute("%s --version" % compiler_exe)
32             out = out.lower()
33             if "clang" in out:
34                 return None
35 
36         _, out = _execute('%s -dumpversion' % compiler_exe)
37         compiler = "gcc"
38         installed_version = re.search("([0-9](\.[0-9])?)", out).group()
39         # Since GCC 7.1, -dumpversion return the major version number
40         # only ("7"). We must use -dumpfullversion to get the full version
41         # number ("7.1.1").
42         if installed_version:
43             output.success("Found %s %s" % (compiler, installed_version))
44             major = installed_version.split(".")[0]
45             if int(major) >= 5:
46                 output.info("gcc>=5, using the major as version")
47                 installed_version = major
48             return compiler, installed_version
49     except:
50         return None
51 
52 
53 def _clang_compiler(output, compiler_exe="clang"):
54     try:
55         _, out = _execute('%s --version' % compiler_exe)
56         if "Apple" in out:
57             compiler = "apple-clang"
58         elif "clang version" in out:
59             compiler = "clang"
60         installed_version = re.search("([0-9]\.[0-9])", out).group()
61         if installed_version:
62             output.success("Found %s %s" % (compiler, installed_version))
63             return compiler, installed_version
64     except:
65         return None
66 
67 
68 def _visual_compiler_cygwin(output, version):
69     if os.path.isfile("/proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/ProgramFilesDir (x86)"):
70         is_64bits = True
71     else:
72         is_64bits = False
73 
74     if is_64bits:
75         key_name = r'HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VC7'
76     else:
77         key_name = r'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\SxS\VC7'
78 
79     if not os.path.isfile("/proc/registry/" + key_name.replace('\\', '/') + "/" + version):
80         return None
81 
82     installed_version = Version(version).major(fill=False)
83     compiler = "Visual Studio"
84     output.success("CYGWIN: Found %s %s" % (compiler, installed_version))
85     return compiler, installed_version
86 
87 
88 def _visual_compiler(output, version):
89     'version have to be 8.0, or 9.0 or... anything .0'
90     if platform.system().startswith("CYGWIN"):
91         return _visual_compiler_cygwin(output, version)
92 
93     if version == "15":
94         vs_path = os.getenv('vs150comntools')
95         path = vs_path or vs_installation_path("15")
96         if path:
97             compiler = "Visual Studio"
98             output.success("Found %s %s" % (compiler, "15"))
99             return compiler, "15"
100         return None
101 
102     version = "%s.0" % version
103     from six.moves import winreg  # @UnresolvedImport
104     try:
105         hKey = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE,
106                               r"SOFTWARE\Microsoft\Windows\CurrentVersion")
107         winreg.QueryValueEx(hKey, "ProgramFilesDir (x86)")
108         is_64bits = True
109     except EnvironmentError:
110         is_64bits = False
111     finally:
112         winreg.CloseKey(hKey)
113 
114     if is_64bits:
115         key_name = r'SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VC7'
116     else:
117         key_name = r'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\SxS\VC7'
118 
119     try:
120         key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, key_name)
121         winreg.QueryValueEx(key, version)
122 
123         installed_version = Version(version).major(fill=False)
124         compiler = "Visual Studio"
125         output.success("Found %s %s" % (compiler, installed_version))
126         return compiler, installed_version
127     except EnvironmentError:
128         return None
129 
130 
131 def _visual_compiler_last(output):
132     last_version = None
133     for version in ["8", "9", "10", "11", "12", "14", "15"]:
134         vs = _visual_compiler(output, version)
135         last_version = vs or last_version
136     return last_version
137 
138 
139 def _sun_cc_compiler(output, compiler_exe="cc"):
140     try:
141         _, out = _execute('%s -V' % compiler_exe)
142         compiler = "sun-cc"
143         installed_version = re.search("([0-9]+\.[0-9]+)", out).group()
144         if installed_version:
145             output.success("Found %s %s" % (compiler, installed_version))
146             return compiler, installed_version
147     except:
148         return None
149 
150 
151 def _get_default_compiler(output):
152     cc = os.environ.get("CC", "")
153     cxx = os.environ.get("CXX", "")
154     if cc or cxx:  # Env defined, use them
155         output.info("CC and CXX: %s, %s " % (cc or "None", cxx or "None"))
156         command = cc or cxx
157         if "gcc" in command:
158             gcc = _gcc_compiler(output, command)
159             if platform.system() == "Darwin" and gcc is None:
160                 output.error(
161                     "%s detected as a frontend using apple-clang. Compiler not supported" % command
162                 )
163             return gcc
164         if "clang" in command.lower():
165             return _clang_compiler(output, command)
166         if platform.system() == "SunOS" and command.lower() == "cc":
167             return _sun_cc_compiler(output, command)
168         # I am not able to find its version
169         output.error("Not able to automatically detect '%s' version" % command)
170         return None
171 
172     if detected_os() == "Windows":
173         vs = _visual_compiler_last(output)
174     gcc = _gcc_compiler(output)
175     clang = _clang_compiler(output)
176     if platform.system() == "SunOS":
177         sun_cc = _sun_cc_compiler(output)
178 
179     if detected_os() == "Windows":
180         return vs or gcc or clang
181     elif platform.system() == "Darwin":
182         return clang or gcc
183     elif platform.system() == "SunOS":
184         return sun_cc or gcc or clang
185     else:
186         return gcc or clang
187 
188 
189 def _detect_compiler_version(result, output):
190     try:
191         compiler, version = _get_default_compiler(output)
192     except:
193         compiler, version = None, None
194     if not compiler or not version:
195         output.error("Unable to find a working compiler")
196     else:
197         result.append(("compiler", compiler))
198         result.append(("compiler.version", version))
199         if compiler == "apple-clang":
200             result.append(("compiler.libcxx", "libc++"))
201         elif compiler == "gcc":
202             result.append(("compiler.libcxx", "libstdc++"))
203             if Version(version) >= Version("5.1"):
204 
205                 msg = """
206 Conan detected a GCC version > 5 but has adjusted the 'compiler.libcxx' setting to
207 'libstdc++' for backwards compatibility.
208 Your compiler is likely using the new CXX11 ABI by default (libstdc++11).
209 
210 If you want Conan to use the new ABI, edit the default profile at:
211 
212     ~/.conan/profiles/default
213 
214 adjusting 'compiler.libcxx=libstdc++11'
215 """
216                 output.writeln("\n************************* WARNING: GCC OLD ABI COMPATIBILITY "
217                                "***********************\n %s\n************************************"
218                                "************************************************\n\n\n" % msg,
219                                Color.BRIGHT_RED)
220         elif compiler == "cc":
221             if platform.system() == "SunOS":
222                 result.append(("compiler.libstdcxx", "libstdcxx4"))
223         elif compiler == "clang":
224             if platform.system() == "FreeBSD":
225                 result.append(("compiler.libcxx", "libc++"))
226             else:
227                 result.append(("compiler.libcxx", "libstdc++"))
228         elif compiler == "sun-cc":
229             result.append(("compiler.libcxx", "libCstd"))
230 
231 
232 def detected_os():
233     result = platform.system()
234     if result == "Darwin":
235         return "Macos"
236     if result.startswith("CYGWIN"):
237         return "Windows"
238     if result.startswith("MINGW32_NT") or result.startswith("MINGW64_NT"):
239         return "Windows"
240     if result.startswith("MSYS_NT"):
241         return "Windows"
242     return result
243 
244 
245 def _detect_os_arch(result, output):
246     architectures = {'i386': 'x86',
247                      'i686': 'x86',
248                      'i86pc': 'x86',
249                      'amd64': 'x86_64',
250                      'aarch64': 'armv8',
251                      'sun4v': 'sparc'}
252     the_os = detected_os()
253     result.append(("os", the_os))
254     result.append(("os_build", the_os))
255     arch = architectures.get(platform.machine().lower(), platform.machine().lower())
256     if arch.startswith('arm'):
257         for a in ("armv6", "armv7hf", "armv7", "armv8"):
258             if arch.startswith(a):
259                 arch = a
260                 break
261         else:
262             output.error("Your ARM '%s' architecture is probably not defined in settings.yml\n"
263                          "Please check your conan.conf and settings.yml files" % arch)
264     result.append(("arch", arch))
265     result.append(("arch_build", arch))
266 
267 
268 def detect_defaults_settings(output):
269     """ try to deduce current machine values without any constraints at all
270     """
271     result = []
272     _detect_os_arch(result, output)
273     _detect_compiler_version(result, output)
274     result.append(("build_type", "Release"))
275 
276     return result
277
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

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 @@
             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 _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:

{"golden_diff": "diff --git a/conans/client/conf/detect.py b/conans/client/conf/detect.py\n--- a/conans/client/conf/detect.py\n+++ b/conans/client/conf/detect.py\n@@ -33,7 +33,9 @@\n             if \"clang\" in out:\n                 return None\n \n-        _, out = _execute('%s -dumpversion' % compiler_exe)\n+        ret, out = _execute('%s -dumpversion' % compiler_exe)\n+        if ret != 0:\n+            return None\n         compiler = \"gcc\"\n         installed_version = re.search(\"([0-9](\\.[0-9])?)\", out).group()\n         # Since GCC 7.1, -dumpversion return the major version number\n@@ -52,7 +54,9 @@\n \n def _clang_compiler(output, compiler_exe=\"clang\"):\n     try:\n-        _, out = _execute('%s --version' % compiler_exe)\n+        ret, out = _execute('%s --version' % compiler_exe)\n+        if ret != 0:\n+            return None\n         if \"Apple\" in out:\n             compiler = \"apple-clang\"\n         elif \"clang version\" in out:\n", "issue": "why does conan detect gcc 1 ?\nThis is running in a docker linux container, clang 6 is installed. gcc is not.\r\n\r\n```bash\r\n`[openssl] $ sh -c \"conan create -s build_type=Debug -s compiler=clang -s compiler.libcxx=libstdc++11 -s compiler.version=6.0 . turboit/openssl \"\r\nOpenSSL/1.0.2o@turboit/openssl: Exporting package recipe\r\nLinter warnings\r\n    WARN: Linter. Line 101: Anomalous backslash in string: '\\$'. String constant might be missing an r prefix.\r\n    WARN: Linter. Line 101: Anomalous backslash in string: '\\$'. String constant might be missing an r prefix.\r\n    WARN: Linter. Line 101: Anomalous backslash in string: '\\$'. String constant might be missing an r prefix.\r\n    WARN: Linter. Line 101: Anomalous backslash in string: '\\$'. String constant might be missing an r prefix.\r\n    WARN: Linter. Line 102: Anomalous backslash in string: '\\$'. String constant might be missing an r prefix.\r\n    WARN: Linter. Line 102: Anomalous backslash in string: '\\$'. String constant might be missing an r prefix.\r\n\r\nOpenSSL/1.0.2o@turboit/openssl: A new conanfile.py version was exported\r\n\r\nOpenSSL/1.0.2o@turboit/openssl: Folder: /root/workspace/conan/openssl@tmp/conan.tmp6052754136315568067/.conan/data/OpenSSL/1.0.2o/turboit/openssl/export\r\n\r\nAuto detecting your dev setup to initialize the default profile (/root/workspace/conan/openssl@tmp/conan.tmp6052754136315568067/.conan/profiles/default)\r\n\r\nFound gcc 1\r\nFound clang 6.0\r\nDefault settings\r\n\tos=Linux\r\n\tos_build=Linux\r\n\tarch=x86_64\r\n\tarch_build=x86_64\r\n\tcompiler=gcc\r\n\tcompiler.version=1\r\n\tcompiler.libcxx=libstdc++\r\n\tbuild_type=Release\r\n\r\n*** You can change them in /root/workspace/conan/openssl@tmp/conan.tmp6052754136315568067/.conan/profiles/default ***\r\n\r\n*** Or override with -s compiler='other' -s ...s***\r\n```\n", "before_files": [{"content": "import os\nimport platform\nimport re\nfrom subprocess import Popen, PIPE, STDOUT\n\nfrom conans.client.output import Color\nfrom conans.model.version import Version\nfrom conans.tools import vs_installation_path\n\n\ndef _execute(command):\n    proc = Popen(command, shell=True, bufsize=1, stdout=PIPE, stderr=STDOUT)\n\n    output_buffer = []\n    while True:\n        line = proc.stdout.readline()\n        if not line:\n            break\n        # output.write(line)\n        output_buffer.append(str(line))\n\n    proc.communicate()\n    return proc.returncode, \"\".join(output_buffer)\n\n\ndef _gcc_compiler(output, compiler_exe=\"gcc\"):\n\n    try:\n        if platform.system() == \"Darwin\":\n            # In Mac OS X check if gcc is a fronted using apple-clang\n            _, out = _execute(\"%s --version\" % compiler_exe)\n            out = out.lower()\n            if \"clang\" in out:\n                return None\n\n        _, out = _execute('%s -dumpversion' % compiler_exe)\n        compiler = \"gcc\"\n        installed_version = re.search(\"([0-9](\\.[0-9])?)\", out).group()\n        # Since GCC 7.1, -dumpversion return the major version number\n        # only (\"7\"). We must use -dumpfullversion to get the full version\n        # number (\"7.1.1\").\n        if installed_version:\n            output.success(\"Found %s %s\" % (compiler, installed_version))\n            major = installed_version.split(\".\")[0]\n            if int(major) >= 5:\n                output.info(\"gcc>=5, using the major as version\")\n                installed_version = major\n            return compiler, installed_version\n    except:\n        return None\n\n\ndef _clang_compiler(output, compiler_exe=\"clang\"):\n    try:\n        _, out = _execute('%s --version' % compiler_exe)\n        if \"Apple\" in out:\n            compiler = \"apple-clang\"\n        elif \"clang version\" in out:\n            compiler = \"clang\"\n        installed_version = re.search(\"([0-9]\\.[0-9])\", out).group()\n        if installed_version:\n            output.success(\"Found %s %s\" % (compiler, installed_version))\n            return compiler, installed_version\n    except:\n        return None\n\n\ndef _visual_compiler_cygwin(output, version):\n    if os.path.isfile(\"/proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/ProgramFilesDir (x86)\"):\n        is_64bits = True\n    else:\n        is_64bits = False\n\n    if is_64bits:\n        key_name = r'HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VC7'\n    else:\n        key_name = r'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7'\n\n    if not os.path.isfile(\"/proc/registry/\" + key_name.replace('\\\\', '/') + \"/\" + version):\n        return None\n\n    installed_version = Version(version).major(fill=False)\n    compiler = \"Visual Studio\"\n    output.success(\"CYGWIN: Found %s %s\" % (compiler, installed_version))\n    return compiler, installed_version\n\n\ndef _visual_compiler(output, version):\n    'version have to be 8.0, or 9.0 or... anything .0'\n    if platform.system().startswith(\"CYGWIN\"):\n        return _visual_compiler_cygwin(output, version)\n\n    if version == \"15\":\n        vs_path = os.getenv('vs150comntools')\n        path = vs_path or vs_installation_path(\"15\")\n        if path:\n            compiler = \"Visual Studio\"\n            output.success(\"Found %s %s\" % (compiler, \"15\"))\n            return compiler, \"15\"\n        return None\n\n    version = \"%s.0\" % version\n    from six.moves import winreg  # @UnresolvedImport\n    try:\n        hKey = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE,\n                              r\"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\")\n        winreg.QueryValueEx(hKey, \"ProgramFilesDir (x86)\")\n        is_64bits = True\n    except EnvironmentError:\n        is_64bits = False\n    finally:\n        winreg.CloseKey(hKey)\n\n    if is_64bits:\n        key_name = r'SOFTWARE\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VC7'\n    else:\n        key_name = r'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7'\n\n    try:\n        key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, key_name)\n        winreg.QueryValueEx(key, version)\n\n        installed_version = Version(version).major(fill=False)\n        compiler = \"Visual Studio\"\n        output.success(\"Found %s %s\" % (compiler, installed_version))\n        return compiler, installed_version\n    except EnvironmentError:\n        return None\n\n\ndef _visual_compiler_last(output):\n    last_version = None\n    for version in [\"8\", \"9\", \"10\", \"11\", \"12\", \"14\", \"15\"]:\n        vs = _visual_compiler(output, version)\n        last_version = vs or last_version\n    return last_version\n\n\ndef _sun_cc_compiler(output, compiler_exe=\"cc\"):\n    try:\n        _, out = _execute('%s -V' % compiler_exe)\n        compiler = \"sun-cc\"\n        installed_version = re.search(\"([0-9]+\\.[0-9]+)\", out).group()\n        if installed_version:\n            output.success(\"Found %s %s\" % (compiler, installed_version))\n            return compiler, installed_version\n    except:\n        return None\n\n\ndef _get_default_compiler(output):\n    cc = os.environ.get(\"CC\", \"\")\n    cxx = os.environ.get(\"CXX\", \"\")\n    if cc or cxx:  # Env defined, use them\n        output.info(\"CC and CXX: %s, %s \" % (cc or \"None\", cxx or \"None\"))\n        command = cc or cxx\n        if \"gcc\" in command:\n            gcc = _gcc_compiler(output, command)\n            if platform.system() == \"Darwin\" and gcc is None:\n                output.error(\n                    \"%s detected as a frontend using apple-clang. Compiler not supported\" % command\n                )\n            return gcc\n        if \"clang\" in command.lower():\n            return _clang_compiler(output, command)\n        if platform.system() == \"SunOS\" and command.lower() == \"cc\":\n            return _sun_cc_compiler(output, command)\n        # I am not able to find its version\n        output.error(\"Not able to automatically detect '%s' version\" % command)\n        return None\n\n    if detected_os() == \"Windows\":\n        vs = _visual_compiler_last(output)\n    gcc = _gcc_compiler(output)\n    clang = _clang_compiler(output)\n    if platform.system() == \"SunOS\":\n        sun_cc = _sun_cc_compiler(output)\n\n    if detected_os() == \"Windows\":\n        return vs or gcc or clang\n    elif platform.system() == \"Darwin\":\n        return clang or gcc\n    elif platform.system() == \"SunOS\":\n        return sun_cc or gcc or clang\n    else:\n        return gcc or clang\n\n\ndef _detect_compiler_version(result, output):\n    try:\n        compiler, version = _get_default_compiler(output)\n    except:\n        compiler, version = None, None\n    if not compiler or not version:\n        output.error(\"Unable to find a working compiler\")\n    else:\n        result.append((\"compiler\", compiler))\n        result.append((\"compiler.version\", version))\n        if compiler == \"apple-clang\":\n            result.append((\"compiler.libcxx\", \"libc++\"))\n        elif compiler == \"gcc\":\n            result.append((\"compiler.libcxx\", \"libstdc++\"))\n            if Version(version) >= Version(\"5.1\"):\n\n                msg = \"\"\"\nConan detected a GCC version > 5 but has adjusted the 'compiler.libcxx' setting to\n'libstdc++' for backwards compatibility.\nYour compiler is likely using the new CXX11 ABI by default (libstdc++11).\n\nIf you want Conan to use the new ABI, edit the default profile at:\n\n    ~/.conan/profiles/default\n\nadjusting 'compiler.libcxx=libstdc++11'\n\"\"\"\n                output.writeln(\"\\n************************* WARNING: GCC OLD ABI COMPATIBILITY \"\n                               \"***********************\\n %s\\n************************************\"\n                               \"************************************************\\n\\n\\n\" % msg,\n                               Color.BRIGHT_RED)\n        elif compiler == \"cc\":\n            if platform.system() == \"SunOS\":\n                result.append((\"compiler.libstdcxx\", \"libstdcxx4\"))\n        elif compiler == \"clang\":\n            if platform.system() == \"FreeBSD\":\n                result.append((\"compiler.libcxx\", \"libc++\"))\n            else:\n                result.append((\"compiler.libcxx\", \"libstdc++\"))\n        elif compiler == \"sun-cc\":\n            result.append((\"compiler.libcxx\", \"libCstd\"))\n\n\ndef detected_os():\n    result = platform.system()\n    if result == \"Darwin\":\n        return \"Macos\"\n    if result.startswith(\"CYGWIN\"):\n        return \"Windows\"\n    if result.startswith(\"MINGW32_NT\") or result.startswith(\"MINGW64_NT\"):\n        return \"Windows\"\n    if result.startswith(\"MSYS_NT\"):\n        return \"Windows\"\n    return result\n\n\ndef _detect_os_arch(result, output):\n    architectures = {'i386': 'x86',\n                     'i686': 'x86',\n                     'i86pc': 'x86',\n                     'amd64': 'x86_64',\n                     'aarch64': 'armv8',\n                     'sun4v': 'sparc'}\n    the_os = detected_os()\n    result.append((\"os\", the_os))\n    result.append((\"os_build\", the_os))\n    arch = architectures.get(platform.machine().lower(), platform.machine().lower())\n    if arch.startswith('arm'):\n        for a in (\"armv6\", \"armv7hf\", \"armv7\", \"armv8\"):\n            if arch.startswith(a):\n                arch = a\n                break\n        else:\n            output.error(\"Your ARM '%s' architecture is probably not defined in settings.yml\\n\"\n                         \"Please check your conan.conf and settings.yml files\" % arch)\n    result.append((\"arch\", arch))\n    result.append((\"arch_build\", arch))\n\n\ndef detect_defaults_settings(output):\n    \"\"\" try to deduce current machine values without any constraints at all\n    \"\"\"\n    result = []\n    _detect_os_arch(result, output)\n    _detect_compiler_version(result, output)\n    result.append((\"build_type\", \"Release\"))\n\n    return result\n", "path": "conans/client/conf/detect.py"}], "after_files": [{"content": "import os\nimport platform\nimport re\nfrom subprocess import Popen, PIPE, STDOUT\n\nfrom conans.client.output import Color\nfrom conans.model.version import Version\nfrom conans.tools import vs_installation_path\n\n\ndef _execute(command):\n    proc = Popen(command, shell=True, bufsize=1, stdout=PIPE, stderr=STDOUT)\n\n    output_buffer = []\n    while True:\n        line = proc.stdout.readline()\n        if not line:\n            break\n        # output.write(line)\n        output_buffer.append(str(line))\n\n    proc.communicate()\n    return proc.returncode, \"\".join(output_buffer)\n\n\ndef _gcc_compiler(output, compiler_exe=\"gcc\"):\n\n    try:\n        if platform.system() == \"Darwin\":\n            # In Mac OS X check if gcc is a fronted using apple-clang\n            _, out = _execute(\"%s --version\" % compiler_exe)\n            out = out.lower()\n            if \"clang\" in out:\n                return None\n\n        ret, out = _execute('%s -dumpversion' % compiler_exe)\n        if ret != 0:\n            return None\n        compiler = \"gcc\"\n        installed_version = re.search(\"([0-9](\\.[0-9])?)\", out).group()\n        # Since GCC 7.1, -dumpversion return the major version number\n        # only (\"7\"). We must use -dumpfullversion to get the full version\n        # number (\"7.1.1\").\n        if installed_version:\n            output.success(\"Found %s %s\" % (compiler, installed_version))\n            major = installed_version.split(\".\")[0]\n            if int(major) >= 5:\n                output.info(\"gcc>=5, using the major as version\")\n                installed_version = major\n            return compiler, installed_version\n    except:\n        return None\n\n\ndef _clang_compiler(output, compiler_exe=\"clang\"):\n    try:\n        ret, out = _execute('%s --version' % compiler_exe)\n        if ret != 0:\n            return None\n        if \"Apple\" in out:\n            compiler = \"apple-clang\"\n        elif \"clang version\" in out:\n            compiler = \"clang\"\n        installed_version = re.search(\"([0-9]\\.[0-9])\", out).group()\n        if installed_version:\n            output.success(\"Found %s %s\" % (compiler, installed_version))\n            return compiler, installed_version\n    except:\n        return None\n\n\ndef _visual_compiler_cygwin(output, version):\n    if os.path.isfile(\"/proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/ProgramFilesDir (x86)\"):\n        is_64bits = True\n    else:\n        is_64bits = False\n\n    if is_64bits:\n        key_name = r'HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VC7'\n    else:\n        key_name = r'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7'\n\n    if not os.path.isfile(\"/proc/registry/\" + key_name.replace('\\\\', '/') + \"/\" + version):\n        return None\n\n    installed_version = Version(version).major(fill=False)\n    compiler = \"Visual Studio\"\n    output.success(\"CYGWIN: Found %s %s\" % (compiler, installed_version))\n    return compiler, installed_version\n\n\ndef _visual_compiler(output, version):\n    'version have to be 8.0, or 9.0 or... anything .0'\n    if platform.system().startswith(\"CYGWIN\"):\n        return _visual_compiler_cygwin(output, version)\n\n    if version == \"15\":\n        vs_path = os.getenv('vs150comntools')\n        path = vs_path or vs_installation_path(\"15\")\n        if path:\n            compiler = \"Visual Studio\"\n            output.success(\"Found %s %s\" % (compiler, \"15\"))\n            return compiler, \"15\"\n        return None\n\n    version = \"%s.0\" % version\n    from six.moves import winreg  # @UnresolvedImport\n    try:\n        hKey = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE,\n                              r\"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\")\n        winreg.QueryValueEx(hKey, \"ProgramFilesDir (x86)\")\n        is_64bits = True\n    except EnvironmentError:\n        is_64bits = False\n    finally:\n        winreg.CloseKey(hKey)\n\n    if is_64bits:\n        key_name = r'SOFTWARE\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VC7'\n    else:\n        key_name = r'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7'\n\n    try:\n        key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, key_name)\n        winreg.QueryValueEx(key, version)\n\n        installed_version = Version(version).major(fill=False)\n        compiler = \"Visual Studio\"\n        output.success(\"Found %s %s\" % (compiler, installed_version))\n        return compiler, installed_version\n    except EnvironmentError:\n        return None\n\n\ndef _visual_compiler_last(output):\n    last_version = None\n    for version in [\"8\", \"9\", \"10\", \"11\", \"12\", \"14\", \"15\"]:\n        vs = _visual_compiler(output, version)\n        last_version = vs or last_version\n    return last_version\n\n\ndef _sun_cc_compiler(output, compiler_exe=\"cc\"):\n    try:\n        _, out = _execute('%s -V' % compiler_exe)\n        compiler = \"sun-cc\"\n        installed_version = re.search(\"([0-9]+\\.[0-9]+)\", out).group()\n        if installed_version:\n            output.success(\"Found %s %s\" % (compiler, installed_version))\n            return compiler, installed_version\n    except:\n        return None\n\n\ndef _get_default_compiler(output):\n    cc = os.environ.get(\"CC\", \"\")\n    cxx = os.environ.get(\"CXX\", \"\")\n    if cc or cxx:  # Env defined, use them\n        output.info(\"CC and CXX: %s, %s \" % (cc or \"None\", cxx or \"None\"))\n        command = cc or cxx\n        if \"gcc\" in command:\n            gcc = _gcc_compiler(output, command)\n            if platform.system() == \"Darwin\" and gcc is None:\n                output.error(\n                    \"%s detected as a frontend using apple-clang. Compiler not supported\" % command\n                )\n            return gcc\n        if \"clang\" in command.lower():\n            return _clang_compiler(output, command)\n        if platform.system() == \"SunOS\" and command.lower() == \"cc\":\n            return _sun_cc_compiler(output, command)\n        # I am not able to find its version\n        output.error(\"Not able to automatically detect '%s' version\" % command)\n        return None\n\n    if detected_os() == \"Windows\":\n        vs = _visual_compiler_last(output)\n    gcc = _gcc_compiler(output)\n    clang = _clang_compiler(output)\n    if platform.system() == \"SunOS\":\n        sun_cc = _sun_cc_compiler(output)\n\n    if detected_os() == \"Windows\":\n        return vs or gcc or clang\n    elif platform.system() == \"Darwin\":\n        return clang or gcc\n    elif platform.system() == \"SunOS\":\n        return sun_cc or gcc or clang\n    else:\n        return gcc or clang\n\n\ndef _detect_compiler_version(result, output):\n    try:\n        compiler, version = _get_default_compiler(output)\n    except:\n        compiler, version = None, None\n    if not compiler or not version:\n        output.error(\"Unable to find a working compiler\")\n    else:\n        result.append((\"compiler\", compiler))\n        result.append((\"compiler.version\", version))\n        if compiler == \"apple-clang\":\n            result.append((\"compiler.libcxx\", \"libc++\"))\n        elif compiler == \"gcc\":\n            result.append((\"compiler.libcxx\", \"libstdc++\"))\n            if Version(version) >= Version(\"5.1\"):\n\n                msg = \"\"\"\nConan detected a GCC version > 5 but has adjusted the 'compiler.libcxx' setting to\n'libstdc++' for backwards compatibility.\nYour compiler is likely using the new CXX11 ABI by default (libstdc++11).\n\nIf you want Conan to use the new ABI, edit the default profile at:\n\n    ~/.conan/profiles/default\n\nadjusting 'compiler.libcxx=libstdc++11'\n\"\"\"\n                output.writeln(\"\\n************************* WARNING: GCC OLD ABI COMPATIBILITY \"\n                               \"***********************\\n %s\\n************************************\"\n                               \"************************************************\\n\\n\\n\" % msg,\n                               Color.BRIGHT_RED)\n        elif compiler == \"cc\":\n            if platform.system() == \"SunOS\":\n                result.append((\"compiler.libstdcxx\", \"libstdcxx4\"))\n        elif compiler == \"clang\":\n            if platform.system() == \"FreeBSD\":\n                result.append((\"compiler.libcxx\", \"libc++\"))\n            else:\n                result.append((\"compiler.libcxx\", \"libstdc++\"))\n        elif compiler == \"sun-cc\":\n            result.append((\"compiler.libcxx\", \"libCstd\"))\n\n\ndef detected_os():\n    result = platform.system()\n    if result == \"Darwin\":\n        return \"Macos\"\n    if result.startswith(\"CYGWIN\"):\n        return \"Windows\"\n    if result.startswith(\"MINGW32_NT\") or result.startswith(\"MINGW64_NT\"):\n        return \"Windows\"\n    if result.startswith(\"MSYS_NT\"):\n        return \"Windows\"\n    return result\n\n\ndef _detect_os_arch(result, output):\n    architectures = {'i386': 'x86',\n                     'i686': 'x86',\n                     'i86pc': 'x86',\n                     'amd64': 'x86_64',\n                     'aarch64': 'armv8',\n                     'sun4v': 'sparc'}\n    the_os = detected_os()\n    result.append((\"os\", the_os))\n    result.append((\"os_build\", the_os))\n    arch = architectures.get(platform.machine().lower(), platform.machine().lower())\n    if arch.startswith('arm'):\n        for a in (\"armv6\", \"armv7hf\", \"armv7\", \"armv8\"):\n            if arch.startswith(a):\n                arch = a\n                break\n        else:\n            output.error(\"Your ARM '%s' architecture is probably not defined in settings.yml\\n\"\n                         \"Please check your conan.conf and settings.yml files\" % arch)\n    result.append((\"arch\", arch))\n    result.append((\"arch_build\", arch))\n\n\ndef detect_defaults_settings(output):\n    \"\"\" try to deduce current machine values without any constraints at all\n    \"\"\"\n    result = []\n    _detect_os_arch(result, output)\n    _detect_compiler_version(result, output)\n    result.append((\"build_type\", \"Release\"))\n\n    return result\n", "path": "conans/client/conf/detect.py"}]}