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

Issue:
#RREV in conanfile.txt
Hello!

I try to pin revision for some recipes in conanfile.txt.
Conan 1.16.1

What i do:
I've added hashtag and number of revision like https://docs.conan.io/en/latest/mastering/revisions.html#package-revisions. 

[requires]
gtest/1.8.1@bincrafters/stable#0

But # - is a comment symbol and "#0" is ignored by Conan.
 
Help please and tell me what i do wrong.

PS: on command line it is works  normal.
conan install gtest/1.8.1@bincrafters/stable#0


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
@@ -54,7 +54,8 @@ def __init__(self, text, allowed_fields=None, parse_lines=False, raise_unexpecte
                 if current_lines is None:
                     raise ConanException("ConfigParser: Unexpected line '%s'" % line)
                 if parse_lines:
-                    line = line.split('#')[0]
+                    line = line.split(' #', 1)[0]
+                    line = line.split('    #', 1)[0]
                     line = line.strip()
                 current_lines.append(line)
 


Test patch:
diff --git a/conans/test/unittests/client/conanfile_loader_test.py b/conans/test/unittests/client/conanfile_loader_test.py
--- a/conans/test/unittests/client/conanfile_loader_test.py
+++ b/conans/test/unittests/client/conanfile_loader_test.py
@@ -105,6 +105,15 @@ def plain_text_parser_test(self):
                'OpenCV3/2.4.10@phil/stable']
         self.assertEqual(parser.requirements, exp)
 
+    def revision_parsing_test(self):
+        # Valid content
+        file_content = '''[requires]
+OpenCV/2.4.10@user/stable#RREV1 # My requirement for CV
+'''
+        parser = ConanFileTextLoader(file_content)
+        exp = ['OpenCV/2.4.10@user/stable#RREV1']
+        self.assertEqual(parser.requirements, exp)
+
     def load_conan_txt_test(self):
         file_content = '''[requires]
 OpenCV/2.4.10@phil/stable
Repository: conan-io/conan

Issue:
ERROR: Value provided for user name, '_' (type str), is too short when running conan remote clean
1. `git clone https://gitlab.com/ssrobins/sdl2-example.git`
2. `cd sdl2-example`
3. Run the `build_` script matching your platform
4. `conan remote clean`

I get this error:
```
ERROR: Value provided for user name, '_' (type str), is too short. Valid names must contain at least 2 characters.
```

If I run `conan remove "*" -f` then `conan remote clean`, no error. I'm using the new experimental feature that allows me to do without the user and channel so I think it's having a problem with the single `_` that replaces the user in the package path. Not a big deal, but thought you'd want to know.

Environment:
Conan 1.18.1
macOS 10.14.4/Windows 10 Pro 64-bit 1809

Hope to see you at CppCon so I can personally thank you all for a great job with Conan!


Discussion:

Resolving patch:
diff --git a/conans/client/cache/cache.py b/conans/client/cache/cache.py
--- a/conans/client/cache/cache.py
+++ b/conans/client/cache/cache.py
@@ -75,7 +75,7 @@ def __init__(self, cache_folder, output):
 
     def all_refs(self):
         subdirs = list_folder_subdirs(basedir=self._store_folder, level=4)
-        return [ConanFileReference(*folder.split("/")) for folder in subdirs]
+        return [ConanFileReference.load_dir_repr(folder) for folder in subdirs]
 
     @property
     def store(self):


Test patch:
diff --git a/conans/test/functional/command/remote_test.py b/conans/test/functional/command/remote_test.py
--- a/conans/test/functional/command/remote_test.py
+++ b/conans/test/functional/command/remote_test.py
@@ -86,7 +86,7 @@ class HelloConan(ConanFile):
 
     def list_raw_test(self):
         self.client.run("remote list --raw")
-        output = re.sub("http:\/\/fake.+\.com", "http://fake.com", str(self.client.out))
+        output = re.sub(r"http:\/\/fake.+\.com", "http://fake.com", str(self.client.out))
         self.assertIn("remote0 http://fake.com True", output)
         self.assertIn("remote1 http://fake.com True", output)
         self.assertIn("remote2 http://fake.com True", output)
@@ -157,6 +157,22 @@ def clean_remote_test(self):
         self.client.run("remote list_ref")
         self.assertEqual("", self.client.out)
 
+    def clean_remote_no_user_test(self):
+        self.client.run("remote add_ref Hello/0.1 remote0")
+        self.client.run("remote clean")
+        self.client.run("remote list")
+        self.assertEqual("", self.client.out)
+        self.client.run("remote list_ref")
+        self.assertEqual("", self.client.out)
+
+    def remove_remote_no_user_test(self):
+        self.client.run("remote add_ref Hello/0.1 remote0")
+        self.client.run("remote remove remote0")
+        self.client.run("remote list")
+        self.assertNotIn("remote0", self.client.out)
+        self.client.run("remote list_ref")
+        self.assertEqual("", self.client.out)
+
     def add_force_test(self):
         client = TestClient()
         client.run("remote add r1 https://r1")
Repository: conan-io/conan

Issue:
Add gcc 9.2 to default list of compilers
gcc 9.2 is released, so we can add it to the default list of compilers that conan recognizes. Checked vs. conan v1.18.2 on macOS 10.14.6

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.




Discussion:

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
@@ -63,7 +63,7 @@
                   "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"]
+                  "9", "9.1", "9.2"]
         libcxx: [libstdc++, libstdc++11]
         threads: [None, posix, win32] #  Windows MinGW
         exception: [None, dwarf2, sjlj, seh] # Windows MinGW


Test patch:
Repository: conan-io/conan

Issue:
Change `conan new` to use dict in default options
From:

```
    options = {"shared": [True, False]}
    default_options = "shared=False"
```

To:

```
    options = {"shared": [True, False]}
    default_options = {"shared": False}
```




Discussion:

Resolving patch:
diff --git a/conans/client/cmd/new.py b/conans/client/cmd/new.py
--- a/conans/client/cmd/new.py
+++ b/conans/client/cmd/new.py
@@ -22,7 +22,7 @@ class {package_name}Conan(ConanFile):
     topics = ("<Put some tag here>", "<here>", "<and here>")
     settings = "os", "compiler", "build_type", "arch"
     options = {{"shared": [True, False]}}
-    default_options = "shared=False"
+    default_options = {{"shared": False}}
     generators = "cmake"
 
     def source(self):
@@ -91,7 +91,7 @@ class {package_name}Conan(ConanFile):
     topics = ("<Put some tag here>", "<here>", "<and here>")
     settings = "os", "compiler", "build_type", "arch"
     options = {{"shared": [True, False]}}
-    default_options = "shared=False"
+    default_options = {{"shared": False}}
     generators = "cmake"
     exports_sources = "src/*"
 


Test patch:
Repository: conan-io/conan

Issue:
Add clang 9 to default list of compilers
LLVM 9 is released, so we can add it to the default list of compilers that conan recognizes. Checked vs. conan v1.18.2 on macOS 10.14.6

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.




Discussion:

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
@@ -63,7 +63,7 @@
                   "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"]
+                  "9", "9.1", "9.2"]
         libcxx: [libstdc++, libstdc++11]
         threads: [None, posix, win32] #  Windows MinGW
         exception: [None, dwarf2, sjlj, seh] # Windows MinGW
@@ -79,7 +79,7 @@
     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"]
+                  "8", "9"]
         libcxx: [libstdc++, libstdc++11, libc++, c++_shared, c++_static]
         cppstd: [None, 98, gnu98, 11, gnu11, 14, gnu14, 17, gnu17, 20, gnu20]
     apple-clang:


Test patch:
Repository: conan-io/conan

Issue:
[cmake helper] CONAN_CPU_COUNT is not respected with the ninja generator
Conan Version: 1.18.4

I just upgraded some of our projects to build with ninja by setting CONAN_CMAKE_GENERATOR=Ninja. While everything still works, this change caused quite a high load on the CI runner that I was not really expecting.

In particular, it seems like the cmake helper is ignoring the configured CONAN_CPU_COUNT value when the ninja generator is used. See:

https://github.com/conan-io/conan/blob/0882a2a8c85b848b277aa45893576a45e208e27e/conans/client/build/cmake.py#L238

I would expect that also the ninja generator adheres to the specified cpu count.


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
@@ -235,7 +235,8 @@ def _build(self, args=None, build_dir=None, target=None):
 
         compiler_version = self._settings.get_safe("compiler.version")
         if self.generator and self.parallel:
-            if "Makefiles" in self.generator and "NMake" not in self.generator:
+            if ("Makefiles" in self.generator or "Ninja" in self.generator) and \
+                    "NMake" not in self.generator:
                 if "--" not in args:
                     args.append("--")
                 args.append("-j%i" % cpu_count(self._conanfile.output))


Test patch:
diff --git a/conans/test/unittests/client/build/cmake_test.py b/conans/test/unittests/client/build/cmake_test.py
--- a/conans/test/unittests/client/build/cmake_test.py
+++ b/conans/test/unittests/client/build/cmake_test.py
@@ -1016,6 +1016,13 @@ def test_run_tests(self):
                                                 cpu_count(output=conanfile.output)),
                          conanfile.command)
 
+        cmake.generator = "Ninja"
+        cmake.test()
+        self.assertEqual('cmake --build '
+                         '%s' % CMakeTest.scape('. --target test -- -j%i' %
+                                                cpu_count(output=conanfile.output)),
+                         conanfile.command)
+
         cmake.generator = "NMake Makefiles"
         cmake.test()
         self.assertEqual('cmake --build '
Repository: conan-io/conan

Issue:
Use of python_requires with enabled short_paths fails
In Windows conan fails when a recipe uses `python_requires` and `short_paths = True` at the same time.

To reproduce the issue, it's enough to just add `short_paths = True` into the consumer conanfile of the `python_requires` example.

Conan will end with
```
ERROR: Error while trying to get recipe sources for pyreq/version@user/channel. No remote defined
```


Discussion:

Resolving patch:
diff --git a/conans/client/installer.py b/conans/client/installer.py
--- a/conans/client/installer.py
+++ b/conans/client/installer.py
@@ -427,7 +427,7 @@ def _build_package(self, node, output, keep_build, remotes):
             assert python_require.ref.revision is not None, \
                 "Installer should receive python_require.ref always"
             complete_recipe_sources(self._remote_manager, self._cache,
-                                    conanfile, python_require.ref, remotes)
+                                    python_require.conanfile, python_require.ref, remotes)
 
         builder = _PackageBuilder(self._cache, output, self._hook_manager, self._remote_manager)
         pref = builder.build_package(node, keep_build, self._recorder, remotes)


Test patch:
diff --git a/conans/test/functional/python_requires/python_requires_test.py b/conans/test/functional/python_requires/python_requires_test.py
--- a/conans/test/functional/python_requires/python_requires_test.py
+++ b/conans/test/functional/python_requires/python_requires_test.py
@@ -576,6 +576,32 @@ class Lib(ConanFile):
         self.assertIn("Same python_requires with different versions not allowed for a conanfile",
                       t.out)
 
+    def short_paths_test(self):
+        # https://github.com/conan-io/conan/issues/5814
+        client = TestClient(default_server_user=True)
+        conanfile = textwrap.dedent("""
+        from conans import ConanFile
+        class MyConanfileBase(ConanFile):
+            exports = "*.txt"
+            exports_sources = "*.h"
+        """)
+        client.save({"conanfile.py": conanfile,
+                     "file.h": "header",
+                     "other.txt": "text"})
+        client.run("create . Base/1.2@lasote/testing")
+
+        reuse = textwrap.dedent("""
+        from conans import python_requires
+        base = python_requires("Base/1.2@lasote/testing")
+        class PkgTest(base.MyConanfileBase):
+            short_paths = True
+            name = "consumer"
+            version = "1.0.0"
+        """)
+        client.save({"conanfile.py": reuse}, clean_first=True)
+        client.run("create . lasote/testing")
+        self.assertIn("consumer/1.0.0@lasote/testing: Created package revision", client.out)
+
 
 class PythonRequiresNestedTest(unittest.TestCase):
Repository: conan-io/conan

Issue:
Support gcc 7.4 in settings.yml
Conan: 1.19.1

gcc 7.4 is the current system compiler on [Ubuntu 18.04 Bionic](https://packages.ubuntu.com/bionic/gcc) but is not "supported" by conan at the moment out of the box. Considering that Bionic is even a LTS versions I think it is important to add this gcc versions to conan's default `settings.yml`.

For reference, gcc 7.4 was apparently already (released in [December 2018](https://gcc.gnu.org/gcc-7/)). 

Best,
Mario


Discussion:

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
@@ -61,7 +61,7 @@
         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",
+                  "7", "7.1", "7.2", "7.3", "7.4",
                   "8", "8.1", "8.2", "8.3",
                   "9", "9.1", "9.2"]
         libcxx: [libstdc++, libstdc++11]


Test patch:
Repository: conan-io/conan

Issue:
Improve help for conan remove <ref_or_pattern> -p
Related to #1467, #1314

`conan remove <ref_or_pattern> -p` command is allowed and displayed in the docs but the help
does not state this clear

```
$ conan remove -h
usage: conan remove [-h] [-b [BUILDS [BUILDS ...]]] [-f] [-l] [-o]
                    [-p [PACKAGES [PACKAGES ...]]] [-q QUERY] [-r REMOTE] [-s]
                    [-t]
                    [pattern_or_reference]

Removes packages or binaries matching pattern from local cache or remote.

It can also be used to remove temporary source or build folders in the
local conan cache. If no remote is specified, the removal will be done
by default in the local conan cache.

positional arguments:
  pattern_or_reference  Pattern or package recipe reference, e.g., 'boost/*',
                        'MyPackage/1.2@user/channel'

optional arguments:
  -h, --help            show this help message and exit
  -b [BUILDS [BUILDS ...]], --builds [BUILDS [BUILDS ...]]
                        By default, remove all the build folders or select
                        one, specifying the package ID
  -f, --force           Remove without requesting a confirmation
  -l, --locks           Remove locks
  -o, --outdated        Remove only outdated from recipe packages. This flag
                        can only be used with a reference
  -p [PACKAGES [PACKAGES ...]], --packages [PACKAGES [PACKAGES ...]]
                        Select package to remove specifying the package ID
```

Conan 1.17




Discussion:
As a clarification, `conan remove <ref> --packages` removes all the packages for that reference and the help message does not indicate that.
Hello, wanted to work this out. 
So the fix is just to add the suitable message in the help right ? 

Resolving patch:
diff --git a/conans/client/command.py b/conans/client/command.py
--- a/conans/client/command.py
+++ b/conans/client/command.py
@@ -994,7 +994,7 @@ def remove(self, *args):
                             help="Remove only outdated from recipe packages. "
                                  "This flag can only be used with a reference")
         parser.add_argument('-p', '--packages', nargs="*", action=Extender,
-                            help="Select package to remove specifying the package ID")
+                            help="Remove all packages of the specified reference if no specific package ID is provided")
         parser.add_argument('-q', '--query', default=None, action=OnceArgument, help=_QUERY_HELP)
         parser.add_argument('-r', '--remote', action=OnceArgument,
                             help='Will remove from the specified remote')


Test patch:
Repository: conan-io/conan

Issue:
Conan hooks exceptions show not useful stack trace
Having a hook raising an ``Exception`` produces something like:

```bash
ERROR: [HOOK - name_conventions.py] pre_export(): Reference Hello/0.1@user/testing should be all lowercase
Traceback (most recent call last):
  File "c:\users\memsharded\envs\conanpip\lib\site-packages\conans\client\hook_manager.py", line 56, in execute
    method(output=output, **kwargs)
  File "C:\Users\memsharded\.conan\hooks\name_conventions.py", line 4, in pre_export
    raise Exception("Reference %s should be all lowercase" % ref)
Exception: Reference Hello/0.1@user/testing should be all lowercase
```

As this is not very useful, I suggest removing it.



Discussion:

Resolving patch:
diff --git a/conans/client/hook_manager.py b/conans/client/hook_manager.py
--- a/conans/client/hook_manager.py
+++ b/conans/client/hook_manager.py
@@ -57,8 +57,7 @@ def execute(self, method_name, **kwargs):
                 output = ScopedOutput("[HOOK - %s] %s()" % (name, method_name), self.output)
                 method(output=output, **kwargs)
             except Exception as e:
-                raise ConanException("[HOOK - %s] %s(): %s\n%s" % (name, method_name, str(e),
-                                                                   traceback.format_exc()))
+                raise ConanException("[HOOK - %s] %s(): %s" % (name, method_name, str(e)))
 
     def load_hooks(self):
         for name in self._hook_names:


Test patch:
Repository: conan-io/conan

Issue:
Add a warning for files skipped in 'tar_extract'
In the [`tar_extract` function](https://github.com/conan-io/conan/blob/556e2043e11bc53d6ad797519385b9b34dfdbb2d/conans/util/files.py#L293) we are skipping non-safe members:

```python
def tar_extract(fileobj, destination_dir):
    """Extract tar file controlling not absolute paths and fixing the routes
    if the tar was zipped in windows"""
    def badpath(path, base):
        # joinpath will ignore base if path is absolute
        return not realpath(abspath(joinpath(base, path))).startswith(base)

    def safemembers(members):
        base = realpath(abspath("."))

        for finfo in members:
            if badpath(finfo.name, base) or finfo.islnk():
                continue
            else:
                ...
```

we should warn the user about those files.

After #4965 this should be an exceptional behaviour, so a warning should be fine.


Discussion:

Resolving patch:
diff --git a/conans/util/files.py b/conans/util/files.py
--- a/conans/util/files.py
+++ b/conans/util/files.py
@@ -342,6 +342,7 @@ def safemembers(members):
 
         for finfo in members:
             if badpath(finfo.name, base) or finfo.islnk():
+                logger.warning("file:%s is skipped since it's not safe." % str(finfo.name))
                 continue
             else:
                 # Fixes unzip a windows zipped file in linux


Test patch:
Repository: conan-io/conan

Issue:
[ux] [bug] Improve error raised when 'settings.yml' cannot be parsed
If the file `settings.yml` is invalid, Conan raises an ugly error with all the traceback.

---

How to reproduce:
 * Edit `settings.yml` and make it an invalid YAML
 * Run something like `conan create ....`:

```
⇒  conan create dep1 
Traceback (most recent call last):
  File "/Users/jgsogo/dev/conan/conan/conans/client/command.py", line 1911, in run
    method(args[0][1:])
  File "/Users/jgsogo/dev/conan/conan/conans/client/command.py", line 355, in create
    lockfile=args.lockfile)
 
.... lots of traceback  ...

yaml.scanner.ScannerError: while scanning a simple key
  in "<unicode string>", line 14, column 1:
    os dasf:ffs 
    ^
could not find expected ':'
  in "<unicode string>", line 15, column 12:
        Windows:
               ^

ERROR: while scanning a simple key
  in "<unicode string>", line 14, column 1:
    os dasf:ffs 
    ^
could not find expected ':'
  in "<unicode string>", line 15, column 12:
        Windows:
               ^
```

---

I would expect something easier like: `File 'settings.yml' has invalid YAML format/ cannot be parsed / error reading....` and, if possible, add the information with the line and column.


Discussion:

Resolving patch:
diff --git a/conans/model/settings.py b/conans/model/settings.py
--- a/conans/model/settings.py
+++ b/conans/model/settings.py
@@ -233,7 +233,10 @@ def copy_values(self):
 
     @staticmethod
     def loads(text):
-        return Settings(yaml.safe_load(text) or {})
+        try:
+            return Settings(yaml.safe_load(text) or {})
+        except (yaml.YAMLError, AttributeError) as ye:
+            raise ConanException("Invalid settings.yml format: {}".format(ye))
 
     def validate(self):
         for field in self.fields:


Test patch:
diff --git a/conans/test/functional/configuration/invalid_settings_test.py b/conans/test/functional/configuration/invalid_settings_test.py
new file mode 100644
--- /dev/null
+++ b/conans/test/functional/configuration/invalid_settings_test.py
@@ -0,0 +1,28 @@
+import os
+import textwrap
+import unittest
+
+from conans.test.utils.tools import TestClient
+
+
+class SettingsLoadTestCase(unittest.TestCase):
+    def test_invalid_settings(self):
+        client = TestClient()
+        client.save({os.path.join(client.cache_folder, 'settings.yml'): """your buggy file"""})
+        client.run("new -b hello/1.0")
+        client.run("install .", assert_error=True)
+        self.assertIn("ERROR: Invalid settings.yml format", client.out)
+
+    def test_invalid_yaml(self):
+        client = TestClient()
+        client.save({os.path.join(client.cache_folder, 'settings.yml'):
+                     textwrap.dedent("""
+                        Almost:
+                            - a
+                            - valid
+                          yaml
+                     """)})
+        client.run("new -b hello/1.0")
+        client.run("install .", assert_error=True)
+        self.assertIn("ERROR: Invalid settings.yml format: while parsing a block mapping",
+                      client.out)