anon-iclr-submission/benchname-bug-localization huggingface dataset:
Repository: cupy/cupy
Issue: Exception raised in `TCPStore.__del__` upon process termination

### Description

`__del__` should not perform syncronization when called during process termination.

```
Exception ignored in: <function TCPStore.__del__ at 0x7fb939be23a0>
Traceback (most recent call last):
  File "/home/maehashi/Development/cupy/cupyx/distributed/_store.py", line 49, in __del__
  File "/home/maehashi/Development/cupy/cupyx/distributed/_store.py", line 97, in stop
  File "/home/maehashi/Development/cupy/cupyx/distributed/_store.py", line 31, in join
  File "/home/maehashi/.pyenv/versions/3.8.1/lib/python3.8/multiprocessing/connection.py", line 251, in recv
ModuleNotFoundError: import of builtins halted; None in sys.modules
```

### To Reproduce

_No response_

### Installation

_No response_

### Environment

_No response_

### Additional Information

_No response_

Changed files:
cupyx/distributed/_store.py

diff --git a/cupyx/distributed/_store.py b/cupyx/distributed/_store.py
index 643abefb5..ebc5961ab 100644
--- a/cupyx/distributed/_store.py
+++ b/cupyx/distributed/_store.py
@@ -1,3 +1,4 @@
+import atexit
 from ctypes import sizeof
 import multiprocessing
 import threading
@@ -11,6 +12,14 @@ from cupyx.distributed import _store_actions
 _DEFAULT_HOST = '127.0.0.1'
 _DEFAULT_PORT = 13333
 
+_exit_mode = False
+
+
+@atexit.register
+def _exit():
+    global _exit_mode
+    _exit_mode = True
+
 
 class ExceptionAwareProcess(multiprocessing.Process):
     def __init__(self, *args, **kwargs):
@@ -46,7 +55,8 @@ class TCPStore:
         self._current_barrier = None
 
     def __del__(self):
-        self.stop()
+        if not _exit_mode:
+            self.stop()
 
     def _set_process(self, process):
         self._process = process
@@ -91,6 +101,8 @@ class TCPStore:
         self._process = p
 
     def stop(self):
+        if _exit_mode:
+            return  # Prevent shutdown errors
         if self._process is not None:
             with self._run.get_lock():
                 self._run.value = 0
Repository: cupy/cupy
Issue: `pip install cupy-wheel` - "not a valid wheel filename"

### Description

When I try to `pip install cupy-wheel` I get the error `cupy_wheel<...>.whl is not a valid wheel filename`.

### To Reproduce

```bash
pip install cupy-wheel
```
OS: Windows 10
Python: 3.8.9
pip: 23.1.2
CUDA: CUDA 11.7

### Installation

None

### Environment

Unable to install using `cupy-wheel`. Can install using `pip install cupy-cuda11x`.

### Additional Information

_No response_

Changed files:
install/universal_pkg/setup.py

diff --git a/install/universal_pkg/setup.py b/install/universal_pkg/setup.py
index 161207027..abb6729e5 100644
--- a/install/universal_pkg/setup.py
+++ b/install/universal_pkg/setup.py
@@ -2,12 +2,13 @@ import ctypes
 import pkg_resources
 import os
 import sys
-from typing import Dict, List, Optional
+from typing import List, Optional
 
 from setuptools import setup
 
 
 VERSION = '13.0.0a1'
+META_VERSION = VERSION
 
 # List of packages supported by this version of CuPy.
 PACKAGES = [
@@ -259,20 +260,6 @@ def infer_best_package() -> str:
         'Unable to detect NVIDIA CUDA or AMD ROCm installation.')
 
 
-def _get_cmdclass(tag: str) -> Dict[str, type]:
-    try:
-        import wheel.bdist_wheel
-    except ModuleNotFoundError:
-        return {}
-
-    class bdist_wheel_with_tag(wheel.bdist_wheel.bdist_wheel):  # type: ignore[misc] # NOQA
-        def initialize_options(self) -> None:
-            super().initialize_options()
-            self.build_number = f'0_{tag}'
-
-    return {"bdist_wheel": bdist_wheel_with_tag}
-
-
 #
 # Entrypoint
 #
@@ -283,17 +270,14 @@ def main() -> None:
         requires = f'{package}=={VERSION}'
         _log(f'Installing package: {requires}')
         install_requires = [requires]
-        tag = package
     else:
         _log('Building cupy-wheel package for release.')
         install_requires = []
-        tag = '0'
 
     setup(
         name='cupy-wheel',
-        version=f'{VERSION}',
+        version=META_VERSION,
         install_requires=install_requires,
-        cmdclass=_get_cmdclass(tag),
     )
Repository: cupy/cupy
Issue: Typo in raise from einsum

### Description

In this line:

https://github.com/cupy/cupy/blob/master/cupy/linalg/_einsum.py#L511

einsum() tries to raise an error:

```py
raise TypeError('Did not understand the following kwargs: %s'
                        % list(kwargs.keys))
```

but I believe it should be `list(kwargs.keys())` or simply `list(kwargs)`.


### To Reproduce

```py
>>> cp.einsum('i', cp.ones(7), asdf=42)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/camp/jensj/venv/lib64/python3.9/site-packages/cupy/linalg/_einsum.py", line 512, in einsum
    % list(kwargs.keys))
TypeError: 'builtin_function_or_method' object is not iterable
```


### Installation

_No response_

### Environment

```
OS                           : Linux-4.18.0-372.26.1.el8_6.x86_64-x86_64-with-glibc2.28
Python Version               : 3.9.13
CuPy Version                 : 11.3.0
CuPy Platform                : NVIDIA CUDA
NumPy Version                : 1.23.5
SciPy Version                : 1.9.3
Cython Build Version         : 0.29.32
Cython Runtime Version       : None
CUDA Root                    : /usr/local/cuda
nvcc PATH                    : /usr/local/cuda/bin/nvcc
CUDA Build Version           : 11080
CUDA Driver Version          : 11080
CUDA Runtime Version         : 11080
cuBLAS Version               : (available)
cuFFT Version                : 10900
cuRAND Version               : 10300
cuSOLVER Version             : (11, 4, 1)
cuSPARSE Version             : (available)
NVRTC Version                : (11, 8)
Thrust Version               : 101501
CUB Build Version            : 101501
Jitify Build Version         : <unknown>
cuDNN Build Version          : None
cuDNN Version                : None
NCCL Build Version           : None
NCCL Runtime Version         : None
cuTENSOR Version             : None
cuSPARSELt Build Version     : None
Device 0 Name                : Quadro RTX 4000
Device 0 Compute Capability  : 75
Device 0 PCI Bus ID          : 0000:21:00.0
```


### Additional Information

_No response_

Changed files:
cupy/linalg/_einsum.py

diff --git a/cupy/linalg/_einsum.py b/cupy/linalg/_einsum.py
index 3ce7af1b8..1a27f4408 100644
--- a/cupy/linalg/_einsum.py
+++ b/cupy/linalg/_einsum.py
@@ -509,7 +509,7 @@ def einsum(*operands, **kwargs):
         optimize = 'greedy'
     if kwargs:
         raise TypeError('Did not understand the following kwargs: %s'
-                        % list(kwargs.keys))
+                        % list(kwargs.keys()))
 
     result_dtype = cupy.result_type(*operands) if dtype is None else dtype
     operands = [
Repository: conan-io/conan
Issue: [question] CMakeToolchain generates CMAKE_SYSTEM_NAME baremetal instead of Generic?

Hi everybody,

I'm running 2.0.2 and trying to cross compile for a bare metal target setting `os=baremetal`  in the respective profile. I was expecting `CMakeToolchain` to generate `CMAKE_SYSTEM_NAME` to `Generic` but it stuck with `baremetal`. Anything I'm missing or just something not considered yet?

### Have you read the CONTRIBUTING guide?

- [X] I've read the CONTRIBUTING guide

Changed files:
conans/test/unittests/tools/cmake/test_cmaketoolchain.py, conan/tools/cmake/toolchain/blocks.py

diff --git a/conan/tools/cmake/toolchain/blocks.py b/conan/tools/cmake/toolchain/blocks.py
index e24398245..6c021bc74 100644
--- a/conan/tools/cmake/toolchain/blocks.py
+++ b/conan/tools/cmake/toolchain/blocks.py
@@ -718,6 +718,7 @@ class GenericSystemBlock(Block):
         arch_build = self._conanfile.settings_build.get_safe("arch")
         cmake_system_name_map = {"Neutrino": "QNX",
                                  "": "Generic",
+                                 "baremetal": "Generic",
                                  None: "Generic"}
         if os_host != os_build:
             return cmake_system_name_map.get(os_host, os_host)
diff --git a/conans/test/unittests/tools/cmake/test_cmaketoolchain.py b/conans/test/unittests/tools/cmake/test_cmaketoolchain.py
index cfa06ebf9..a5e2bec1a 100644
--- a/conans/test/unittests/tools/cmake/test_cmaketoolchain.py
+++ b/conans/test/unittests/tools/cmake/test_cmaketoolchain.py
@@ -527,3 +527,33 @@ def test_linker_scripts_block(conanfile):
     toolchain = CMakeToolchain(conanfile)
     content = toolchain.content
     assert f'string(APPEND CONAN_EXE_LINKER_FLAGS -T"path_to_first_linker_script" -T"path_to_second_linker_script")' in content
+
+
+class TestCrossBuild:
+    @pytest.fixture
+    def conanfile_cross(self):
+        c = ConanFile()
+        c.settings = Settings({"os": ["baremetal", "Linux"],
+                               "compiler": {"gcc": {"version": ["11"], "cppstd": ["20"]}},
+                               "build_type": ["Release"],
+                               "arch": ["armv8", "x86_64"]})
+        c.settings.build_type = "Release"
+        c.settings.arch = "armv8"
+        c.settings.compiler = "gcc"
+        c.settings.compiler.version = "11"
+        c.settings.compiler.cppstd = "20"
+        c.settings.os = "baremetal"
+        c.settings_build = c.settings.copy()
+        c.settings_build.os = "Linux"
+        c.settings_build.arch = "x86_64"
+        c.conf = Conf()
+        c.folders.set_base_generators(".")
+        c._conan_node = Mock()
+        c._conan_node.dependencies = []
+        c._conan_node.transitive_deps = {}
+        return c
+
+    def test_cmake_system_name(self, conanfile_cross):
+        toolchain = CMakeToolchain(conanfile_cross)
+        content = toolchain.content
+        assert 'set(CMAKE_SYSTEM_NAME Generic)' in content
Repository: conan-io/conan
Issue: [bug] In the CMakeDeps Generator CONAN_FOUND_LIBRARY and CONAN_SHARED_FOUND_LIBRARY are not cleared

### Environment details

* Operating System+version: Windows 10 & Linux
* Compiler+version: MSVC 19 & gcc 11.3.0
* Conan version: 2.0.2
* Python version: 3.10.6




### Steps to reproduce

1. Create a conan project with a dependecy and CMakeDeps generator
2. execute conan install
3. Have a look at the created cmakedeps_macros.cmake

in the function `conan_package_library_targets` line 23 the variable `CONAN_FOUND_LIBRARY` is filled with the found library. This call will write the variable into the cache. The same goes for the variable `CONAN_SHARED_FOUND_LIBRARY` in line 35. While this works for the first library in this foreach loop, each following call will not search for the library and update the variable, but takes them from the cache. So this way all the libraries end up with the same .lib and .dll files. So either the variable needs to be cleared after each foreach loop, or the NO_CACHE option needs to be used in the find_library execution. Another possible solution would be to create a new variable for every library (e.g. CONAN_FOUND_LIBRARY_${LIB_NAME} and CONAN_SHARED_FOUND_LIBRARY_${LIB_NAME})

### Logs

_No response_

Changed files:
conan/tools/cmake/cmakedeps/templates/macros.py

diff --git a/conan/tools/cmake/cmakedeps/templates/macros.py b/conan/tools/cmake/cmakedeps/templates/macros.py
index 9d0824a04..d3249bcea 100644
--- a/conan/tools/cmake/cmakedeps/templates/macros.py
+++ b/conan/tools/cmake/cmakedeps/templates/macros.py
@@ -76,6 +76,7 @@ class MacrosTemplate(CMakeDepsFileTemplate):
                         set_target_properties(${_LIB_NAME} PROPERTIES IMPORTED_IMPLIB ${CONAN_FOUND_LIBRARY})
                         message(DEBUG "Found DLL and STATIC at ${CONAN_SHARED_FOUND_LIBRARY}, ${CONAN_FOUND_LIBRARY}")
                      endif()
+                     unset(CONAN_SHARED_FOUND_LIBRARY CACHE)
                    else()
                      if(NOT TARGET ${_LIB_NAME})
                          # library_type can be STATIC, still UNKNOWN (if no package type available in the recipe) or SHARED (but no windows)