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

Issue:
[question] Abseil: Path length error when building grpc
Hi!

I tried building gRPC with the inexorgame ([see my message in the grpc recipe issue tracker](https://github.com/inexorgame/conan-grpc/issues/38#issuecomment-779870162)) recipe, but `abseil` prevents me from building it because it doesn't have the `short_paths` option set to `True`. Is that an error that should be fixed in abseil or an error with the grpc recipe?


Discussion:
Long paths errors can randomly happen on Windows if long paths is not enabled, it depends of username length. I guess you have a long username. If you have admin rights, enable long paths. Otherwise, you may want to globally enable short_paths in conan.conf
My username is actually 7 characters long, so I don't think it's a lot.

I didn't know about the conan.conf option, I'll try it, thanks!

Should we consider the abseil thing to be a bug in the abseil recipe? I guess having a 7 chars long username is not that uncommon.
I would say that short_paths True or False in a recipe is never a bug, it's a workaround for windows users who can't enable long paths in Windows.

But yes, I guess that short_paths could be enabled in abseil recipe.
Should I submit a PR for that?

Sorry for asking silly questions, I want to make sure I got it right :)
Sure

Resolving patch:
diff --git a/recipes/abseil/all/conanfile.py b/recipes/abseil/all/conanfile.py
--- a/recipes/abseil/all/conanfile.py
+++ b/recipes/abseil/all/conanfile.py
@@ -19,6 +19,7 @@ class ConanRecipe(ConanFile):
 
     exports_sources = ["CMakeLists.txt", "patches/**"]
     generators = "cmake"
+    short_paths = True
 
     settings = "os", "arch", "compiler", "build_type"
     options = {"fPIC": [True, False]}


Test patch:
Repository: conan-io/conan-center-index

Issue:
[package] odbc/2.3.7: sysconfdir is in Conan local cache
<!-- 
  Please don't forget to update the issue title.
  Include all applicable information to help us reproduce your problem.
-->

### Package and Environment Details (include every applicable attribute)
  * Package Name/Version: **odbc/2.3.7**

### Steps to reproduce (Include if Applicable)

The odbc library has a configuration option called `--sysconfdir` that specifies the default location for configuration files.  By default the value is `${prefix}/etc`.  The problem is that `${prefix}` ends up being a location in the Conan local cache, for example:
```
/userhome/epederson/.conan/data/odbc/2.3.7/bincrafters/stable/package/761432f3453a17c960259b5b2605153e3bcffd7d/etc
```
This location is only valid on the machine that the package was built on.  

The typical value for `sysconfdir` is `/etc`.  

I will provide a PR that adds `--sysconfdir=/etc` to the configuration settings.


Discussion:

Resolving patch:
diff --git a/recipes/odbc/all/conanfile.py b/recipes/odbc/all/conanfile.py
--- a/recipes/odbc/all/conanfile.py
+++ b/recipes/odbc/all/conanfile.py
@@ -57,7 +57,8 @@ def _configure_autotools(self):
         args = ["--enable-static=%s" % static_flag,
                 "--enable-shared=%s" % shared_flag,
                 "--enable-ltdl-install",
-                "--enable-iconv=%s" % libiconv_flag]
+                "--enable-iconv=%s" % libiconv_flag,
+                "--sysconfdir=/etc"]
         if self.options.with_libiconv:
             libiconv_prefix = self.deps_cpp_info["libiconv"].rootpath
             args.append("--with-libiconv-prefix=%s" % libiconv_prefix)


Test patch:
Repository: conan-io/conan-center-index

Issue:
[package] qt/6.x.x: Missing QmlImportScanner component
The QmlImportScanner target (which looks like an alias to Qt6Qml to me) is missing, leading to failed builds if they rely on it.


Discussion:
we already declare [`qmlimportscanner`](https://github.com/conan-io/conan-center-index/blob/master/recipes/qt/6.x.x/conanfile.py#L555). Do we miss an alias with different casing ? Do you think it's the same for all the other targets declared in https://github.com/conan-io/conan-center-index/blob/master/recipes/qt/6.x.x/conanfile.py#L543-L556 ?
Will check I think it is casing indeed.

Resolving patch:
diff --git a/recipes/qt/6.x.x/conanfile.py b/recipes/qt/6.x.x/conanfile.py
--- a/recipes/qt/6.x.x/conanfile.py
+++ b/recipes/qt/6.x.x/conanfile.py
@@ -673,6 +673,9 @@ def _create_plugin(pluginname, libname, type, requires):
         if self.options.qtdeclarative:
             _create_module("Qml", ["Network"])
             _create_module("QmlModels", ["Qml"])
+            self.cpp_info.components["qtQmlImportScanner"].names["cmake_find_package"] = "QmlImportScanner" # this is an alias for Qml and there to integrate with existing consumers
+            self.cpp_info.components["qtQmlImportScanner"].names["cmake_find_package_multi"] = "QmlImportScanner"
+            self.cpp_info.components["qtQmlImportScanner"].requires = _get_corrected_reqs(["Qml"])
             if self.options.gui:
                 _create_module("Quick", ["Gui", "Qml", "QmlModels"])
                 if self.options.widgets:


Test patch:
Repository: conan-io/conan-center-index

Issue:
[request] fff/1.1.0
### Package Details
  * Package Name/Version: **fff/1.1.0**
  * Website: **https://github.com/meekrosoft/fff**
  * Source code: **https://github.com/meekrosoft/fff**


### Description Of The Library / Tool
A testing micro framework for creating function test doubles


Discussion:

Resolving patch:
diff --git a/recipes/fff/all/conanfile.py b/recipes/fff/all/conanfile.py
new file mode 100644
--- /dev/null
+++ b/recipes/fff/all/conanfile.py
@@ -0,0 +1,26 @@
+from conans import ConanFile, tools
+import os
+
+class TypeSafe(ConanFile):
+    name = 'fff'
+    description = 'A testing micro framework for creating function test doubles'
+    url = 'https://github.com/conan-io/conan-center-index'
+    homepage = 'https://github.com/meekrosoft/fff'
+    license = 'MIT'
+    topics = 'conan', 'c', 'c++', 'embedded', 'tdd', 'micro-framework', 'fake-functions'
+
+    no_copy_source = True
+
+    @property
+    def _source_subfolder(self):
+        return "source_subfolder"
+
+    def source(self):
+        tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder)
+
+    def package(self):
+        self.copy("LICENSE*", dst="licenses", src=self._source_subfolder)
+        self.copy("fff.h", dst="include", src=self._source_subfolder)
+
+    def package_id(self):
+        self.info.header_only()


Test patch:
diff --git a/recipes/fff/all/test_package/CMakeLists.txt b/recipes/fff/all/test_package/CMakeLists.txt
new file mode 100644
--- /dev/null
+++ b/recipes/fff/all/test_package/CMakeLists.txt
@@ -0,0 +1,8 @@
+cmake_minimum_required(VERSION 3.1)
+project(test_package)
+
+include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
+conan_basic_setup()
+
+add_executable(${PROJECT_NAME} test_package.cpp)
+target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS})
diff --git a/recipes/fff/all/test_package/conanfile.py b/recipes/fff/all/test_package/conanfile.py
new file mode 100644
--- /dev/null
+++ b/recipes/fff/all/test_package/conanfile.py
@@ -0,0 +1,17 @@
+from conans import ConanFile, CMake, tools
+import os
+
+
+class TestPackageConan(ConanFile):
+    settings = "os", "compiler", "build_type", "arch"
+    generators = "cmake"
+
+    def build(self):
+        cmake = CMake(self)
+        cmake.configure()
+        cmake.build()
+
+    def test(self):
+        if not tools.cross_building(self.settings):
+            bin_path = os.path.join("bin", "test_package")
+            self.run(bin_path, run_environment=True)
diff --git a/recipes/fff/all/test_package/test_package.cpp b/recipes/fff/all/test_package/test_package.cpp
new file mode 100644
--- /dev/null
+++ b/recipes/fff/all/test_package/test_package.cpp
@@ -0,0 +1,16 @@
+#include <stdint.h>
+#include "fff.h"
+
+DEFINE_FFF_GLOBALS;
+
+FAKE_VOID_FUNC(TestFunction, uint32_t, uint8_t);
+
+int main()
+{
+   RESET_FAKE(TestFunction);
+   FFF_RESET_HISTORY();
+   
+   TestFunction(8, 16);
+   
+   return 0;
+}
Repository: conan-io/conan-center-index

Issue:
[package] qt/6.x.x: Missing platform plugins
The qt recipe does not include the platform plugins. Ref. https://doc.qt.io/qt-6/qpa.html and https://github.com/qt/qtbase/tree/dev/src/plugins/platforms



Discussion:

Resolving patch:
diff --git a/recipes/qt/6.x.x/conanfile.py b/recipes/qt/6.x.x/conanfile.py
--- a/recipes/qt/6.x.x/conanfile.py
+++ b/recipes/qt/6.x.x/conanfile.py
@@ -10,13 +10,32 @@
 
 
 class qt(Generator):
+    @staticmethod
+    def content_template(path, folder):
+        return textwrap.dedent("""\
+            [Paths]
+            Prefix = {0}
+            ArchData = {1}/archdatadir
+            HostData = {1}/archdatadir
+            Data = {1}/datadir
+            Sysconf = {1}/sysconfdir
+            LibraryExecutables = {1}/archdatadir/bin
+            Plugins = {1}/archdatadir/plugins
+            Imports = {1}/archdatadir/imports
+            Qml2Imports = {1}/archdatadir/qml
+            Translations = {1}/datadir/translations
+            Documentation = {1}/datadir/doc
+            Examples = {1}/datadir/examples""").format(path, folder)
+
     @property
     def filename(self):
         return "qt.conf"
 
     @property
     def content(self):
-        return "[Paths]\nPrefix = %s\n" % self.conanfile.deps_cpp_info["qt"].rootpath.replace("\\", "/")
+        return qt.content_template(
+            self.conanfile.deps_cpp_info["qt"].rootpath.replace("\\", "/"),
+            "res")
 
 
 class QtConan(ConanFile):
@@ -503,19 +522,7 @@ def package(self):
         cmake = self._configure_cmake()
         cmake.install()
         with open(os.path.join(self.package_folder, "bin", "qt.conf"), "w") as f:
-            f.write(textwrap.dedent("""[Paths]
-                Prefix = ..
-                ArchData = res/archdatadir
-                HostData = res/archdatadir
-                Data = res/datadir
-                Sysconf = res/sysconfdir
-                LibraryExecutables = res/archdatadir/bin
-                Plugins = res/archdatadir/plugins
-                Imports = res/archdatadir/imports
-                Qml2Imports = res/archdatadir/qml
-                Translations = res/datadir/translations
-                Documentation = res/datadir/doc
-                Examples = res/datadir/examples"""))
+            f.write(qt.content_template("..", "res"))
         self.copy("*LICENSE*", src="qt6/", dst="licenses")
         for module in self._submodules:
             if not self.options.get_safe(module):


Test patch:
Repository: conan-io/conan-center-index

Issue:
[package] fontconfig/2.13.93: Please make gettext dependency optional
### Package and Environment Details (include every applicable attribute)
  * Package Name/Version: **fontconfig/2.13.93**
  * Operating System+version: **MacOs**

The current recipe adds an unconditional dependency on libgettext/0.20.1 on MacOs.

Since libgettext is licensed under GPLv3, it places an additional license restriction to an otherwise more liberally licensed library.

</details>



Discussion:

Resolving patch:
diff --git a/recipes/fontconfig/all/conanfile.py b/recipes/fontconfig/all/conanfile.py
--- a/recipes/fontconfig/all/conanfile.py
+++ b/recipes/fontconfig/all/conanfile.py
@@ -40,8 +40,6 @@ def requirements(self):
         self.requires("expat/2.2.10")
         if self.settings.os == "Linux":
             self.requires("libuuid/1.0.3")
-        elif self.settings.os == "Macos":
-            self.requires("libgettext/0.20.1")
 
     def build_requirements(self):
         self.build_requires("gperf/3.1")
@@ -58,7 +56,9 @@ def _configure_autotools(self):
         if not self._autotools:
             args = ["--enable-static=%s" % ("no" if self.options.shared else "yes"),
                     "--enable-shared=%s" % ("yes" if self.options.shared else "no"),
-                    "--disable-docs"]
+                    "--disable-docs",
+                    "--disable-nls",
+                   ]
             args.append("--sysconfdir=%s" % tools.unix_path(os.path.join(self.package_folder, "bin", "etc")))
             args.append("--datadir=%s" % tools.unix_path(os.path.join(self.package_folder, "bin", "share")))
             args.append("--datarootdir=%s" % tools.unix_path(os.path.join(self.package_folder, "bin", "share")))


Test patch:
Repository: conan-io/conan-center-index

Issue:
[package] Boost/1.69: Can't build from source, URL pointing to old/removed boost.org server
After Bintray sunset, the Boost recipe is pointing to an old, non-existing place.
Recipe should be updated to point to boost.org new download site (boostorg.jfrog.io)


Discussion:
https://github.com/conan-io/conan/issues/8908
The boost recipe uses three mirrors, one of them being Bintray. Bintray should get removed now, but the source download should not fail even with it

https://github.com/conan-io/conan-center-index/blob/a10f21fe90cb2406f71773d01d81e8a699d41232/recipes/boost/all/conandata.yml#L4
>  the source download should not fail even with it

Right - but it does fail. Perhaps 403 is treated differently than a 404?

Resolving patch:
diff --git a/recipes/boost/all/conanfile.py b/recipes/boost/all/conanfile.py
--- a/recipes/boost/all/conanfile.py
+++ b/recipes/boost/all/conanfile.py
@@ -432,7 +432,7 @@ def requirements(self):
         if self._with_lzma:
             self.requires("xz_utils/5.2.5")
         if self._with_zstd:
-            self.requires("zstd/1.4.8")
+            self.requires("zstd/1.4.9")
 
         if self._with_icu:
             self.requires("icu/68.2")


Test patch:
Repository: conan-io/conan-center-index

Issue:
[package] all: "Access is denied" in os.rename() on Windows
### Package and Environment Details (include every applicable attribute)
  * Package Name/Version: **almost all packages affected**
  * Operating System+version: **Windows 10**
  * Compiler+version: **MSVC 16**
  * Conan version: **conan 1.35.2**
  * Python version: **Python 3.8.7**


### Conan profile (output of `conan profile show default` or `conan profile show <profile>` if custom profile is in use)
```
[settings]
os_build=Windows
os=Windows
arch=x86_64
arch_build=x86_64
compiler=Visual Studio
compiler.version=16
compiler.runtime=MD
build_type=Release
```

### Steps to reproduce (Include if Applicable)

This is a known issue. Solution provided by https://github.com/conan-io/conan/pull/6774
However most recipes still use `os.rename()` and not `tools.rename()`. 

### Log
```
b2/4.2.0: Configuring sources in C:\Users\xxx\.conan\data\b2\4.2.0\_\_\source
ERROR: b2/4.2.0: Error in source() method, line 58
os.rename(extracted_dir, "source")
PermissionError: [WinError 5] Access is denied: 'build-4.2.0' -> 'source'
```



Discussion:
@klimkin Thank you for reporting, we can add it to Hooks and prevent future errors. 

Resolving patch:
diff --git a/recipes/libiconv/all/conanfile.py b/recipes/libiconv/all/conanfile.py
--- a/recipes/libiconv/all/conanfile.py
+++ b/recipes/libiconv/all/conanfile.py
@@ -44,9 +44,7 @@ def build_requirements(self):
             self.build_requires("msys2/20200517")
 
     def source(self):
-        tools.get(**self.conan_data["sources"][self.version])
-        archive_name = "{0}-{1}".format(self.name, self.version)
-        os.rename(archive_name, self._source_subfolder)
+        tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True)
 
     @contextmanager
     def _build_context(self):
@@ -131,8 +129,8 @@ def package(self):
 
         if self._is_msvc and self.options.shared:
             for import_lib in ["iconv", "charset"]:
-                os.rename(os.path.join(self.package_folder, "lib", "{}.dll.lib".format(import_lib)),
-                          os.path.join(self.package_folder, "lib", "{}.lib".format(import_lib)))
+                tools.rename(os.path.join(self.package_folder, "lib", "{}.dll.lib".format(import_lib)),
+                             os.path.join(self.package_folder, "lib", "{}.lib".format(import_lib)))
 
     def package_info(self):
         self.cpp_info.names["cmake_find_package"] = "Iconv"


Test patch:
Repository: conan-io/conan-center-index

Issue:
[package] all: "Access is denied" in os.rename() on Windows
### Package and Environment Details (include every applicable attribute)
  * Package Name/Version: **almost all packages affected**
  * Operating System+version: **Windows 10**
  * Compiler+version: **MSVC 16**
  * Conan version: **conan 1.35.2**
  * Python version: **Python 3.8.7**


### Conan profile (output of `conan profile show default` or `conan profile show <profile>` if custom profile is in use)
```
[settings]
os_build=Windows
os=Windows
arch=x86_64
arch_build=x86_64
compiler=Visual Studio
compiler.version=16
compiler.runtime=MD
build_type=Release
```

### Steps to reproduce (Include if Applicable)

This is a known issue. Solution provided by https://github.com/conan-io/conan/pull/6774
However most recipes still use `os.rename()` and not `tools.rename()`. 

### Log
```
b2/4.2.0: Configuring sources in C:\Users\xxx\.conan\data\b2\4.2.0\_\_\source
ERROR: b2/4.2.0: Error in source() method, line 58
os.rename(extracted_dir, "source")
PermissionError: [WinError 5] Access is denied: 'build-4.2.0' -> 'source'
```



Discussion:
@klimkin Thank you for reporting, we can add it to Hooks and prevent future errors. 

Resolving patch:
diff --git a/recipes/bzip2/all/conanfile.py b/recipes/bzip2/all/conanfile.py
--- a/recipes/bzip2/all/conanfile.py
+++ b/recipes/bzip2/all/conanfile.py
@@ -45,9 +45,7 @@ def configure(self):
         del self.settings.compiler.cppstd
 
     def source(self):
-        tools.get(**self.conan_data["sources"][self.version])
-        folder_name = "%s-%s" % (self.name, self.version)
-        os.rename(folder_name, self._source_subfolder)
+        tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True)
 
     def _configure_cmake(self):
         if self._cmake:


Test patch:
Repository: conan-io/conan-center-index

Issue:
[package] all: "Access is denied" in os.rename() on Windows
### Package and Environment Details (include every applicable attribute)
  * Package Name/Version: **almost all packages affected**
  * Operating System+version: **Windows 10**
  * Compiler+version: **MSVC 16**
  * Conan version: **conan 1.35.2**
  * Python version: **Python 3.8.7**


### Conan profile (output of `conan profile show default` or `conan profile show <profile>` if custom profile is in use)
```
[settings]
os_build=Windows
os=Windows
arch=x86_64
arch_build=x86_64
compiler=Visual Studio
compiler.version=16
compiler.runtime=MD
build_type=Release
```

### Steps to reproduce (Include if Applicable)

This is a known issue. Solution provided by https://github.com/conan-io/conan/pull/6774
However most recipes still use `os.rename()` and not `tools.rename()`. 

### Log
```
b2/4.2.0: Configuring sources in C:\Users\xxx\.conan\data\b2\4.2.0\_\_\source
ERROR: b2/4.2.0: Error in source() method, line 58
os.rename(extracted_dir, "source")
PermissionError: [WinError 5] Access is denied: 'build-4.2.0' -> 'source'
```



Discussion:
@klimkin Thank you for reporting, we can add it to Hooks and prevent future errors. 

Resolving patch:
diff --git a/recipes/sqlite3/all/conanfile.py b/recipes/sqlite3/all/conanfile.py
--- a/recipes/sqlite3/all/conanfile.py
+++ b/recipes/sqlite3/all/conanfile.py
@@ -87,11 +87,7 @@ def configure(self):
         del self.settings.compiler.cppstd
 
     def source(self):
-        tools.get(**self.conan_data["sources"][self.version])
-        url = self.conan_data["sources"][self.version]["url"]
-        archive_name = os.path.basename(url)
-        archive_name = os.path.splitext(archive_name)[0]
-        os.rename(archive_name, self._source_subfolder)
+        tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True)
 
     def _configure_cmake(self):
         if self._cmake:


Test patch:
Repository: conan-io/conan-center-index

Issue:
[package] all: "Access is denied" in os.rename() on Windows
### Package and Environment Details (include every applicable attribute)
  * Package Name/Version: **almost all packages affected**
  * Operating System+version: **Windows 10**
  * Compiler+version: **MSVC 16**
  * Conan version: **conan 1.35.2**
  * Python version: **Python 3.8.7**


### Conan profile (output of `conan profile show default` or `conan profile show <profile>` if custom profile is in use)
```
[settings]
os_build=Windows
os=Windows
arch=x86_64
arch_build=x86_64
compiler=Visual Studio
compiler.version=16
compiler.runtime=MD
build_type=Release
```

### Steps to reproduce (Include if Applicable)

This is a known issue. Solution provided by https://github.com/conan-io/conan/pull/6774
However most recipes still use `os.rename()` and not `tools.rename()`. 

### Log
```
b2/4.2.0: Configuring sources in C:\Users\xxx\.conan\data\b2\4.2.0\_\_\source
ERROR: b2/4.2.0: Error in source() method, line 58
os.rename(extracted_dir, "source")
PermissionError: [WinError 5] Access is denied: 'build-4.2.0' -> 'source'
```



Discussion:
@klimkin Thank you for reporting, we can add it to Hooks and prevent future errors. 

Resolving patch:
diff --git a/recipes/zulu-openjdk/all/conanfile.py b/recipes/zulu-openjdk/all/conanfile.py
--- a/recipes/zulu-openjdk/all/conanfile.py
+++ b/recipes/zulu-openjdk/all/conanfile.py
@@ -28,10 +28,8 @@ def configure(self):
             raise ConanInvalidConfiguration("Unsupported os. This package currently only support Linux/Macos/Windows")
 
     def source(self):
-        url = self.conan_data["sources"][self.version]["url"][str(self.settings.os)]
-        checksum = self.conan_data["sources"][self.version]["sha256"][str(self.settings.os)]
-        tools.get(url, sha256=checksum)
-        os.rename(glob.glob("zulu*")[0], self._source_subfolder)
+        tools.get(**self.conan_data["sources"][self.version][str(self.settings.os)],
+                  destination=self._source_subfolder, strip_root=True)
 
     def build(self):
         pass # nothing to do, but this shall trigger no warnings ;-)


Test patch:
Repository: conan-io/conan-center-index

Issue:
[request] autoconf/2.71
### Package Details
  * Package Name/Version: **autoconf/2.71**
  * Changelog: **https://lists.gnu.org/archive/html/autoconf/2021-01/msg00126.html**

contains an essential fix for e2k (Elbrus): https://lists.gnu.org/archive/html/config-patches/2015-03/msg00000.html

/cc @madebr @r-a-sattarov

The above mentioned version is newly released by the upstream project and not yet available as a recipe. Please add this version.



Discussion:
Thanks for the heads-up.
Somehow we missed 2.70 last december

Resolving patch:
diff --git a/recipes/autoconf/all/conanfile.py b/recipes/autoconf/all/conanfile.py
--- a/recipes/autoconf/all/conanfile.py
+++ b/recipes/autoconf/all/conanfile.py
@@ -59,7 +59,7 @@ def _configure_autotools(self):
         return self._autotools
 
     def _patch_files(self):
-        for patch in self.conan_data["patches"][self.version]:
+        for patch in self.conan_data.get("patches", {}).get(self.version, []):
             tools.patch(**patch)
 
     def build(self):


Test patch: