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

Issue:
Installation issue: dire
### Steps to reproduce the issue

<!-- Fill in the exact spec you are trying to build and the relevant part of the error message -->
```console
$ spack install dire
...
```

### Information on your system
```
* **Spack:** 0.15.4-1671-bc4e7eabf
* **Python:** 3.6.9
* **Platform:** linux-ubuntu18.04-zen
```

### Additional information
[spack-build-env.txt](https://github.com/spack/spack/files/5461620/spack-build-env.txt)
[spack-build-out.txt](https://github.com/spack/spack/files/5461622/spack-build-out.txt)


### General information

<!-- These boxes can be checked by replacing [ ] with [x] or by clicking them after submitting the issue. -->
- [x] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [x] I have run `spack maintainers <name-of-the-package>` and @mentioned any maintainers
@wdconinc 
- [x] I have uploaded the build log and environment files
- [x] I have searched the issues of this repo and believe this is not a duplicate



Discussion:

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/dire/package.py b/var/spack/repos/builtin/packages/dire/package.py
--- a/var/spack/repos/builtin/packages/dire/package.py
+++ b/var/spack/repos/builtin/packages/dire/package.py
@@ -24,7 +24,7 @@ class Dire(Package):
     depends_on('boost')
     depends_on('lhapdf')
     depends_on('hepmc')
-    depends_on('pythia8@8226:')
+    depends_on('pythia8@8226:8244')
 
     def install(self, spec, prefix):
         configure_args = ['--prefix={0}'.format(prefix)]


Test patch:
Repository: spack/spack

Issue:
netlib-scalapack: reversed (or previously applied) patch detected
Using `spack@develop` (77fc458d2964490c83863d667df10b9a740ce05e from `Sun Nov 1 01:05:13 2020 +0100`)

Can't install `netlib-scalapack` ([netlib-scalapack.spec.yaml.txt](https://github.com/spack/spack/files/5470201/netlib-scalapack.spec.yaml.txt)) on:
* `Ubuntu 18.04`
* `ppc64le`

```
$> spack install -f ./netlib-scalapack.spec.yaml
...
==> Installing netlib-scalapack
==> No binary for netlib-scalapack found: installing from source
==> Using cached archive: /opt/spack/var/spack/cache/_source-cache/archive/61/61d9216cf81d246944720cfce96255878a3f85dec13b9351f1fa0fd6768220a6.tgz
Reversed (or previously applied) patch detected!  Assume -R? [n] <HIT ENTER | 'n' | 'y'>
Apply anyway? [n] <HIT ENTER | 'n' | 'y'>

5 out of 5 hunks ignored -- saving rejects to file PBLAS/SRC/pdamax_.c.rej
Reversed (or previously applied) patch detected!  Assume -R? [n]
...
goes on indefinitely
...
Ctrl+C

==> Error: Keyboard interrupt.
```

Behavior is exactly the same on first fetch:
```
$> spack install -f ./netlib-scalapack.spec.yaml
...
==> Installing netlib-scalapack
==> No binary for netlib-scalapack found: installing from source
==> Fetching https://spack-llnl-mirror.s3-us-west-2.amazonaws.com/_source-cache/archive/61/61d9216cf81d246944720cfce96255878a3f85dec13b9351f1fa0fd6768220a6.tgz
################################################################################################################################################################################## 100.0%
Reversed (or previously applied) patch detected!  Assume -R? [n]
.....
```

Offending commit looks to be:
https://github.com/spack/spack/commit/51a9473bf867af3e5f8f024d124c71b5b03384a0#diff-4adf527004d5d4cf80265f7ee109f54d6ca3b75431bdd216f237dcc526c3c8cc

This is kind of a big problem as it breaks ability of E4S to build all packages that depend on `netlib-scalapack` in automated builds, which include at least:
1. `strumpack`
2. `trilinos`
3. `omega-h`
4. `slate`

@vkallesh @adamjstewart @t-karatsu @becker33 @scottwittenburg 





Discussion:
Ah, the bug is that the patches get applied twice. That's an easy fix.

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/netlib-scalapack/package.py b/var/spack/repos/builtin/packages/netlib-scalapack/package.py
--- a/var/spack/repos/builtin/packages/netlib-scalapack/package.py
+++ b/var/spack/repos/builtin/packages/netlib-scalapack/package.py
@@ -102,10 +102,3 @@ class NetlibScalapack(ScalapackBase):
     version('2.0.0', sha256='e51fbd9c3ef3a0dbd81385b868e2355900148eea689bf915c5383d72daf73114')
     # versions before 2.0.0 are not using cmake and requires blacs as
     # a separated package
-
-    # See: https://github.com/Reference-ScaLAPACK/scalapack/issues/9
-    patch("cmake_fortran_mangle.patch", when='@2.0.2:2.0.99')
-    # See: https://github.com/Reference-ScaLAPACK/scalapack/pull/10
-    patch("mpi2-compatibility.patch", when='@2.0.2:2.0.99')
-    # See: https://github.com/Reference-ScaLAPACK/scalapack/pull/16
-    patch("int_overflow.patch", when='@2.0.0:2.1.0')


Test patch:
Repository: spack/spack

Issue:
Installation issue:  py-cython
### Steps to reproduce the issue

```console
spack install py-cython %gcc@8.3.0
```

### Information on your system

* **Spack:** 0.15.4-1776-b4ea74c
* **Python:** 3.6.8
* **Platform:** linux-centos7-cascadelake

### Additional information
`spack maintainers py-cython` returns nothing

* [spack-build-out.txt](https://github.com/spack/spack/files/5495167/spack-build-out.txt)

* [spack-build-env.txt](https://github.com/spack/spack/files/5495169/spack-build-env.txt)


### General information

<!-- These boxes can be checked by replacing [ ] with [x] or by clicking them after submitting the issue. -->
- [X] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [X] I have run `spack maintainers <name-of-the-package>` and @mentioned any maintainers
- [X] I have uploaded the build log and environment files
- [X] I have searched the issues of this repo and believe this is not a duplicate



Discussion:

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/py-cython/package.py b/var/spack/repos/builtin/packages/py-cython/package.py
--- a/var/spack/repos/builtin/packages/py-cython/package.py
+++ b/var/spack/repos/builtin/packages/py-cython/package.py
@@ -37,8 +37,8 @@ class PyCython(PythonPackage):
     version('0.23.4',  sha256='fec42fecee35d6cc02887f1eef4e4952c97402ed2800bfe41bbd9ed1a0730d8e')
     version('0.21.2',  sha256='b01af23102143515e6138a4d5e185c2cfa588e0df61c0827de4257bac3393679')
 
-    depends_on('python@2.6:2.8,3.3:', when='@0.23:', type=('build', 'run'))
-    depends_on('python@:2', when='@:0.22', type=('build', 'run'))
+    depends_on('python@2.6:2.8,3.3:', when='@0.23:', type=('build', 'link', 'run'))
+    depends_on('python@:2', when='@:0.22', type=('build', 'link', 'run'))
     depends_on('py-setuptools', type=('build', 'run'))
     depends_on('gdb@7.2:', type='test')
 


Test patch:
Repository: spack/spack

Issue:
Installation issue: py-grpcio recipe fails with system ssl
The recipe for `py-grpcio` specifically looks for `self.spec[dep].libs.directories` and `self.spec[dep].headers.directories` entries for all dependencies, but these are not guaranteed to be present, for example in the case that the system openssl is used and only a prefix is specified:

### Steps to reproduce the issue

```console
cat <<EOF > ~/.spack/packages.yaml
packages:
  openssl:
    externals:
    - spec: openssl@1.1.1c
      prefix: /usr
EOF

$ spack install py-grpcio

==> Installing py-grpcio
==> No binary for py-grpcio found: installing from source
==> Error: IndexError: list index out of range

/home/phil/repos/spack/var/spack/repos/builtin/packages/py-grpcio/package.py:40, in setup_build_environment:
         37
         38        for dep in self.spec.dependencies(deptype='link'):
         39            query = self.spec[dep.name]
  >>     40            env.prepend_path('LIBRARY_PATH', query.libs.directories[0])
         41            env.prepend_path('CPATH', query.headers.directories[0])
```

### Information on your system

* **Spack:** 0.15.4-1886-9d5f4f9c6
* **Python:** 3.8.6
* **Platform:** linux-gentoo2-zen2

### Additional information

No build output as recipe fails too early.

No maintainers listed.

### General information

- [x] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [x] I have run `spack maintainers <name-of-the-package>` and @mentioned any maintainers
- [x] I have uploaded the build log and environment files
- [x] I have searched the issues of this repo and believe this is not a duplicate



Discussion:
I have a workaround for this locally which simply ignores any IndexErrors raised during the for loop. This works for any system installed deps in expected locations, but if I had a prefix of `/opt/pkg/openssl` rather than `/usr` I suspect the build would fail.

```python
    for dep in self.spec.dependencies(deptype='link'):
        query = self.spec[dep.name]
        try:
            env.prepend_path('LIBRARY_PATH', query.libs.directories[0])
            env.prepend_path('CPATH', query.headers.directories[0])
        except IndexError:
            pass
```

Even if you are using an external package for `openssl`, it should still be able to find the system libraries. Are your libraries in `/usr/lib` or `/usr/lib64`? If it's the latter, I think that's an easy fix.

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/openssl/package.py b/var/spack/repos/builtin/packages/openssl/package.py
--- a/var/spack/repos/builtin/packages/openssl/package.py
+++ b/var/spack/repos/builtin/packages/openssl/package.py
@@ -87,7 +87,8 @@ def determine_version(cls, exe):
 
     @property
     def libs(self):
-        return find_libraries(['libssl', 'libcrypto'], root=self.prefix.lib)
+        return find_libraries(
+            ['libssl', 'libcrypto'], root=self.prefix, recursive=True)
 
     def handle_fetch_error(self, error):
         tty.warn("Fetching OpenSSL failed. This may indicate that OpenSSL has "


Test patch:
Repository: spack/spack

Issue:
binutils: checksum fails for 2.35.1
Using:
* `spack@develop`
* commit b08744566d28697db363a87a24671f81528e3dc1
* `Fri Nov 13 22:29:18 2020 +0530`

Checksum fails for `binutils@2.35.1`

```
$> spack install binutils@2.35.1
...
==> Installing binutils
==> Fetching https://ftpmirror.gnu.org/binutils/binutils-2.35.1.tar.bz2
##################################################################################################################################################### 100.0%
==> Error: ChecksumError: sha256 checksum failed for /tmp/root/spack-stage/spack-stage-binutils-2.35.1-va6aevecl3j4nrxixcmfvhfv2zyk45ik/binutils-2.35.1.tar.bz2
    Expected a8dfaae8cbbbc260fc1737a326adca97b5d4f3c95a82f0af1f7455ed1da5e77b but got 320e7a1d0f46fcd9f413f1046e216cbe23bb2bce6deb6c6a63304425e48b1942

/opt/spack/lib/spack/spack/package.py:1274, in do_fetch:
       1271        self.stage.fetch(mirror_only, err_msg=err_msg)
       1272        self._fetch_time = time.time() - start_time
       1273
  >>   1274        if checksum and self.version in self.versions:
       1275            self.stage.check()
       1276
       1277        self.stage.cache_local()
```

```
$> spack checksum binutils@2.35.1
==> Found 1 version of binutils:

  2.35.1  https://ftpmirror.gnu.org/binutils/binutils-2.35.1.tar.bz2

==> Fetching https://ftpmirror.gnu.org/binutils/binutils-2.35.1.tar.bz2
##################################################################################################################################################### 100.0%

    version('2.35.1', sha256='320e7a1d0f46fcd9f413f1046e216cbe23bb2bce6deb6c6a63304425e48b1942')
```

@hainest @michaelkuhn @adamjstewart @scottwittenburg 


Discussion:
This is a result of https://github.com/spack/spack/pull/19827#issuecomment-726866927. Anyone want to submit a PR?

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/binutils/package.py b/var/spack/repos/builtin/packages/binutils/package.py
--- a/var/spack/repos/builtin/packages/binutils/package.py
+++ b/var/spack/repos/builtin/packages/binutils/package.py
@@ -12,7 +12,7 @@ class Binutils(AutotoolsPackage, GNUMirrorPackage):
     homepage = "http://www.gnu.org/software/binutils/"
     gnu_mirror_path = "binutils/binutils-2.28.tar.bz2"
 
-    version('2.35.1', sha256='a8dfaae8cbbbc260fc1737a326adca97b5d4f3c95a82f0af1f7455ed1da5e77b')
+    version('2.35.1', sha256='320e7a1d0f46fcd9f413f1046e216cbe23bb2bce6deb6c6a63304425e48b1942')
     version('2.35', sha256='7d24660f87093670738e58bcc7b7b06f121c0fcb0ca8fc44368d675a5ef9cff7')
     version('2.34', sha256='89f010078b6cf69c23c27897d686055ab89b198dddf819efb0a4f2c38a0b36e6')
     version('2.33.1', sha256='0cb4843da15a65a953907c96bad658283f3c4419d6bcc56bf2789db16306adb2')


Test patch:
Repository: spack/spack

Issue:
Spack picks up wrong user after ksu
When trying to run an installation as a user that was switched to using `ksu`, Spack still determines the temp directory (set as `$tempdir/$user/spack-stage`) to be the $user from login, not the one switched to with `ksu`.

### Steps to reproduce the issue

```console
$ ksu new-user
$ whoami
new-user
$ spack python -c "import spack.util.path as p; p.canonicalize_path('$tempdir/$user')"
'/tmp'
$ python
>>> import getpass
>>> print(getpass.getuser())
old-user
>>> import pwd
>>> print pwd.getpwuid(os.getuid())
pwd.struct_passwd(pw_name='new-user', pw_passwd='x', pw_uid=#####, pw_gid=#####, pw_gecos='<info>', pw_dir='/home/new-user', pw_shell='/bin/bash')
...
```

### Error Message

No error message, per se.  Just the fact that when building, the build stage ends up under `~/.spack`, which in the case of our HPC machines is an NFS mounted filesystem and causes the builds to be very slow, especially for expansive Spack Stacks installations.

### Information on your system

```console
$ spack debug report
* **Spack:** 0.15.3
* **Python:** 3.6.8
* **Platform:** linux-rhel7-broadwell
```

### Additional information

<!-- These boxes can be checked by replacing [ ] with [x] or by clicking them after submitting the issue. -->
- [x] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [ ] I have searched the issues of this repo and believe this is not a duplicate
- [ ] I have run the failing commands in debug mode and reported the output



Discussion:

Resolving patch:
diff --git a/lib/spack/spack/util/path.py b/lib/spack/spack/util/path.py
--- a/lib/spack/spack/util/path.py
+++ b/lib/spack/spack/util/path.py
@@ -39,6 +39,18 @@ def architecture():
     return spack.spec.ArchSpec((str(host_platform), str(host_os), str(host_target)))
 
 
+def get_user():
+    # User pwd where available because it accounts for effective uids when using ksu and similar
+    try:
+        # user pwd for unix systems
+        import pwd
+
+        return pwd.getpwuid(os.geteuid()).pw_name
+    except ImportError:
+        # fallback on getpass
+        return getpass.getuser()
+
+
 # Substitutions to perform
 def replacements():
     # break circular import from spack.util.executable
@@ -48,7 +60,7 @@ def replacements():
 
     return {
         "spack": spack.paths.prefix,
-        "user": getpass.getuser(),
+        "user": get_user(),
         "tempdir": tempfile.gettempdir(),
         "user_cache_path": spack.paths.user_cache_path,
         "architecture": str(arch),


Test patch:
Repository: spack/spack

Issue:
py-ipykernel: install_data phase fails
Unable to install `py-ipykernel@5.3.4` due to failure of `install_data` phase.

Using:
* `spack@develop`
* eca1370abc65341421597018cc5b702a3e5ab46e
* `2020-11-18 8:37 AM PST`

```
$> spack install py-ipykernel@5.3.4
...
==> py-ipykernel: Executing phase: 'build'
==> py-ipykernel: Executing phase: 'install'
==> py-ipykernel: Executing phase: 'install_data'
==> Error: TypeError: install_data() takes 1 positional argument but 3 were given
/builds/uo/e4s/spack/lib/spack/spack/build_environment.py:863, in _setup_pkg_and_run:
        860        tb_string = traceback.format_exc()
        861
        862        # build up some context from the offending package so we can
  >>    863        # show that, too.
        864        package_context = get_package_context(tb)
        865
        866        logfile = None
...
```

Introduced via commit 8b431d17742a43aeca06d897dd5889a58df0d259 ?

@ax3l @adamjstewart @scottwittenburg 


Discussion:

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/py-ipykernel/package.py b/var/spack/repos/builtin/packages/py-ipykernel/package.py
--- a/var/spack/repos/builtin/packages/py-ipykernel/package.py
+++ b/var/spack/repos/builtin/packages/py-ipykernel/package.py
@@ -43,6 +43,7 @@ class PyIpykernel(PythonPackage):
 
     phases = ['build', 'install', 'install_data']
 
-    def install_data(self):
+    def install_data(self, spec, prefix):
         """ install the Jupyter kernel spec """
-        self.spec['python'].command('-m ipykernel', ['install'])
+        self.spec['python'].command(
+            '-m', 'ipykernel', 'install', '--prefix=' + prefix)


Test patch:
Repository: spack/spack

Issue:
new concretizer: changes compilers to avoid compiler conflict in package
### Steps to reproduce the issue

With GCC7 and Clang 6 installed, you get:
```console
$ spack spec netlib-scalapack %gcc@:7 ^openblas
          ^netlib-scalapack@2.1.0%gcc@7.5.0  ... arch=linux-ubuntu18.04-x86_64
              ^openblas@0.3.12%clang@6.0.0 ... arch=linux-ubuntu18.04-x86_64
```
where it mixes GCC and Clang to work around

```
conflicts('%gcc@:8.2.99', when='@0.3.11:')
```
defined in openblas.

Instead it should just take openblas@0.3.10 and compile with GCC.



Discussion:

Resolving patch:
diff --git a/var/spack/repos/builtin.mock/packages/openblas/package.py b/var/spack/repos/builtin.mock/packages/openblas/package.py
--- a/var/spack/repos/builtin.mock/packages/openblas/package.py
+++ b/var/spack/repos/builtin.mock/packages/openblas/package.py
@@ -12,5 +12,10 @@ class Openblas(Package):
     url      = "http://github.com/xianyi/OpenBLAS/archive/v0.2.15.tar.gz"
 
     version('0.2.15', 'b1190f3d3471685f17cfd1ec1d252ac9')
+    version('0.2.14', 'b1190f3d3471685f17cfd1ec1d252ac9')
+    version('0.2.13', 'b1190f3d3471685f17cfd1ec1d252ac9')
+
+    # See #20019 for this conflict
+    conflicts('%gcc@:4.4.99', when='@0.2.14:')
 
     provides('blas')


Test patch:
diff --git a/lib/spack/spack/test/concretize.py b/lib/spack/spack/test/concretize.py
--- a/lib/spack/spack/test/concretize.py
+++ b/lib/spack/spack/test/concretize.py
@@ -923,3 +923,18 @@ def test_activating_test_dependencies(
             msg = "Test dependency in package '{0}' is unexpected"
             node = s[pkg_name]
             assert not node.dependencies(deptype='test'), msg.format(pkg_name)
+
+    @pytest.mark.regression('20019')
+    def test_compiler_match_is_preferred_to_newer_version(self):
+        if spack.config.get('config:concretizer') == 'original':
+            pytest.xfail('Known failure of the original concretizer')
+
+        # This spec depends on openblas. Openblas has a conflict
+        # that doesn't allow newer versions with gcc@4.4.0. Check
+        # that an old version of openblas is selected, rather than
+        # a different compiler for just that node.
+        spec_str = 'simple-inheritance+openblas %gcc@4.4.0 os=redhat6'
+        s = Spec(spec_str).concretized()
+
+        assert 'openblas@0.2.13' in s
+        assert s['openblas'].satisfies('%gcc@4.4.0')
diff --git a/lib/spack/spack/test/data/config/compilers.yaml b/lib/spack/spack/test/data/config/compilers.yaml
--- a/lib/spack/spack/test/data/config/compilers.yaml
+++ b/lib/spack/spack/test/data/config/compilers.yaml
@@ -102,6 +102,15 @@ compilers:
       cxxflags: -O0 -g
       fflags: -O0 -g
     modules: 'None'
+- compiler:
+    spec: gcc@4.4.0
+    operating_system: redhat6
+    paths:
+      cc: /path/to/gcc440
+      cxx: /path/to/g++440
+      f77: /path/to/gfortran440
+      fc: /path/to/gfortran440
+    modules: 'None'
 - compiler:
     spec: clang@3.5
     operating_system: redhat6
Repository: spack/spack

Issue:
Installation issue: llvm fails to build assembler files with CMake 3.19.0
### Steps to reproduce the issue

```console
$ spack install llvm
...
-- Performing Test LIBCXX_SUPPORTS_WEXTRA_SEMI_FLAG
/spack-stage-dir/202269/root/spack-stage-llvm-11.0.0-stpte4xqkfbkbahzzcdnqw5pvxrjm6hs/spack-src/compiler-rt/lib/tsan/rtl/tsan_rtl_amd64.S:7:1: error: expected identifier or '(' before '.' token
 .section .text
 ^
/spack-stage-dir/202269/root/spack-stage-llvm-11.0.0-stpte4xqkfbkbahzzcdnqw5pvxrjm6hs/spack-src/compiler-rt/lib/tsan/rtl/tsan_rtl_amd64.S:16:5: error: invalid preprocessing directive #Save
   # Save scratch registers.
     ^~~~
/spack-stage-dir/202269/root/spack-stage-llvm-11.0.0-stpte4xqkfbkbahzzcdnqw5pvxrjm6hs/spack-src/compiler-rt/lib/tsan/rtl/tsan_rtl_amd64.S:44:5: error: invalid preprocessing directive #Align
   # Align stack frame.
     ^~~~~
...
make: *** [Makefile:174: all] Error 2
==> [2020-11-25-20:09:46.809565] Error: ProcessError: Command exited with status 2:
```

This is a combination of both an LLVM and CMake issue:

LLVM bug: https://bugs.llvm.org/show_bug.cgi?id=48234
LLVM fix: https://reviews.llvm.org/D86308
CMake bug: https://gitlab.kitware.com/cmake/cmake/-/issues/21469
CMake fix: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5519

This is a placeholder issue that will be closed by the above referenced patches being applied


Discussion:

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py
--- a/var/spack/repos/builtin/packages/llvm/package.py
+++ b/var/spack/repos/builtin/packages/llvm/package.py
@@ -200,6 +200,11 @@ class Llvm(CMakePackage, CudaPackage):
             "system debug server",
     )
 
+    # LLVM bug https://bugs.llvm.org/show_bug.cgi?id=48234
+    # CMake bug: https://gitlab.kitware.com/cmake/cmake/-/issues/21469
+    # Fixed in upstream versions of both
+    conflicts('^cmake@3.19.0', when='@6.0.0:11.0.0')
+
     # Github issue #4986
     patch("llvm_gcc7.patch", when="@4.0.0:4.0.1+lldb %gcc@7.0:")
     # Backport from llvm master + additional fix


Test patch: