nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: conan-io/conan
Pull request #12491 (2022-11-08 15:24:49)

Add target argument to Autotools.install()
Changelog: Feature: Add target argument to Autotools.install()
Docs: TODO

Closes: https://github.com/conan-io/conan/issues/12470



Patch:
diff --git a/conan/tools/gnu/autotools.py b/conan/tools/gnu/autotools.py
index f857321a9..1992ba20d 100644
--- a/conan/tools/gnu/autotools.py
+++ b/conan/tools/gnu/autotools.py
@@ -55,10 +55,10 @@ class Autotools(object):
         command = join_arguments([make_program, target, str_args, str_extra_args, jobs])
         self._conanfile.run(command)
 
-    def install(self, args=None):
+    def install(self, args=None, target="install"):
         args = args if args is not None else \
             ["DESTDIR={}".format(unix_path(self._conanfile, self._conanfile.package_folder))]
-        self.make(target="install", args=args)
+        self.make(target=target, args=args)
 
     def autoreconf(self, args=None):
         args = args or []


Test patch:
diff --git a/conans/test/unittests/client/toolchain/autotools/autotools_test.py b/conans/test/unittests/client/toolchain/autotools/autotools_test.py
index 36d3b0078..50bcf91a4 100644
--- a/conans/test/unittests/client/toolchain/autotools/autotools_test.py
+++ b/conans/test/unittests/client/toolchain/autotools/autotools_test.py
@@ -34,3 +34,10 @@ def test_configure_arguments():
     ab.make()
     assert "my_make my_make_args -j23" in runner.command_called
 
+    # test install target argument
+
+    ab.install()
+    assert 'my_make install my_make_args DESTDIR=None -j23' in runner.command_called
+
+    ab.install(target="install_other")
+    assert 'my_make install_other my_make_args DESTDIR=None -j23' in runner.command_called
Repository: conan-io/conan
Pull request #12509 (2022-11-11 08:33:23)

Add cli_args argument to CMake build helper configure method
Changelog: Feature: Add cli_args argument to CMake build helper configure method.
Docs: TODO

Closes: https://github.com/conan-io/conan/issues/12496


Patch:
diff --git a/conan/tools/cmake/cmake.py b/conan/tools/cmake/cmake.py
index 716e6afd1..cdd07fb27 100644
--- a/conan/tools/cmake/cmake.py
+++ b/conan/tools/cmake/cmake.py
@@ -61,7 +61,7 @@ class CMake(object):
 
         self._cmake_program = "cmake"  # Path to CMake should be handled by environment
 
-    def configure(self, variables=None, build_script_folder=None):
+    def configure(self, variables=None, build_script_folder=None, cli_args=None):
         cmakelist_folder = self._conanfile.source_folder
         if build_script_folder:
             cmakelist_folder = os.path.join(self._conanfile.source_folder, build_script_folder)
@@ -91,6 +91,9 @@ class CMake(object):
         arg_list.extend(['-D{}="{}"'.format(k, v) for k, v in self._cache_variables.items()])
         arg_list.append('"{}"'.format(cmakelist_folder))
 
+        if cli_args:
+            arg_list.extend(cli_args)
+
         command = " ".join(arg_list)
         self._conanfile.output.info("CMake command: %s" % command)
         with chdir(self, build_folder):


Test patch:
diff --git a/conans/test/unittests/tools/cmake/test_cmake_test.py b/conans/test/unittests/tools/cmake/test_cmake_test.py
index 3e852b10d..24a3e2d38 100644
--- a/conans/test/unittests/tools/cmake/test_cmake_test.py
+++ b/conans/test/unittests/tools/cmake/test_cmake_test.py
@@ -43,3 +43,18 @@ def test_run_tests(generator, target):
 
     search_pattern = "--target {}" if platform.system() == "Windows" else "'--target' '{}'"
     assert search_pattern.format(target) in conanfile.command
+
+
+def test_cli_args_configure():
+    settings = Settings.loads(get_default_settings_yml())
+
+    conanfile = ConanFileMock()
+    conanfile.conf = Conf()
+    conanfile.folders.generators = "."
+    conanfile.folders.set_base_generators(temp_folder())
+    conanfile.settings = settings
+
+    write_cmake_presets(conanfile, "toolchain", "Unix Makefiles", {})
+    cmake = CMake(conanfile)
+    cmake.configure(cli_args=["--graphviz=foo.dot"])
+    assert "--graphviz=foo.dot" in conanfile.command
Repository: conan-io/conan
Pull request #12518 (2022-11-11 19:19:00)

remove the -s from compiler flags
Changelog: Fix: Remove the extra ``-s`` from default build_type compiler flags, added to modern ``AutotoolsToolchain``
Docs: Omit

Close https://github.com/conan-io/conan/issues/12479



Patch:
diff --git a/conan/tools/_compilers.py b/conan/tools/_compilers.py
index a3ab6bc86..a4f6f9da2 100644
--- a/conan/tools/_compilers.py
+++ b/conan/tools/_compilers.py
@@ -150,11 +150,8 @@ def build_type_flags(settings):
         # clang include the gnu (overriding some things, but not build type) and apple clang
         # overrides clang but it doesn't touch clang either
         if str(compiler) in ["clang", "gcc", "apple-clang", "qcc", "mcst-lcc"]:
-            # FIXME: It is not clear that the "-s" is something related with the build type
-            # cmake is not adjusting it
-            # -s: Remove all symbol table and relocation information from the executable.
             flags = {"Debug": ["-g"],
-                     "Release": ["-O3", "-s"] if str(compiler) == "gcc" else ["-O3"],
+                     "Release": ["-O3"],
                      "RelWithDebInfo": ["-O2", "-g"],
                      "MinSizeRel": ["-Os"],
                      }.get(build_type, [])


Test patch:
diff --git a/conans/test/integration/toolchains/gnu/test_autotoolstoolchain.py b/conans/test/integration/toolchains/gnu/test_autotoolstoolchain.py
index 36ede715b..1b9b3269a 100644
--- a/conans/test/integration/toolchains/gnu/test_autotoolstoolchain.py
+++ b/conans/test/integration/toolchains/gnu/test_autotoolstoolchain.py
@@ -34,13 +34,13 @@ def test_extra_flags_via_conf():
     toolchain = client.load("conanautotoolstoolchain{}".format('.bat' if os_ == "Windows" else '.sh'))
     if os_ == "Windows":
         assert 'set "CPPFLAGS=%CPPFLAGS% -DNDEBUG -DDEF1 -DDEF2"' in toolchain
-        assert 'set "CXXFLAGS=%CXXFLAGS% -O3 -s --flag1 --flag2"' in toolchain
-        assert 'set "CFLAGS=%CFLAGS% -O3 -s --flag3 --flag4"' in toolchain
+        assert 'set "CXXFLAGS=%CXXFLAGS% -O3 --flag1 --flag2"' in toolchain
+        assert 'set "CFLAGS=%CFLAGS% -O3 --flag3 --flag4"' in toolchain
         assert 'set "LDFLAGS=%LDFLAGS% --flag5 --flag6"' in toolchain
     else:
         assert 'export CPPFLAGS="$CPPFLAGS -DNDEBUG -DDEF1 -DDEF2"' in toolchain
-        assert 'export CXXFLAGS="$CXXFLAGS -O3 -s --flag1 --flag2"' in toolchain
-        assert 'export CFLAGS="$CFLAGS -O3 -s --flag3 --flag4"' in toolchain
+        assert 'export CXXFLAGS="$CXXFLAGS -O3 --flag1 --flag2"' in toolchain
+        assert 'export CFLAGS="$CFLAGS -O3 --flag3 --flag4"' in toolchain
         assert 'export LDFLAGS="$LDFLAGS --flag5 --flag6"' in toolchain
Repository: conan-io/conan
Pull request #12761 (2022-12-21 17:58:53)

fix comparison of option None
Close https://github.com/conan-io/conan/issues/5634


Patch:
diff --git a/conan/cli/commands/download.py b/conan/cli/commands/download.py
index 0e7b869a8..623356512 100644
--- a/conan/cli/commands/download.py
+++ b/conan/cli/commands/download.py
@@ -24,7 +24,7 @@ def download(conan_api: ConanAPI, parser, *args):
                         help="Only upload packages matching a specific query. e.g: os=Windows AND "
                              "(arch=x86 OR compiler=gcc)")
     parser.add_argument("-r", "--remote", action=OnceArgument, required=True,
-                        help='Upload to this specific remote')
+                        help='Download from this specific remote')
 
     args = parser.parse_args(*args)
     remote = conan_api.remotes.get(args.remote)
diff --git a/conans/model/options.py b/conans/model/options.py
index 669f847ab..0b15427e3 100644
--- a/conans/model/options.py
+++ b/conans/model/options.py
@@ -68,6 +68,8 @@ class _PackageOption:
             return self._value is None
         other = str(other)
         self._check_valid_value(other)
+        if self._value is None:
+            return False  # Other is not None here
         return other == self.__str__()
 
     @property


Test patch:
diff --git a/conans/test/unittests/model/options_test.py b/conans/test/unittests/model/options_test.py
index 0066256a0..2c8bb37de 100644
--- a/conans/test/unittests/model/options_test.py
+++ b/conans/test/unittests/model/options_test.py
@@ -206,6 +206,21 @@ class TestOptionsNone:
         text = self.sut.dumps()
         assert text == ""
 
+    def test_boolean_none(self):
+        options = Options({"static": [None, "None", 1, 2]})
+        assert options.static != 1
+        assert not (options.static == 1)
+        assert options.static != "None"
+        assert not (options.static == "None")
+        assert options.static == None
+        assert not (options.static != None)
+
+        options.static = "None"
+        assert options.static == "None"
+        assert not (options.static != "None")
+        assert not (options.static == None)
+        assert options.static != None
+
 '''
     def test_undefined_value(self):
         """ Not assigning a value to options will raise an error at validate() step
Repository: conan-io/conan
Pull request #12881 (2023-01-10 17:43:14)

AutootolsToolchain: pass a valid GNU triplet when the compiler is msvc
Changelog: Bugfix: Fix bug to pass a valid GNU triplet when using AutotoolsToolchain and cross-building on Windows.
Docs: Omit

Close: https://github.com/conan-io/conan/issues/7460

### Context:
The current implementation of the _private_ `_get_gnu_triplet` returns `x86_64-windows-msvc`. This results in errors when we are cross-building on Windows, since this is not a valid GNU triplet:
```
config.sub x86-64-windows-msvc    
Invalid configuration `x86-64-windows-msvc': OS `msvc' not recognized
```

Specifically for Autotools, the triplet system type is of the format specified [here](https://www.gnu.org/software/autoconf/manual/autoconf-2.68/html_node/System-Type.html#System-Type), where we can have:
* `cpu-company-os`, or
* `cpu-company-kernel-os`

In this context, `msvc` is not a valid OS. There is no current convention in GNU for a proper target when the OS is Windows, and the C/C++ runtime are provided by Visual C++, this PR falls back to a generic `{arch}-unknown-windows`, where windows is a valid OS. This is the a very generic fallback - while  `x86-64-w64-mingw32` may be preferred in some contexts, we don't have enough context to assume it (but could be done in a separate flag), and when Visual C++ with the Microsoft Visual C++ runtime is used, the binaries produced would not strictly be mingw32 binaries.






Patch:
diff --git a/conan/tools/gnu/get_gnu_triplet.py b/conan/tools/gnu/get_gnu_triplet.py
index 951247a68..6adcc6635 100644
--- a/conan/tools/gnu/get_gnu_triplet.py
+++ b/conan/tools/gnu/get_gnu_triplet.py
@@ -67,10 +67,8 @@ def _get_gnu_triplet(os_, arch, compiler=None):
     # Calculate the OS
     if compiler == "gcc":
         windows_op = "w64-mingw32"
-    elif compiler == "msvc":
-        windows_op = "windows-msvc"
     else:
-        windows_op = "windows"
+        windows_op = "unknown-windows"
 
     op_system = {"Windows": windows_op,
                  "Linux": "linux-gnu",


Test patch:
diff --git a/conans/test/unittests/tools/gnu/test_triplets.py b/conans/test/unittests/tools/gnu/test_triplets.py
index d4dd4c4ad..3c97cb24b 100644
--- a/conans/test/unittests/tools/gnu/test_triplets.py
+++ b/conans/test/unittests/tools/gnu/test_triplets.py
@@ -31,7 +31,9 @@ from conans.errors import ConanException
     ["Android", "armv7", None, "arm-linux-androideabi"],
     ["Android", "armv7hf", None, "arm-linux-androideabi"],
     ["Android", "armv8", None, "aarch64-linux-android"],
-    ["Windows", "x86", "msvc", "i686-windows-msvc"],
+    ["Windows", "x86", "msvc", "i686-unknown-windows"],
+    ["Windows", "x86_64", "msvc", "x86_64-unknown-windows"],
+    ["Windows", "armv8", "msvc", "aarch64-unknown-windows"],
     ["Windows", "x86", "gcc", "i686-w64-mingw32"],
     ["Windows", "x86_64", "gcc", "x86_64-w64-mingw32"],
     ["Darwin", "x86_64", None, "x86_64-apple-darwin"],
Repository: conan-io/conan
Pull request #12934 (2023-01-20 12:11:57)

[bugfix] `Version` int comparison
Changelog: omit
Docs: omit

Note: I've to backport this fix to `develop` (lack of tests for Version)


Patch:
diff --git a/conans/model/version.py b/conans/model/version.py
index ad678e4e7..2ff31e0dd 100644
--- a/conans/model/version.py
+++ b/conans/model/version.py
@@ -159,7 +159,7 @@ class Version:
     def __eq__(self, other):
         if other is None:
             return False
-        if isinstance(other, str):
+        if not isinstance(other, Version):
             other = Version(other)
 
         return (self._nonzero_items, self._pre, self._build) ==\


Test patch:
diff --git a/conans/test/unittests/model/version/test_version_comparison.py b/conans/test/unittests/model/version/test_version_comparison.py
index 96d181389..7b24e9de0 100644
--- a/conans/test/unittests/model/version/test_version_comparison.py
+++ b/conans/test/unittests/model/version/test_version_comparison.py
@@ -53,6 +53,15 @@ def test_comparison(v1, v2):
     assert v2 >= v1
 
 
+def test_comparison_with_integer():
+    v1 = Version("13.0")
+    # Issue: https://github.com/conan-io/conan/issues/12907
+    assert v1 > 5
+    assert not v1 > 20
+    assert v1 < 20
+    assert v1 == 13
+
+
 e = [("1", "1.0"),
      ("1", "1.0.0"),
      ("1.0", "1.0.0"),
Repository: conan-io/conan
Pull request #13278 (2023-02-28 23:46:37)

fix msvc cppstd checks
Changelog: Bugfix: Fix supported ``cppstd`` values for ``msvc`` compiler
Docs: Omit

Closes https://github.com/conan-io/conan/issues/13213


Patch:
diff --git a/conan/tools/build/cppstd.py b/conan/tools/build/cppstd.py
index bdf08ca39..423c0a279 100644
--- a/conan/tools/build/cppstd.py
+++ b/conan/tools/build/cppstd.py
@@ -203,11 +203,17 @@ def _gcc_supported_cppstd(version):
 
 def _msvc_supported_cppstd(version):
     """
+    https://learn.microsoft.com/en-us/cpp/build/reference/std-specify-language-standard-version?view=msvc-170
+    - /std:c++14 starting in Visual Studio 2015 Update 3 (190)
+    - /std:c++17 starting in Visual Studio 2017 version 15.3. (191)
+    - /std:c++20 starting in Visual Studio 2019 version 16.11 (192)
     [14, 17, 20, 23]
     """
-    if version < "190":
+    if version < "190":  # pre VS 2015
         return []
-    if version < "191":
+    if version < "191":  # VS 2015
+        return ["14"]
+    if version < "192":  # VS 2017
         return ["14", "17"]
     if version < "193":
         return ["14", "17", "20"]
diff --git a/conans/client/profile_loader.py b/conans/client/profile_loader.py
index 6c51598f3..b94f9beaa 100644
--- a/conans/client/profile_loader.py
+++ b/conans/client/profile_loader.py
@@ -68,7 +68,8 @@ def _check_correct_cppstd(settings):
                     "14": "5.1",
                     "11": "4.5"}.get(cppstd)
         elif compiler == "msvc":
-            mver = {"20": "193",
+            mver = {"23": "193",
+                    "20": "192",
                     "17": "191",
                     "14": "190"}.get(cppstd)
         if mver and version < mver:


Test patch:
diff --git a/conans/test/unittests/tools/build/test_cppstd.py b/conans/test/unittests/tools/build/test_cppstd.py
index 2be74004e..b3d24c10a 100644
--- a/conans/test/unittests/tools/build/test_cppstd.py
+++ b/conans/test/unittests/tools/build/test_cppstd.py
@@ -79,8 +79,9 @@ def test_supported_cppstd_apple_clang(compiler, compiler_version, values):
 
 @pytest.mark.parametrize("compiler,compiler_version,values", [
     ("msvc", "180", []),
-    ("msvc", "190", ['14', '17']),
-    ("msvc", "191", ['14', '17', '20']),
+    ("msvc", "190", ['14']),
+    ("msvc", "191", ['14', '17']),
+    ("msvc", "192", ['14', '17', '20']),
     ("msvc", "193", ['14', '17', '20', '23']),
 ])
 def test_supported_cppstd_msvc(compiler, compiler_version, values):