internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: conan-io/conan

Issue:
ConfigureEnvironment: 'libstdc++11' is not a valid 'settings.compiler.libcxx' value on OS X
I've just updated to conan 0.8 with libcxx support and get this error:

``` python
## configure_environment.py ##
            # Append the definition for libcxx
            all_cpp_flags = copy.copy(self._deps_cpp_info.cppflags)
            if self.libcxx:
                tmp = "-D_GLIBCXX_USE_CXX11_ABI="
                tmp += "1" if self.libcxx == "libstdc++11" else "0" # Exception occurs here
                all_cpp_flags.append(tmp)
```

for (os x default) apple-clang compiler:

```
    apple-clang:
        version: ["5.0", "5.1", "6.0", "6.1", "7.0"]
        libcxx: [libstdc++, libc++]
```

on this (conanfile.py) code:

``` python
        env = ConfigureEnvironment(self.deps_cpp_info, self.settings)
        self.run("%s && ./configure --prefix=\"$PWD/install\" && make install" % env.command_line)
```



Discussion:
Yes, I'd say that libstdc++11 is not a valid setting for apple-clang. In apple-clang, you can choose between libstdc++ and libc++. You can check the default settings file: ~./conan/settings.yml

Please tell us if this is a mistake and it is indeed possible to use such setting, but up to my knowledge such libstdc++11 implementation is only available in gcc. If that makes sense to you, you can always edit the ~./conan/settings.yml and add such setting. Thanks!

@memsharded I'm not trying to use libstdc++11 on apple-clang. The problem is that ConfigureEnvironment is broken (produces exception) on apple-clang with default settings.yml.

In other words, on my (default) settings with [compiler=apple-clang and compiler.libcxx=libc++] ConfigureEnvironment.command_line() raise such exception.

Oh, sorry, I see now, I misunderstood. This seems a bug, indeed, I'll have a look asap. Thanks for reporting.


Resolving patch:
diff --git a/conans/client/configure_environment.py b/conans/client/configure_environment.py
--- a/conans/client/configure_environment.py
+++ b/conans/client/configure_environment.py
@@ -34,9 +34,16 @@ def command_line(self):
             # Append the definition for libcxx
             all_cpp_flags = copy.copy(self._deps_cpp_info.cppflags)
             if self.libcxx:
-                tmp = "-D_GLIBCXX_USE_CXX11_ABI="
-                tmp += "1" if self.libcxx == "libstdc++11" else "0"
-                all_cpp_flags.append(tmp)
+                if str(self.libcxx) == "libstdc++":
+                    all_cpp_flags.append("-D_GLIBCXX_USE_CXX11_ABI=0")
+                elif str(self.libcxx) == "libstdc++11":
+                    all_cpp_flags.append("-D_GLIBCXX_USE_CXX11_ABI=1")
+
+                if "clang" in str(self.compiler):
+                    if str(self.libcxx) == "libc++":
+                        all_cpp_flags.append("-stdlib=libc++")
+                    else:
+                        all_cpp_flags.append("-stdlib=libstdc++")
 
             cpp_flags = 'CPPFLAGS="%s %s"' % (archflag, " ".join(all_cpp_flags))
             include_paths = ":".join(['"%s"' % lib for lib in self._deps_cpp_info.include_paths])


Test patch:
Repository: conan-io/conan

Issue:
TypeError: startswith first arg must be bytes or a tuple of bytes, not str when installing on python3
As stated in the description, this error occurs when installing on python3.

```
Collecting conan-0.9.0 from http://github.com/conan-io/conan/archive/release/0.9.0.tar.gz#egg=conan-0.9.0
  Downloading http://github.com/conan-io/conan/archive/release/0.9.0.tar.gz (350kB)
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-_afor1qa/conan-0.9.0/setup.py", line 27, in <module>
        project_requirements = get_requires("conans/requirements.txt")
      File "/tmp/pip-build-_afor1qa/conan-0.9.0/setup.py", line 23, in get_requires
        if not line.strip().startswith("#"):
```



Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -18,7 +18,7 @@
 
 def get_requires(filename):
     requirements = []
-    with open(filename) as req_file:
+    with open(filename, "rt") as req_file:
         for line in req_file.read().splitlines():
             if not line.strip().startswith("#"):
                 requirements.append(line)


Test patch:
Repository: conan-io/conan

Issue:
Utilities to set MSVC environment from conanfiles
Not big issue, but something that handles the typical:

vcvars = 'call "%%vs140comntools%%../../VC/vcvarsall.bat" %s' % param

in conanfiles, for different MSVC versions, would be useful



Discussion:

Resolving patch:
diff --git a/conans/tools.py b/conans/tools.py
--- a/conans/tools.py
+++ b/conans/tools.py
@@ -11,11 +11,18 @@
 from conans.client.output import ConanOutput
 
 
+def vcvars_command(settings):
+    param = "x86" if settings.arch == "x86" else "amd64"
+    command = ('call "%%vs%s0comntools%%../../VC/vcvarsall.bat" %s'
+               % (settings.compiler.version, param))
+    return command
+
+
 def human_size(size_bytes):
     """
     format a size in bytes into a 'human' file size, e.g. bytes, KB, MB, GB, TB, PB
-    Note that bytes/KB will be reported in whole numbers but MB and above will have greater precision
-    e.g. 1 byte, 43 bytes, 443 KB, 4.3 MB, 4.43 GB, etc
+    Note that bytes/KB will be reported in whole numbers but MB and above will have
+    greater precision.  e.g. 1 byte, 43 bytes, 443 KB, 4.3 MB, 4.43 GB, etc
     """
     if size_bytes == 1:
         return "1 byte"


Test patch:
Repository: conan-io/conan

Issue:
Multiple licenses in a single package
The Beast library is available under the Boost license (https://github.com/TyRoXx/Beast/blob/17b04b87e05e636db4ea73dfa11f2710cd9aeeb1/LICENSE_1_0.txt), but it also brings the HTTP parser from node.js/NGINX which requires a separate license (MIT, https://github.com/TyRoXx/Beast/blob/17b04b87e05e636db4ea73dfa11f2710cd9aeeb1/src/http-parser/LICENSE-MIT).

The following seems to be impossible as of 0.8.6:

``` Python
    license = "Boost", "MIT"
```

There should probably be a way to enumerate all licenses required by a package.



Discussion:

Resolving patch:
diff --git a/conans/client/printer.py b/conans/client/printer.py
--- a/conans/client/printer.py
+++ b/conans/client/printer.py
@@ -76,7 +76,10 @@ def print_info(self, deps_graph, project_reference, _info, registry, graph_updat
             if url:
                 self._out.writeln("    URL: %s" % url, Color.BRIGHT_GREEN)
             if license_:
-                self._out.writeln("    License: %s" % license_, Color.BRIGHT_GREEN)
+                if isinstance(license_, (list, tuple, set)):
+                    self._out.writeln("    Licenses: %s" % ", ".join(license_), Color.BRIGHT_GREEN)
+                else:
+                    self._out.writeln("    License: %s" % license_, Color.BRIGHT_GREEN)
             if author:
                 self._out.writeln("    Author: %s" % author, Color.BRIGHT_GREEN)
 


Test patch:
diff --git a/conans/test/command/info_test.py b/conans/test/command/info_test.py
--- a/conans/test/command/info_test.py
+++ b/conans/test/command/info_test.py
@@ -23,10 +23,17 @@ def _create(self, number, version, deps=None, export=True):
                 It is recommended to add the package license as attribute""")
             self.assertIn(expected_output, self.client.user_io.out)
 
-        files[CONANFILE] = files[CONANFILE].replace('version = "0.1"',
+        if number != "Hello2":
+            files[CONANFILE] = files[CONANFILE].replace('version = "0.1"',
                                                     'version = "0.1"\n'
                                                     '    url= "myurl"\n'
                                                     '    license = "MIT"')
+        else:
+            files[CONANFILE] = files[CONANFILE].replace('version = "0.1"',
+                                                    'version = "0.1"\n'
+                                                    '    url= "myurl"\n'
+                                                    '    license = "MIT", "GPL"')
+
         self.client.save(files)
         if export:
             self.client.run("export lasote/stable")
@@ -43,7 +50,7 @@ def reuse_test(self):
             """\
             Hello2/0.1@PROJECT
                 URL: myurl
-                License: MIT
+                Licenses: MIT, GPL
                 Requires:
                     Hello1/0.1@lasote/stable
             Hello0/0.1@lasote/stable
Repository: conan-io/conan

Issue:
[requires} in conanfile.txt gives no error
The typo:

```
[requires}
...
```

in `conanfile.txt` does not give any error indication at all when running `conan install ...`. The way to see that something is wrong is that it doesn't do anything, but finding the cause was not as easy as it could've been.

This is on 0.9.2 on Ubuntu 15.10.



Discussion:

Resolving patch:
diff --git a/conans/util/config_parser.py b/conans/util/config_parser.py
--- a/conans/util/config_parser.py
+++ b/conans/util/config_parser.py
@@ -12,19 +12,26 @@ def __init__(self, text, allowed_fields=None, parse_lines=False):
         self._sections = {}
         self._allowed_fields = allowed_fields or []
         pattern = re.compile("^\[([a-z_]{2,50})\]")
-        current_lines = []
+        current_lines = None
         for line in text.splitlines():
             line = line.strip()
             if not line or line[0] == '#':
                 continue
-            m = pattern.match(line)
-            if m:
-                group = m.group(1)
-                if self._allowed_fields and group not in self._allowed_fields:
-                    raise ConanException("ConfigParser: Unrecognized field '%s'" % group)
+            field = None
+            if line[0] == '[':
+                m = pattern.match(line)
+                if m:
+                    field = m.group(1)
+                else:
+                    raise ConanException("ConfigParser: Bad syntax '%s'" % line)
+            if field:
+                if self._allowed_fields and field not in self._allowed_fields:
+                    raise ConanException("ConfigParser: Unrecognized field '%s'" % field)
                 current_lines = []
-                self._sections[group] = current_lines
+                self._sections[field] = current_lines
             else:
+                if current_lines is None:
+                    raise ConanException("ConfigParser: Unexpected line '%s'" % line)
                 if parse_lines:
                     line = line.split('#')[0]
                     line = line.strip()


Test patch:
diff --git a/conans/test/conanfile_loader_test.py b/conans/test/conanfile_loader_test.py
--- a/conans/test/conanfile_loader_test.py
+++ b/conans/test/conanfile_loader_test.py
@@ -1,7 +1,6 @@
 
 import unittest
-from conans.client.loader import ConanFileTextLoader,\
-    ConanFileLoader
+from conans.client.loader import ConanFileTextLoader, ConanFileLoader
 from conans.errors import ConanException
 from conans.util.files import save
 import os
@@ -14,6 +13,18 @@
 
 class ConanLoaderTest(unittest.TestCase):
 
+    def conanfile_txt_errors_test(self):
+        # Valid content
+        file_content = '''[requires}
+OpenCV/2.4.10@phil/stable # My requirement for CV
+'''
+        with self.assertRaisesRegexp(ConanException, "Bad syntax"):
+            ConanFileTextLoader(file_content)
+
+        file_content = '{hello}'
+        with self.assertRaisesRegexp(ConanException, "Unexpected line"):
+            ConanFileTextLoader(file_content)
+
     def plain_text_parser_test(self):
         # Valid content
         file_content = '''[requires]
Repository: conan-io/conan

Issue:
conan install -u traceback
When running `conan install -u` while no previous `conan install` was run (so e.g. no conan conanbuildinfo.cmake exists) I get the following traceback:

![image](https://cloud.githubusercontent.com/assets/11735226/17244088/59567f7c-5580-11e6-8a6f-4b026be70816.png)



Discussion:
I can't reproduce the error. Do you have a conanfile.py? conanfile.txt? Windows right?

It's Windows, yes. Conan version is 0.10.1. I have a simple repo with a simple conanfile.txt like this:

```
[requires]
googlemock/1.7.0@image/stable
Qt/5.7.0@image/stable

[generators]
cmake

[imports]
bin, *.dll -> ./bin # Copies all dll files from the package "bin" folder to my project "bin" folder
```

When I create a new folder and run `conan install -u {SOURCE_DIR}` I always get the shown traceback.

Actually, the Qt / short_paths.conf might be the culprit. I have tried with a different repository that does not have a Qt dependency (and thus, does not use short_paths.conf) and it is working properly.

Have you modified the short_paths.conf? Could you paste here?

There is one entry in my short_paths.conf for the Qt package:

`Qt/5.7.0@image/stable: C:/Qt/5.7.0/image/stable`


Resolving patch:
diff --git a/conans/client/proxy.py b/conans/client/proxy.py
--- a/conans/client/proxy.py
+++ b/conans/client/proxy.py
@@ -140,12 +140,13 @@ def update_available(self, conan_reference):
         if not conan_reference:
             return 0
         read_manifest, _ = self._paths.conan_manifests(conan_reference)
-        try:  # get_conan_digest can fail, not in server
-            upstream_manifest = self.get_conan_digest(conan_reference)
-            if upstream_manifest.file_sums != read_manifest.file_sums:
-                return 1 if upstream_manifest.time > read_manifest.time else -1
-        except ConanException:
-            pass
+        if read_manifest:
+            try:  # get_conan_digest can fail, not in server
+                upstream_manifest = self.get_conan_digest(conan_reference)
+                if upstream_manifest.file_sums != read_manifest.file_sums:
+                    return 1 if upstream_manifest.time > read_manifest.time else -1
+            except ConanException:
+                pass
 
         return 0
 


Test patch:
Repository: conan-io/conan

Issue:
Test package command failing when method requirements in test package's conanfile
Creating a new package with "conan new -t", and editing the example to require the package in a requirements method:
```
class MyTestConan(ConanFile):
    settings = "os", "compiler", "build_type", "arch"
    # requires = "prueba/0.1@%s/%s" % (username, channel)
    generators = "cmake"

    def requirements(self):
        self.requires("prueba/%s@lasote/stable" % os.environ.get("MY_VERSION_ENV", "0.1"))

```

Output:

`ERROR: Unable to retrieve first requirement of test conanfile.py`


Discussion:

Resolving patch:
diff --git a/conans/client/command.py b/conans/client/command.py
--- a/conans/client/command.py
+++ b/conans/client/command.py
@@ -252,6 +252,7 @@ def test_package(self, *args):
         conanfile = loader.load_conan(test_conanfile, self._user_io.out, consumer=True)
         try:
             # convert to list from ItemViews required for python3
+            conanfile.requirements()
             reqs = list(conanfile.requires.items())
             first_dep = reqs[0][1].conan_reference
         except Exception:


Test patch:
diff --git a/conans/test/integration/conan_test_test.py b/conans/test/integration/conan_test_test.py
--- a/conans/test/integration/conan_test_test.py
+++ b/conans/test/integration/conan_test_test.py
@@ -14,9 +14,9 @@ def _create(self, client, number, version, deps=None, export=True):
             client.run("export lasote/stable")
 
     def conan_test_test(self):
-        client = TestClient()
-        files = cpp_hello_conan_files("Hello0", "0.1")
-        test_conanfile = '''
+
+        # With classic requires
+        conanfile = '''
 from conans import ConanFile, CMake
 import os
 
@@ -34,6 +34,34 @@ def test(self):
         # equal to ./bin/greet, but portable win: .\bin\greet
         self.run(os.sep.join([".","bin", "greet"]))
         '''
+        self._test_with_conanfile(conanfile)
+
+        # With requirements
+        conanfile = '''
+from conans import ConanFile, CMake
+import os
+
+class HelloReuseConan(ConanFile):
+    settings = "os", "compiler", "build_type", "arch"
+    generators = "cmake"
+
+    def requirements(self):
+        self.requires("Hello0/0.1@ lasote/stable")
+
+    def build(self):
+        cmake = CMake(self.settings)
+        self.run('cmake "%s" %s' % (self.conanfile_directory, cmake.command_line))
+        self.run("cmake --build . %s" % cmake.build_config)
+
+    def test(self):
+        # equal to ./bin/greet, but portable win: .\bin\greet
+        self.run(os.sep.join([".","bin", "greet"]))
+        '''
+        self._test_with_conanfile(conanfile)
+
+    def _test_with_conanfile(self, test_conanfile):
+        client = TestClient()
+        files = cpp_hello_conan_files("Hello0", "0.1")
 
         cmakelist = """PROJECT(MyHello)
 cmake_minimum_required(VERSION 2.8)
Repository: conan-io/conan

Issue:
conan doesn't supply -m32/-m64 to CMake in case of MinGW
To help us debug your issue please explain:

- [x] I've read the [CONTRIBUTING guide](https://raw.githubusercontent.com/conan-io/conan/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.

as for conan 1.0.2, conan doesn't supply flags -m32/-m64 to the CMake helper in case of MinGW (e.g. when using mingw_installer/1.0@conan/stable).

see this log as an example 
https://ci.appveyor.com/project/BinCrafters/conan-lzma/build/1.0.29


Discussion:

Resolving patch:
diff --git a/conans/client/build/cmake.py b/conans/client/build/cmake.py
--- a/conans/client/build/cmake.py
+++ b/conans/client/build/cmake.py
@@ -260,7 +260,7 @@ def _get_cmake_definitions(self):
             ret["CONAN_COMPILER_VERSION"] = str(self._compiler_version)
 
         # Force compiler flags -- TODO: give as environment/setting parameter?
-        if self._os in ("Linux", "FreeBSD", "SunOS"):
+        if self._compiler in ("gcc", "clang", "apple-clang", "sun-cc"):
             if self._arch == "x86" or self._arch == "sparc":
                 ret["CONAN_CXX_FLAGS"] = "-m32"
                 ret["CONAN_SHARED_LINKER_FLAGS"] = "-m32"


Test patch:
diff --git a/conans/test/build_helpers/cmake_test.py b/conans/test/build_helpers/cmake_test.py
--- a/conans/test/build_helpers/cmake_test.py
+++ b/conans/test/build_helpers/cmake_test.py
@@ -183,8 +183,10 @@ def check(text, build_config, generator=None):
         settings.compiler = "gcc"
         settings.compiler.version = "4.8"
         generator = "MinGW Makefiles" if platform.system() == "Windows" else "Unix Makefiles"
-        check('-G "%s" -DCMAKE_BUILD_TYPE="Debug" -DCONAN_EXPORTED="1" '
-              '-DCONAN_COMPILER="gcc" -DCONAN_COMPILER_VERSION="4.8" -Wno-dev' % generator, "")
+        check('-G "%s" -DCMAKE_BUILD_TYPE="Debug" -DCONAN_EXPORTED="1" -DCONAN_COMPILER="gcc" '
+              '-DCONAN_COMPILER_VERSION="4.8" -DCONAN_CXX_FLAGS="-m64" '
+              '-DCONAN_SHARED_LINKER_FLAGS="-m64" -DCONAN_C_FLAGS="-m64" '
+              '-Wno-dev' % generator, "")
 
         settings.os = "Linux"
         settings.arch = "x86"
Repository: conan-io/conan

Issue:
'install_folder' attribute is not always set
To reproduce, take https://github.com/memsharded/conan-hello example with one addition:
```python
    def package(self):
        print("self.source_folder:", self.source_folder)
        print("self.build_folder:", self.build_folder)
        print("self.install_folder:", self.install_folder)
        ...
```
now package it:
```
conan create . dbely/testing
```
everything goes well, with the output
```
Hello/0.1@dbely/testing: Calling package()
self.source_folder: C:\Users\dbely\.conan\data\Hello\0.1\dbely\testing\build\6cc50b139b9c3d27b3e9042d5f5372d327b3a9f7
self.build_folder: C:\Users\dbely\.conan\data\Hello\0.1\dbely\testing\build\6cc50b139b9c3d27b3e9042d5f5372d327b3a9f7
self.install_folder: C:\Users\dbely\.conan\data\Hello\0.1\dbely\testing\build\6cc50b139b9c3d27b3e9042d5f5372d327b3a9f7
```
Now do it step by step:
```
conan source .
conan install .
conan build .
conan package .
```
All the commands succeed except the last one:
```
PROJECT: Calling package()
self.source_folder: C:\Users\dbely\conan\conan-hello.git
self.build_folder: C:\Users\dbely\conan\conan-hello.git
ERROR: Hello/0.1@PROJECT: Error in package() method, line 21
        print("self.install_folder:", self.install_folder)
        AttributeError: 'HelloConan' object has no attribute 'install_folder'
```



Discussion:

Resolving patch:
diff --git a/conans/client/packager.py b/conans/client/packager.py
--- a/conans/client/packager.py
+++ b/conans/client/packager.py
@@ -27,6 +27,7 @@ def create_package(conanfile, source_folder, build_folder, package_folder, insta
         output.highlight("Calling package()")
         conanfile.package_folder = package_folder
         conanfile.source_folder = source_folder
+        conanfile.install_folder = install_folder
         conanfile.build_folder = build_folder
 
         def recipe_has(conanfile, attribute):


Test patch:
diff --git a/conans/test/functional/folders_access_test.py b/conans/test/functional/folders_access_test.py
--- a/conans/test/functional/folders_access_test.py
+++ b/conans/test/functional/folders_access_test.py
@@ -82,6 +82,8 @@ def build(self):
         self.copy_build_folder = self.build_folder
         
     def package(self):
+        assert(self.install_folder is not None)
+
         if self.no_copy_source:
             # First call with source, second with build
             if self.counter_package_calls == 0: