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

Issue:
Installation issue: axom
### Steps to reproduce the issue

```console
spack install axom@0.5.0
```

### Information on your system

* **Spack:** 0.16.2-4207-5fddd48f80
* **Python:** 3.7.2
* **Platform:** linux-rhel7-broadwell
* **Concretizer:** original

### Additional information

axom@0.5.0 needs umpire@5.0.0 but package is not constrained and fails using umpire@6.0.0

@white238 @davidbeckingsale.

Relevant part of the log:
```
     580     make[2]: Entering directory '/usr/WS2/bernede1/gitlab-runner/build
             s/llnl-stack-19d51ded/spack/var/spack/stage/spack-stage-axom-0.5.0
             -bnpgq3mmbjcedrul2k7xtoyturx47cht/spack-build-bnpgq3m'
     581     In file included from /usr/WS2/bernede1/gitlab-runner/builds/llnl-
             stack-19d51ded/spack/var/spack/stage/spack-stage-axom-0.5.0-bnpgq3
             mmbjcedrul2k7xtoyturx47cht/spack-src/src/axom/quest/MeshTester.cpp
             :7:
  >> 582     /usr/WS2/bernede1/gitlab-runner/builds/llnl-stack-19d51ded/spack/v
             ar/spack/stage/spack-stage-axom-0.5.0-bnpgq3mmbjcedrul2k7xtoyturx4
             7cht/spack-src/src/axom/quest/MeshTester.hpp:128:40: error: no mem
             ber named 'DynamicPool' in namespace 'umpire::strategy'
     583         rm.makeAllocator<umpire::strategy::DynamicPool>(
     584                          ~~~~~~~~~~~~~~~~~~^
  >> 585     /usr/WS2/bernede1/gitlab-runner/builds/llnl-stack-19d51ded/spack/v
             ar/spack/stage/spack-stage-axom-0.5.0-bnpgq3mmbjcedrul2k7xtoyturx4
             7cht/spack-src/src/axom/quest/MeshTester.hpp:128:52: error: expect
             ed unqualified-id
     586         rm.makeAllocator<umpire::strategy::DynamicPool>(
     587                                                        ^
```

[spack-build-out (2).txt](https://github.com/spack/spack/files/7138906/spack-build-out.2.txt)


### 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:

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/axom/package.py b/var/spack/repos/builtin/packages/axom/package.py
--- a/var/spack/repos/builtin/packages/axom/package.py
+++ b/var/spack/repos/builtin/packages/axom/package.py
@@ -107,9 +107,10 @@ class Axom(CachedCMakePackage, CudaPackage):
     depends_on("raja+openmp", when="+raja+openmp")
     depends_on("raja+cuda", when="+raja+cuda")
 
-    depends_on("umpire~openmp", when="+umpire~openmp")
-    depends_on("umpire+openmp", when="+umpire+openmp")
-    depends_on("umpire+cuda", when="+umpire+cuda")
+    with when('+umpire'):
+        depends_on('umpire@5.0.1:5')
+        depends_on('umpire +openmp', when='+openmp')
+        depends_on('umpire +cuda', when='+cuda')
 
     for sm_ in CudaPackage.cuda_arch_values:
         depends_on('raja cuda_arch={0}'.format(sm_),


Test patch:
Repository: spack/spack

Issue:
Output of lsb_release is not ignored by distro
### Steps to reproduce

Originally posted here: https://github.com/spack/spack/commit/fcac95b0654a84151ad51a9123f74e8cdfcf8d26#commitcomment-58082083

> On my Arch linux system the output of lsb_release does not seem to be ignored: the name of my operating system as used by spack changed from archrolling to arch with this commit. [...]

### Error message

No error message, but the optimization seems to change the name of the OS being detected

### Information on your system

The only relevant part seems to be Arch linux as an OS

### General information

- [X] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [X] I have searched the issues of this repo and believe this is not a duplicate
- [X] I have run the failing commands in debug mode and reported the output


Discussion:

Resolving patch:
diff --git a/lib/spack/external/__init__.py b/lib/spack/external/__init__.py
--- a/lib/spack/external/__init__.py
+++ b/lib/spack/external/__init__.py
@@ -38,7 +38,6 @@
 * Homepage: https://pypi.python.org/pypi/distro
 * Usage: Provides a more stable linux distribution detection.
 * Version: 1.0.4 (last version supporting Python 2.6)
-* Note: Patched to disable lsb_release by default to improve Spack's startup time.
 
 functools
 ---------
diff --git a/lib/spack/external/distro.py b/lib/spack/external/distro.py
--- a/lib/spack/external/distro.py
+++ b/lib/spack/external/distro.py
@@ -12,8 +12,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Spack managed modifications: use include_lsb=False by default.
-
 """
 The ``distro`` package (``distro`` stands for Linux Distribution) provides
 information about the Linux distribution it runs on, such as a reliable
@@ -1074,7 +1072,7 @@ def _parse_distro_release_content(line):
         return distro_info
 
 
-_distro = LinuxDistribution(include_lsb=False)
+_distro = LinuxDistribution()
 
 
 def main():


Test patch:
Repository: spack/spack

Issue:
Installation issue: OpenMPI with hwloc
### Steps to reproduce the issue

```
$ spack install openmpi@4.1.1~atomics~cuda~cxx~cxx_exceptions+gpfs~internal-hwloc~java~legacylaunchers~lustre~memchecker~pmi~pmix+singularity~sqlite3+static+thread_multiple+vt+wrapper-rpath fabrics=ucx schedulers=none
```

And for `hwloc` I am using `hwloc@2.6.0~cairo~cuda~gl~libudev+libxml2~netloc~nvml~opencl+pci~rocm+shared` spec. **Note** that I did not ask for `rocm` support with this `hwloc` spec. But if there are ROCm libraries in `/opt/rocm`, `hwloc` is picking them up automatically and building itself with `rocm_smi` support. Here are relevant lines from `config.log` of `hwloc`:

```
**** RSMI configuration
configure: using standard ROCm install path /opt/rocm ...
checking for rocm_smi/rocm_smi.h... yes
checking for rsmi_init in -lrocm_smi64... yes
**** end of RSMI configuration
```

And configuration arguments emitted by Spack for `hwloc` are `--disable-opencl --disable-cairo --disable-nvml --disable-gl --disable-cuda --enable-libxml2 --disable-libudev --enable-pci --enable-shared`

Eventually when OpenMPI is using this Spack built `hwloc`, configuration tests os external `hwloc` fail due to lack of linker paths to `librocm_smi`. 

This is not what we want. We should explicitly `--disable-rsmi` when variant is `~rocm` in `hwloc`.

Maintainers:
OpenMPI: @hppritcha 
Hwloc: @bgoglin 


### Information on your system

* **Spack:** 0.17.0
* **Python:** 3.7.3
* **Platform:** linux-debian10-skylake_avx512
* **Concretizer:** clingo
[spack-build-env.txt](https://github.com/spack/spack/files/7569864/spack-build-env.txt)
[spack-build-out.txt](https://github.com/spack/spack/files/7569865/spack-build-out.txt)
[OpenMPI config.log](https://github.com/spack/spack/files/7569866/config.log)
[Hwloc config.log](https://github.com/spack/spack/files/7569873/spack-build-02-configure-out.2.txt)




### Additional information

_No response_

### 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:

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/hwloc/package.py b/var/spack/repos/builtin/packages/hwloc/package.py
--- a/var/spack/repos/builtin/packages/hwloc/package.py
+++ b/var/spack/repos/builtin/packages/hwloc/package.py
@@ -135,6 +135,14 @@ def configure_args(self):
         if '+opencl' not in self.spec:
             args.append('--disable-opencl')
 
+        # If ROCm libraries are found in system /opt/rocm
+        # during config stage, hwloc builds itself with
+        # librocm_smi support.
+        # This can fail the config tests while building
+        # OpenMPI due to lack of rpath to librocm_smi
+        if '+rocm' not in self.spec:
+            args.append('--disable-rsmi')
+
         if '+netloc' in self.spec:
             args.append('--enable-netloc')
 


Test patch:
Repository: spack/spack

Issue:
Replacement of shebang in environment views leaves tilde backup files
In scripts in environment views, the shebang line (e.g. `#!/usr/bin/python3.8`) is replaced by the (hidden) view directory. However, this leaves a backup file with `~` with the original shebang line. Probably harmless.

### Steps to reproduce the issue

With a `spack.yaml` in the current directory
```yaml
spack:
  specs:
  - py-setuptools
  view: /opt/bug-tilde
```
setup the environment as follows:
```console
$ spack env activate .
$ spack concretize -f
$ spack install
```

### Error Message

When correctly installed, I don't expect to see any files with `~` suffixed. However,
```console
$ ls /opt/bug-tilde/bin/*~
```
returns
```console
$ ls /opt/bug-tilde/bin/*~
/opt/bug-tilde/bin/easy_install~  /opt/bug-tilde/bin/easy_install-3.8~
```

The first lines of the `easy_install` and `easy_install~` files are:
```console
$ head -n 1 /opt/bug-tilde/bin/easy_install /opt/bug-tilde/bin/easy_install~
==> /opt/bug-tilde/bin/easy_install <==
#!/opt/._bug-tilde/6x4nr3otmtjkbustvme6h3nogieg7or4/bin/python3.8

==> /opt/bug-tilde/bin/easy_install~ <==
#!/opt/software/linux-ubuntu21.04-skylake/gcc-10.3.0/python-3.8.11-q2cz5f6dqnom6d453ob4eg3bvurbhfuc/bin/python3.8
```

### Information on your system

* **Spack:** 0.16.2-3642-10461c68ac
* **Python:** 3.9.5
* **Platform:** linux-ubuntu21.04-skylake
* **Concretizer:** original

### Additional information

- [X] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [X] 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:
@becker33 @scheibelp was it one of you working on environment symlinks recently?

I think this would be as simple as using `backup=False` in `filter_file` to prevent these tilde backup files, but I'm not sure where the code is for this.
Another symptom of this: when using `jupyter` from an environment, I see:
```console
$ jupyter -h
...
Available subcommands: bundlerextension bundlerextension~ kernel kernelspec kernelspec~ kernel~ lab labextension labextension~ labhub
labhub~ lab~ migrate migrate~ nbclassic nbclassic~ nbconvert nbconvert~ nbextension nbextension~ notebook notebook~ run run~ server
serverextension serverextension~ server~ troubleshoot troubleshoot~ trust
```

Resolving patch:
diff --git a/lib/spack/llnl/util/filesystem.py b/lib/spack/llnl/util/filesystem.py
--- a/lib/spack/llnl/util/filesystem.py
+++ b/lib/spack/llnl/util/filesystem.py
@@ -141,7 +141,7 @@ def filter_file(regex, repl, *filenames, **kwargs):
             file.
     """
     string = kwargs.get('string', False)
-    backup = kwargs.get('backup', True)
+    backup = kwargs.get('backup', False)
     ignore_absent = kwargs.get('ignore_absent', False)
     stop_at = kwargs.get('stop_at', None)
 


Test patch:
Repository: spack/spack

Issue:
environment view fails to build properly (requires explicit concretize)
After installation of a package (e.g., `gcc`) in an environment, creating a new environment and installing `gcc` fails to build a view properly.

Manually running `spack concretize` will build the view.

See https://spackpm.slack.com/archives/C5W7NKZJT/p1621993202213500?thread_ts=1621870255.145500&cid=C5W7NKZJT for discussion log.

### Steps to reproduce the issue

```console
$ spack env create test
[...]
$ spack env activate test
[...]
$ spack install gcc
[...]
$ spack env deactivate
[...]
$ spack env create test2
==> Updating view at /nfs/data/spack/var/spack/environments/test2/.spack-env/view
==> Created environment 'test2' in /nfs/data/spack/var/spack/environments/test2
==> You can activate this environment with:
==>   spack env activate test2
$ spack env activate test2
$ spack install gcc
==> All of the packages are already installed
$ which gcc
/usr/bin/gcc
$ spack concretize
$ which gcc
/nfs/data/spack/var/spack/environments/proteus/.spack-env/view/bin/gcc
```

### Information on your system

```console
$ spack debug report
* **Spack:** 0.16.2-2821-d46e49ef7a
* **Python:** 3.7.3
* **Platform:** linux-debian10-thunderx2
* **Concretizer:** original
```

```console
[ldalessa]:/data/spack/etc/spack$ cat *.yaml
config:
  install_tree:
    root: /data/spack/opt/spack
packages:
  all:
    target: ["aarch64"]
```

### Additional information

- [x] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [x] I have searched the issues of this repo and believe this is not a duplicate
- [x] I have run the failing commands in debug mode and reported the output




Discussion:

Resolving patch:
diff --git a/lib/spack/spack/environment/environment.py b/lib/spack/spack/environment/environment.py
--- a/lib/spack/spack/environment/environment.py
+++ b/lib/spack/spack/environment/environment.py
@@ -1515,10 +1515,8 @@ def install_specs(self, specs=None, **install_args):
 
         if not specs_to_install:
             tty.msg('All of the packages are already installed')
-            return
-
-        tty.debug('Processing {0} uninstalled specs'.format(
-            len(specs_to_install)))
+        else:
+            tty.debug('Processing {0} uninstalled specs'.format(len(specs_to_install)))
 
         specs_to_overwrite = self._get_overwrite_specs()
         tty.debug('{0} specs need to be overwritten'.format(


Test patch:
Repository: spack/spack

Issue:
Installation issue: py-blessings
### Steps to reproduce the issue

```console
$ spack install py-blessings
==> Installing py-blessings-1.6-k2vovum5h7xd3hrb2owx7rorxiyxzlkf
==> No binary for py-blessings-1.6-k2vovum5h7xd3hrb2owx7rorxiyxzlkf found: installing from source
==> Using cached archive: /projects/spack/var/spack/cache/_source-cache/archive/ed/edc5713061f10966048bf6b40d9a514b381e0ba849c64e034c4ef6c1847d3007.tar.gz
==> No patches needed for py-blessings
==> py-blessings: Executing phase: 'build'
==> Error: ProcessError: Command exited with status 1:
    '/usr/bin/python3.9' '-s' 'setup.py' '--no-user-cfg' 'build'
```
spack-build-out.txt:
```
==> py-blessings: Executing phase: 'build'
==> [2021-12-22-11:06:39.428059] '/usr/bin/python3.9' '-s' 'setup.py' '--no-user-cfg' 'build'
error in blessings setup command: use_2to3 is invalid.
```

@adamjstewart

### Information on your system

* **Spack:** 0.17.0-516-5319b6e3b1
* **Python:** 3.9.5
* **Platform:** linux-ubuntu21.04-sandybridge
* **Concretizer:** clingo

### Additional information

_No response_

### 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:

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/py-blessings/package.py b/var/spack/repos/builtin/packages/py-blessings/package.py
--- a/var/spack/repos/builtin/packages/py-blessings/package.py
+++ b/var/spack/repos/builtin/packages/py-blessings/package.py
@@ -13,4 +13,5 @@ class PyBlessings(PythonPackage):
 
     version('1.6', sha256='edc5713061f10966048bf6b40d9a514b381e0ba849c64e034c4ef6c1847d3007')
 
-    depends_on('py-setuptools', type='build')
+    # Needs 2to3
+    depends_on('py-setuptools@:57', type='build')


Test patch:
Repository: spack/spack

Issue:
Installation issue: ROOT
### Steps to reproduce the issue

```console
$ export MACOSX_DEPLOYMENT_TARGET=11
$ spack install root
```
eventually while building `core/G__Core` gives:
```
error: invalid version number in 'MACOSX_DEPLOYMENT_TARGET=11'
error: invalid version number in 'MACOSX_DEPLOYMENT_TARGET=11'
Error: Parsing Linkdef file /var/folders/gy/mrg1ffts2h945qj9k29s1l1dvvmbqb/T/s3j/spack-stage/spack-stage-root-6.24.06-n52av2vlzcxyfgukqznvjxfjns4j7dx5/spack-src/core/base/inc/LinkDef.h
make[2]: *** [core/G__Core.cxx] Error 1
make[1]: *** [core/CMakeFiles/G__Core.dir/all] Error 2
```

Clearing the `MACOSX_DEPLOYMENT_TARGET` environment variable fixes the problem. The value of `11` works fine for the other compilers on my system, just apparently not RootCling. Perhaps this is because ROOT uses an older forked version of LLVM.

### Information on your system

* **Spack:** 0.17.0-604-c68652c88c
* **Python:** 3.8.5
* **Platform:** darwin-bigsur-skylake
* **Concretizer:** clingo

### Additional information

@HadrienG2  @chissg @drbenmorgan @vvolkl @pcanal

[spack-build-01-cmake-out.txt](https://github.com/spack/spack/files/7777596/spack-build-01-cmake-out.txt)
[spack-build-02-build-out.txt](https://github.com/spack/spack/files/7777597/spack-build-02-build-out.txt)

### 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:

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/root/package.py b/var/spack/repos/builtin/packages/root/package.py
--- a/var/spack/repos/builtin/packages/root/package.py
+++ b/var/spack/repos/builtin/packages/root/package.py
@@ -605,6 +605,11 @@ def add_include_path(dep_name):
         if '+opengl' in spec:
             add_include_path('glew')
             add_include_path('mesa-glu')
+        if 'platform=darwin' in spec:
+            # Newer deployment targets cause fatal errors in rootcling, so
+            # override with an empty value even though it may lead to link
+            # warnings when building against ROOT
+            env.unset('MACOSX_DEPLOYMENT_TARGET')
 
     def setup_run_environment(self, env):
         env.set('ROOTSYS', self.prefix)


Test patch:
Repository: spack/spack

Issue:
Installation issue:  py-matplotlib with Oneapi intel compiler
[spack-build-01-build-out.txt](https://github.com/spack/spack/files/6653056/spack-build-01-build-out.txt)
[spack-build-env.txt](https://github.com/spack/spack/files/6653057/spack-build-env.txt)
[spack-build-out.txt](https://github.com/spack/spack/files/6653058/spack-build-out.txt)

Looks like a linker error with clang++ / icpx 

@danvev @rscohn2 


Discussion:
Is it something related to freetype@7 + version, earlier intel compiler doesn't support it. 
Can you try again with the latest release of matplotlib? If it's still an issue, can you open an issue with the matplotlib developers? This seems like a bug in their code, not in the Spack build recipe. If they provide a patch I can add it to the package.

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/py-matplotlib/package.py b/var/spack/repos/builtin/packages/py-matplotlib/package.py
--- a/var/spack/repos/builtin/packages/py-matplotlib/package.py
+++ b/var/spack/repos/builtin/packages/py-matplotlib/package.py
@@ -209,7 +209,8 @@ def configure(self):
                 config.write('[libs]\n')
                 config.write('system_freetype = True\n')
                 config.write('system_qhull = True\n')
-                if self.spec.satisfies('%clang'):
+                # avoids error where link time opt is used for compile but not link
+                if self.spec.satisfies('%clang') or self.spec.satisfies('%oneapi'):
                     config.write('enable_lto = False\n')
 
     @run_after('build')


Test patch:
Repository: spack/spack

Issue:
Command line scopes broken when used with other flag
### Steps to reproduce

If you use `spack -C` with another flag that touches spack config (`-d`, `-c`...), then `-C` is ignored:

```sh
$ cat scope/config.yaml
config:
  ccache: true

# OK:
$ ./bin/spack -C scope config get config | grep ccache
  ccache: true

# FAIL:
$ ./bin/spack -C scope -d config get config | grep ccache
==> [...]
  ccache: false
```



### Error message

_No response_

### Information on your system

Regression since spack 0.17. More exactly, I ran git-bisect, and it points to 2bd513d6591161d271221bb76bc1420bd3c2b3e3 .

### General information

- [X] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [X] I have searched the issues of this repo and believe this is not a duplicate
- [X] I have run the failing commands in debug mode and reported the output


Discussion:

Resolving patch:
diff --git a/lib/spack/spack/main.py b/lib/spack/spack/main.py
--- a/lib/spack/spack/main.py
+++ b/lib/spack/spack/main.py
@@ -819,13 +819,13 @@ def _main(argv=None):
     # scopes, then environment configuration here.
     # ------------------------------------------------------------------------
 
-    # ensure options on spack command come before everything
-    setup_main_options(args)
-
     # make spack.config aware of any command line configuration scopes
     if args.config_scopes:
         spack.config.command_line_scopes = args.config_scopes
 
+    # ensure options on spack command come before everything
+    setup_main_options(args)
+
     # activate an environment if one was specified on the command line
     env_format_error = None
     if not args.no_env:


Test patch: