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

Issue:
[bug] SystemPackageTool installed() method is missing
According to [conan-io/docs](https://github.com/conan-io/docs/blame/18d6adbf56a55a7d9185a12aa707b5fe161b35e9/reference/conanfile/methods.rst#L642), [docs.conan.io](https://docs.conan.io/en/latest/reference/conanfile/methods.html#systempackagetool) SystemPackageTool should have a public `installed(package_name)` method. Instead, only a protected `_installed(packages)` is provided (see [here](https://github.com/conan-io/conan/blob/develop/conans/client/tools/system_pm.py#L146)).

### Environment Details (include every applicable attribute)
  * Operating System+version: Ubuntu 18.04.3 LTS
  * Compiler+version: no applicable
  * Conan version: 1.20.5
  * Python version: 3.6.9

### Steps to reproduce (Include if Applicable)
Try to use `SystemPackageTool.installed(package_name)`

### Logs (Executed commands with output) (Include/Attach if Applicable)
` ERROR: while executing system_requirements(): 'SystemPackageTool' object has no attribute 'installed'`

and if `_installed` is used:
```
Linter warnings
    WARN: Linter. Line 25: Access to a protected member _installed of a client class
```



Discussion:

Resolving patch:
diff --git a/conans/client/tools/system_pm.py b/conans/client/tools/system_pm.py
--- a/conans/client/tools/system_pm.py
+++ b/conans/client/tools/system_pm.py
@@ -143,6 +143,9 @@ def _get_package_names(self, packages, arch_names):
             return parsed_packages
         return packages
 
+    def installed(self, package_name):
+        return self._tool.installed(package_name)
+
     def _installed(self, packages):
         if not packages:
             return True


Test patch:
diff --git a/conans/test/unittests/client/tools/system_pm_test.py b/conans/test/unittests/client/tools/system_pm_test.py
--- a/conans/test/unittests/client/tools/system_pm_test.py
+++ b/conans/test/unittests/client/tools/system_pm_test.py
@@ -443,8 +443,10 @@ def system_package_tool_installed_test(self):
             expected_package = "chocolatey"
         # The expected should be installed on development/testing machines
         self.assertTrue(spt._tool.installed(expected_package))
+        self.assertTrue(spt.installed(expected_package))
         # This package hopefully doesn't exist
         self.assertFalse(spt._tool.installed("oidfjgesiouhrgioeurhgielurhgaeiorhgioearhgoaeirhg"))
+        self.assertFalse(spt.installed("oidfjgesiouhrgioeurhgielurhgaeiorhgioearhgoaeirhg"))
 
     def system_package_tool_fail_when_not_0_returned_test(self):
         def get_linux_error_message():
Repository: conan-io/conan

Issue:
[bug] default_options are typed to unicode
<!--
  Please don't forget to update the issue title.
  Include all applicable information to help us reproduce your problem.

  To help us debug your issue please explain:
-->

### Environment Details (include every applicable attribute)
  * Operating System+version: solaris intel or solaris ultrasparc (any version)
  * Compiler+version: gcc 4.8.5
  * Conan version: 1.21.0
  * Python version: 2.7.16 (Deprecation, but an issue to upgrade in our environment)

### Steps to reproduce (Include if Applicable)
when setting the following default options as:
```python
default_options=("SOME_OPT=%s" % (os.environ["SOME_OPT"]))
```
It causes the value reaching the conan_file.py create_options to be unicode, causing an exception
You can fix this by changing line 26 on model/conan_file.py from
```python
elif isinstance(default_options, str)
```
to be
```python
elif isinstance(default_options, (str, unicode))
```

Would be much appriciated and a quick fix :)

Thanks,
Ofir


Discussion:

Resolving patch:
diff --git a/conans/model/conan_file.py b/conans/model/conan_file.py
--- a/conans/model/conan_file.py
+++ b/conans/model/conan_file.py
@@ -1,6 +1,8 @@
 import os
 from contextlib import contextmanager
 
+import six
+
 from conans.client import tools
 from conans.client.output import ScopedOutput
 from conans.client.tools.env import environment_append, no_op, pythonpath
@@ -23,7 +25,7 @@ def create_options(conanfile):
         if default_options:
             if isinstance(default_options, (list, tuple, dict)):
                 default_values = OptionsValues(default_options)
-            elif isinstance(default_options, str):
+            elif isinstance(default_options, six.string_types):
                 default_values = OptionsValues.loads(default_options)
             else:
                 raise ConanException("Please define your default_options as list, "


Test patch:
Repository: conan-io/conan

Issue:
[bug] cmake_find_package generated file doesnt honor CONAN_CMAKE_SILENT_OUTPUT
### Environment Details (include every applicable attribute)
  * Operating System+version: not applicable 
  * Compiler+version: not applicable 
  * Conan version: everything released
  * Python version: not applicable 

### Steps to reproduce (Include if Applicable)

with cmake-conan  at least when issuing following command:

`cmake -GNinja -DCONAN_CMAKE_SILENT_OUTPUT $buildpath` 

and having cmake_find_package generator enabled in conanfile or passed in to conan_cmake_run(), generated Find$package.cmake has a single message() call.  Since the bug is essentially here:

https://github.com/conan-io/conan/blob/develop/conans/client/generators/cmake_find_package.py#L9

Same will most likely happen with calling `conan install` too..

When cmake 3.17 or never, these could be removed by filtering on the log level but that is not option for everybody.


### Logs (Executed commands with output) (Include/Attach if Applicable)

Excessive output like this will be shown when generating build scripts:

```-- Conan: Using autogenerated FindXXX.cmake
-- Conan: Using autogenerated FindYYY.cmake
-- Conan: Using autogenerated FindZZZ.cmake
```




Discussion:

Resolving patch:
diff --git a/conans/client/generators/cmake_find_package.py b/conans/client/generators/cmake_find_package.py
--- a/conans/client/generators/cmake_find_package.py
+++ b/conans/client/generators/cmake_find_package.py
@@ -6,7 +6,7 @@
 find_package_header = """
 include(FindPackageHandleStandardArgs)
 
-message(STATUS "Conan: Using autogenerated Find{name}.cmake")
+conan_message(STATUS "Conan: Using autogenerated Find{name}.cmake")
 # Global approach
 set({name}_FOUND 1)
 set({name}_VERSION "{version}")


Test patch:
Repository: conan-io/conan

Issue:
[bug] Conan does not install correct dependencies on OSX when using poetry
<!--
  Please don't forget to update the issue title.
  Include all applicable information to help us reproduce your problem.

  To help us debug your issue please explain:
-->

### Environment Details (include every applicable attribute)
  * Operating System+version: OSX Catalina
  * Compiler+version: 
  * Conan version: 1.24.0
  * Python version: 3.7

### Steps to reproduce (Include if Applicable)
```shell
poetry add conan -D
conan --version
```

Related to   [Poetry issue 2269](https://github.com/python-poetry/poetry/issues/2269). 
The [tar ball on pypa](https://pypi.org/project/conan/#files) does not contain the correct meta data (only for the platform it has been build with). It is recommended to use markers (see [PEP 508](https://www.python.org/dev/peps/pep-0508/#environment-markers)) to express conditional requirements.


### Logs (Executed commands with output) (Include/Attach if Applicable)

```
poetry run conan --help
Traceback (most recent call last):
File "/Users/stef/Library/Caches/pypoetry/virtualenvs/temp-31h-1b3r-py3.7/bin/conan", line 6, in
from pkg_resources import load_entry_point
File "/Users/stef/Library/Caches/pypoetry/virtualenvs/temp-31h-1b3r-py3.7/lib/python3.7/site-packages/pkg_resources/init.py", line 3191, in
@_call_aside
File "/Users/stef/Library/Caches/pypoetry/virtualenvs/temp-31h-1b3r-py3.7/lib/python3.7/site-packages/pkg_resources/init.py", line 3175, in _call_aside
f(*args, **kwargs)
File "/Users/stef/Library/Caches/pypoetry/virtualenvs/temp-31h-1b3r-py3.7/lib/python3.7/site-packages/pkg_resources/init.py", line 3204, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/Users/stef/Library/Caches/pypoetry/virtualenvs/temp-31h-1b3r-py3.7/lib/python3.7/site-packages/pkg_resources/init.py", line 583, in _build_master
ws.require(requires)
File "/Users/stef/Library/Caches/pypoetry/virtualenvs/temp-31h-1b3r-py3.7/lib/python3.7/site-packages/pkg_resources/init.py", line 900, in require
needed = self.resolve(parse_requirements(requirements))
File "/Users/stef/Library/Caches/pypoetry/virtualenvs/temp-31h-1b3r-py3.7/lib/python3.7/site-packages/pkg_resources/init.py", line 786, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pyOpenSSL<19.0.0,>=16.0.0' distribution was not found and is required by conan
```

<!--
  Your log content should be related to the bug description, it can be:
  - Conan command output
  - Server output (Artifactory, conan_server)
-->



Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -27,8 +27,6 @@ def get_requires(filename):
 
 
 project_requirements = get_requires("conans/requirements.txt")
-if platform.system() == "Darwin":
-    project_requirements.extend(get_requires("conans/requirements_osx.txt"))
 project_requirements.extend(get_requires("conans/requirements_server.txt"))
 dev_requirements = get_requires("conans/requirements_dev.txt")
 # The tests utils are used by conan-package-tools


Test patch:
Repository: conan-io/conan

Issue:
[bug] Unable to `python_requires_extend` a package with a '.' in the name
### Environment Details (include every applicable attribute)
  * Operating System+version: Windows 10
  * Conan version: 1.25.1
  * Python version: 3.8.1

### Steps to reproduce (Include if Applicable)
- Create a package with a '.' in the name (E.g. my.package/1.2.3)
- Create a recipe for another package with 
```
python_requires = 'my.package/1.2.3'
python_requires_extend = 'my.package.MyPackage'
```

- Receive the error ERROR: too many values to unpack (expected 2)



Discussion:

Resolving patch:
diff --git a/conans/client/graph/python_requires.py b/conans/client/graph/python_requires.py
--- a/conans/client/graph/python_requires.py
+++ b/conans/client/graph/python_requires.py
@@ -94,7 +94,7 @@ def load_py_requires(self, conanfile, lock_python_requires, loader):
             if isinstance(py_requires_extend, str):
                 py_requires_extend = [py_requires_extend, ]
             for p in py_requires_extend:
-                pkg_name, base_class_name = p.split(".")
+                pkg_name, base_class_name = p.rsplit(".", 1)
                 base_class = getattr(py_requires[pkg_name].module, base_class_name)
                 conanfile.__bases__ = (base_class,) + conanfile.__bases__
         conanfile.python_requires = py_requires


Test patch:
diff --git a/conans/test/functional/py_requires/python_requires_test.py b/conans/test/functional/py_requires/python_requires_test.py
--- a/conans/test/functional/py_requires/python_requires_test.py
+++ b/conans/test/functional/py_requires/python_requires_test.py
@@ -54,6 +54,26 @@ class PkgTest(ConanFile):
         self.assertIn("Pkg/0.1@user/testing: Package installed "
                       "69265e58ddc68274e0c5510905003ff78c9db5de", client.out)
 
+    def reuse_dot_test(self):
+        client = TestClient(default_server_user=True)
+        conanfile = textwrap.dedent("""
+            from conans import ConanFile
+            class MyConanfileBase(ConanFile):
+                def build(self):
+                    self.output.info("My cool build!")
+            """)
+        client.save({"conanfile.py": conanfile})
+        client.run("export . my.base/1.1@user/testing")
+        reuse = textwrap.dedent("""
+            from conans import ConanFile
+            class PkgTest(ConanFile):
+                python_requires = "my.base/1.1@user/testing"
+                python_requires_extend = "my.base.MyConanfileBase"
+            """)
+        client.save({"conanfile.py": reuse}, clean_first=True)
+        client.run("create . Pkg/0.1@user/testing")
+        self.assertIn("Pkg/0.1@user/testing: My cool build!", client.out)
+
     def with_alias_test(self):
         client = TestClient()
         self._define_base(client)
Repository: conan-io/conan

Issue:
[feature] Confusing error message when typo in profile
I had a typo in my profile file:

```
includes(cmake_3_16)

[build_requires]
doxygen/1.8.15@company/stable
```

Where it should have been `include` instead of `includes`. 
When running Conan, I got the following error message:

```
ERROR: Error reading 'documentation' profile: Error parsing the profile text file: not enough values to unpack (expected 2, got 1)
```

At least I knew that something is wrong with the profile, but the error message was a bit misleading
A more helpful message could have been:

```
ERROR: Error reading 'documentation' profile: Error parsing the profile text file: includes is not a valid keyword
```
or something similar.

### Environment Details (include every applicable attribute)
  * Conan version: 1.24.1



Discussion:
Thanks for reporting it. I think it should be easy to identify this error and provide a better message. Thanks!

Resolving patch:
diff --git a/conans/client/profile_loader.py b/conans/client/profile_loader.py
--- a/conans/client/profile_loader.py
+++ b/conans/client/profile_loader.py
@@ -38,7 +38,10 @@ def __init__(self, text):
                 include = include[:-1]
                 self.includes.append(include)
             else:
-                name, value = line.split("=", 1)
+                try:
+                    name, value = line.split("=", 1)
+                except ValueError as error:
+                    raise ConanException("Error while parsing line %i: '%s'" % (counter, line))
                 name = name.strip()
                 if " " in name:
                     raise ConanException("The names of the variables cannot contain spaces")


Test patch:
diff --git a/conans/test/functional/command/install/install_test.py b/conans/test/functional/command/install/install_test.py
--- a/conans/test/functional/command/install/install_test.py
+++ b/conans/test/functional/command/install/install_test.py
@@ -488,7 +488,7 @@ def requirements(self):
         client.run("install . -pr=myotherprofile")
         self.assertIn("PKGOS=FreeBSD", client.out)
         client.run("install . -pr=./myotherprofile", assert_error=True)
-        self.assertIn("Error parsing the profile", client.out)
+        self.assertIn("Error while parsing line 0", client.out)
 
     def install_with_path_errors_test(self):
         client = TestClient()
diff --git a/conans/test/unittests/client/profile_loader/profile_loader_test.py b/conans/test/unittests/client/profile_loader/profile_loader_test.py
--- a/conans/test/unittests/client/profile_loader/profile_loader_test.py
+++ b/conans/test/unittests/client/profile_loader/profile_loader_test.py
@@ -66,6 +66,17 @@ def test_parser(self):
 os=thing""")
 
 
+        txt = """
+includes(a/path/to\profile.txt)
+"""
+        with self.assertRaises(ConanException):
+            try:
+                ProfileParser(txt)
+            except Exception as error:
+                self.assertIn("Error while parsing line 1", error.args[0])
+                raise
+
+
 class ProfileTest(unittest.TestCase):
 
     def profile_loads_test(self):
Repository: conan-io/conan

Issue:
[bug] Neutrino OS version not updated
The compiler was updated to match with the new QNX Neutrino release but I forgot to update the actual OS version


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
@@ -53,7 +53,7 @@
             board: ANY
         Emscripten:
         Neutrino:
-            version: ["6.4", "6.5", "6.6", "7.0"]
+            version: ["6.4", "6.5", "6.6", "7.0", "7.1"]
     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:
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
@@ -1445,7 +1445,7 @@
         board: ANY
     Emscripten:
     Neutrino:
-        version: ["6.4", "6.5", "6.6", "7.0"]
+        version: ["6.4", "6.5", "6.6", "7.0", "7.1"]
 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:


Test patch:
Repository: conan-io/conan

Issue:
[feature] Raise ConanInvalidConfiguration from recipes constraining settings
From here: https://github.com/conan-io/conan/issues/6534

When a recipe is constraining the settings, it should raise a `ConanInvalidConfiguration` if the value provided doesn't satisfy the values allowed by the recipe:

```python
class Recipes(ConanFile):
    ...
    settings = {"os" : ["Windows"]}
```

Right now the output is a regular error that is pointing to a misleading Q&A

```
ERROR: Error while initializing settings. Invalid setting 'Macos' is not a valid 'settings.os' value.
Possible values are ['Windows']
Read "http://docs.conan.io/en/latest/faq/troubleshooting.html#error-invalid-setting"
```




Discussion:
Conan is capturing and raising again the exception as `ConanInvalidConfiguration` 🎉 

https://github.com/conan-io/conan/blob/cf4cab6f9fc95ada3b69796f6de615b4d79ed1ff/conans/model/conan_file.py#L71

Here only the message with the link is misleading.
> Here only the message with the link is misleading.

I think the problem is that this message is common also for the case when settings are initialized with wrong values from dowsntream (profiles), so might not be straightforward to change that message, but the exception to be captured in Settings class.
It should be easy to update the message in the linked line just to say that the recipe is constraining the settings, it is not something in the `settings.yml` file. Or maybe it is enough to update the docs Q&A section to tell about this situation causing this error. Anyway, if we add this issue to a release, it should be quite straightforward to improve the message and/or docs.
Hello @memsharded  and @jgsogo  I would like to work on this issue :) 
You are welcome, @sdmg15 ! Waiting for the pull-request, let us know if you need any help.

Thanks!

Resolving patch:
diff --git a/conans/model/conan_file.py b/conans/model/conan_file.py
--- a/conans/model/conan_file.py
+++ b/conans/model/conan_file.py
@@ -69,7 +69,7 @@ def create_settings(conanfile, settings):
         settings.constraint(current)
         return settings
     except Exception as e:
-        raise ConanInvalidConfiguration("Error while initializing settings. %s" % str(e))
+        raise ConanInvalidConfiguration("The recipe is contraining settings. %s" % str(e))
 
 
 @contextmanager


Test patch:
diff --git a/conans/test/conan_v2/settings_model/test_cppstd.py b/conans/test/conan_v2/settings_model/test_cppstd.py
--- a/conans/test/conan_v2/settings_model/test_cppstd.py
+++ b/conans/test/conan_v2/settings_model/test_cppstd.py
@@ -30,7 +30,7 @@ class Recipe(ConanFile):
         if use_settings_v1:
             self.assertIn("Conan v2 incompatible: Setting 'cppstd' is deprecated", t.out)
         else:
-            self.assertIn("ERROR: Error while initializing settings. 'settings.cppstd' doesn't exist", t.out)
+            self.assertIn("ERROR: The recipe is contraining settings. 'settings.cppstd' doesn't exist", t.out)
 
     @parameterized.expand([(True,), (False,)])
     def test_settings_model(self, use_settings_v1):
Repository: conan-io/conan

Issue:
[bug] Spurious '-find' argument to XCRun
<!--
  Please don't forget to update the issue title.
  Include all applicable information to help us reproduce your problem.

  To help us debug your issue please explain:
-->

### Environment Details (include every applicable attribute)
  * Operating System+version: Linux / Mac OS X
  * Compiler+version: clang 10.0
  * Conan version: 1.32.1
  * Python version: 3.8.5

### Steps to reproduce (Include if Applicable)
Attempt to cross-compile boost with `compiler=apple-clang` in the profile on Linux using the [osxcross](https://github.com/tpoechtrager/osxcross) toolchain.

### Logs (Executed commands with output) (Include/Attach if Applicable)

```
ERROR: boost/1.75.0: Error in build() method, line 649
	self._create_user_config_jam(self._boost_build_dir)
while calling '_create_user_config_jam', line 1003
	contents += " -isysroot %s" % tools.XCRun(self.settings).sdk_path
	CalledProcessErrorWithStderr: Command 'xcrun -find -sdk macosx --show-sdk-path' returned non-zero exit status 1.
```

The Boost recipe attempts to run `xcrun -find -sdk macosx --show-sdk-path` which is an illegal command line. Tthe original Apple `xcrun` tool just ignores the superfluous `-find`, but the osxcross one silently errors out with return code 1.

To fix this, the `-find` argument should be removed from
```python
    def _invoke(self, args):
        def cmd_output(cmd):
            return check_output_runner(cmd).strip()

        command = ['xcrun', '-find']
        if self.sdk:
            command.extend(['-sdk', self.sdk])
        command.extend(args)
        return cmd_output(command)
```
in the `apple.py` file. The `find` function already adds the `--find` argument when finding tools. I'll submit a PR.


Discussion:

Resolving patch:
diff --git a/conans/client/tools/apple.py b/conans/client/tools/apple.py
--- a/conans/client/tools/apple.py
+++ b/conans/client/tools/apple.py
@@ -74,7 +74,7 @@ def _invoke(self, args):
         def cmd_output(cmd):
             return check_output_runner(cmd).strip()
 
-        command = ['xcrun', '-find']
+        command = ['xcrun']
         if self.sdk:
             command.extend(['-sdk', self.sdk])
         command.extend(args)


Test patch:
Repository: conan-io/conan

Issue:
[bug] conan remove --outdated works with a pattern too
Duplicated issue of https://github.com/conan-io/docs/issues/1987 to make the changes to the source code as well


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
@@ -1091,7 +1091,7 @@ def remove(self, *args):
                             help="Remove locks")
         parser.add_argument("-o", "--outdated", default=False, action="store_true",
                             help="Remove only outdated from recipe packages. "
-                                 "This flag can only be used with a reference")
+                                 "This flag can only be used with a pattern or a reference")
         parser.add_argument('-p', '--packages', nargs="*", action=Extender,
                             help="Remove all packages of the specified reference if "
                                  "no specific package ID is provided")


Test patch: