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

Issue:
GNUtls can't find  the tarball for 3.5.9
Looks like @healther's  recent update to include v 3.5.9 broke the build:

```
curl: (37) Couldn't open file /home/hartzelg/tmp/spack-cime-sc1-working-dir/workspace/sc1-daily-build/spack-mirror/mirror/gnutls/gnutls-3.5.9.tar.xz
curl: (22) The requested URL returned error: 404 Not Found
[...]
==> Fetching http://www.ring.gr.jp/pub/net/gnupg/gnutls/v3.3/gnutls-3.5.9.tar.xz
==> Fetching from http://www.ring.gr.jp/pub/net/gnupg/gnutls/v3.3/gnutls-3.5.9.tar.xz failed.
==> Error: FetchError: All fetchers failed for gnutls-3.5.9-wacj7mrkudwrxskrlqxe7wcxpzrrxhx2
Build step 'Execute shell' marked build as failure
Finished: FAILURE
```


Discussion:

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/gnutls/package.py b/var/spack/repos/builtin/packages/gnutls/package.py
--- a/var/spack/repos/builtin/packages/gnutls/package.py
+++ b/var/spack/repos/builtin/packages/gnutls/package.py
@@ -35,19 +35,23 @@ class Gnutls(AutotoolsPackage):
        with focus on security and interoperability."""
 
     homepage = "http://www.gnutls.org"
-    url      = "http://www.ring.gr.jp/pub/net/gnupg/gnutls/v3.3/gnutls-3.3.9.tar.xz"
+    url      = "https://www.gnupg.org/ftp/gcrypt/gnutls/v3.5/gnutls-3.5.10.tar.xz"
 
-    version('3.5.9', '0ab25eb6a1509345dd085bc21a387951')
-    version('3.3.9', 'ff61b77e39d09f1140ab5a9cf52c58b6')
+    version('3.5.10', '336c03a71ba90184ffd0388075dde504')
+    version('3.5.9',  '0ab25eb6a1509345dd085bc21a387951')
+    version('3.3.9',  'ff61b77e39d09f1140ab5a9cf52c58b6')
 
-    # configure sez: Note that version 3.3.9 of gnutls doesn't support
-    # nettle 3.0.
+    # Note that version 3.3.9 of gnutls doesn't support nettle 3.0.
     depends_on("nettle@:2.9", when='@3.3.9')
     depends_on("nettle", when='@3.5:')
     depends_on("zlib", when='@3.5:')
 
     build_directory = 'spack-build'
 
+    def url_for_version(self, version):
+        url = "https://www.gnupg.org/ftp/gcrypt/gnutls/v{0}/gnutls-{1}.tar.xz"
+        return url.format(version.up_to(2), version)
+
     def configure_args(self):
         args = []
         if self.spec.satisfies('@3.5:'):


Test patch:
Repository: spack/spack

Issue:
cannot build mxml
Blocks building of ADIOS on my system (gcc 4.8.5 linux-opensuse42-x86_64) with this traceback:

    /home/mol/Software/spack/lib/spack/spack/build_systems/autotools.py:266, in configure:
     258      def configure(self, spec, prefix):
     259          """Runs configure with the arguments specified in
     260          :py:meth:`~.AutotoolsPackage.configure_args`
     261          and an appropriately set prefix.
     262          """
     263          options = ['--prefix={0}'.format(prefix)] + self.configure_args()
     264  
     265          with working_dir(self.build_directory, create=True):
    >> 266              inspect.getmodule(self).configure(*options)

And the log

     ==> '/home/mol/Software/spack/var/spack/stage/mxml-2.10-zxpuyumt66b7ehrlidmcax7li5ekhr6x/mxml-2.10/configure' '--prefix=/home/mol/Software/spack/opt/spack/linux-opensuse42-x86_64/gcc-4.8/mxml-2.10-zxpuyumt66b7ehrlidmcax7li5ekhr6x' '--disable-shared' 'CFLAGS=-static'
    configure: loading site script /usr/share/site/x86_64-unknown-linux-gnu
    checking for gcc... /home/mol/Software/spack/lib/spack/env/gcc/gcc
    checking whether the C compiler works... no

Removing the `CFLAGS=-static` entry (from configure_args) solves the problem, but since I don't know why it was there in the first place, I'm not touching it.


Discussion:
Attached possible update for mxml (it is getting really difficult having so many pending pull requests).
Culled out old versions that are no longer available to fetch.

[mxml-package.zip](https://github.com/LLNL/spack/files/896089/mxml-package.zip)


Resolving patch:
diff --git a/var/spack/repos/builtin/packages/mxml/package.py b/var/spack/repos/builtin/packages/mxml/package.py
--- a/var/spack/repos/builtin/packages/mxml/package.py
+++ b/var/spack/repos/builtin/packages/mxml/package.py
@@ -41,9 +41,12 @@ class Mxml(AutotoolsPackage):
     version('2.6', '68977789ae64985dddbd1a1a1652642e')
     version('2.5', 'f706377fba630b39fa02fd63642b17e5')
 
-    # module swap PrgEnv-intel PrgEnv-$COMP
-    # (Can use whatever compiler you want to use)
-    # Case statement to change CC and CXX flags
+    def url_for_version(self, version):
+        if version <= Version('2.7'):
+            return 'https://github.com/michaelrsweet/mxml/archive/release-{0}.tar.gz'.format(version)
+        else:
+            return 'https://github.com/michaelrsweet/mxml/releases/download/release-{0}/mxml-{0}.tar.gz'.format(version)
 
     def configure_args(self):
-        return ['--disable-shared', 'CFLAGS=-static']
+        # Default is non-shared, but avoid any future surprises
+        return ['--disable-shared']


Test patch:
Repository: spack/spack

Issue:
Boost fails for versions < 1.56.0 with python3
When installing Boost@1.54.0 with python3, spack cannot patch boost.build and throws an error:
```
Staging archive: *****/boost_1_54_0.tar.bz2
The text leading up to this was:
--------------------------
|diff --git a/tools/build/src/tools/python.jam b/tools/build/src/tools/python.jam
|index 90377ea..123f66a 100644
|--- a/tools/build/src/tools/python.jam
|+++ b/tools/build/src/tools/python.jam
--------------------------
```
This is due to a change in the directory structure of boost.build. For versions before 1.56.0 the path should be `/tools/build/v2/tools/python.jam`


Discussion:

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/boost/package.py b/var/spack/repos/builtin/packages/boost/package.py
--- a/var/spack/repos/builtin/packages/boost/package.py
+++ b/var/spack/repos/builtin/packages/boost/package.py
@@ -131,7 +131,8 @@ class Boost(Package):
     patch('boost_11856.patch', when='@1.60.0%gcc@4.4.7')
 
     # Patch fix from https://svn.boost.org/trac/boost/ticket/11120
-    patch('python_jam.patch', when='^python@3:')
+    patch('python_jam.patch', when='@1.56.0: ^python@3:')
+    patch('python_jam_pre156.patch', when='@:1.55.0 ^python@3:')
 
     # Patch fix from https://svn.boost.org/trac/boost/ticket/10125
     patch('boost_10125.patch', when='@1.55.0%gcc@5.0:5.9')


Test patch:
Repository: spack/spack

Issue:
Error configuring libedit
I am getting a configure error in `spack install libedit` with the following entry in the log:
```
checking for tgetent in -lncurses... no
checking for tgetent in -lcurses... no
checking for tgetent in -ltermcap... no
configure: error: libncurses, libcurses, or libtermcap is required!
```
This may be a result of the recent change to provide libncursesw, also discussed in #3727.


Discussion:

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/libedit/package.py b/var/spack/repos/builtin/packages/libedit/package.py
--- a/var/spack/repos/builtin/packages/libedit/package.py
+++ b/var/spack/repos/builtin/packages/libedit/package.py
@@ -28,8 +28,9 @@
 class Libedit(AutotoolsPackage):
     """An autotools compatible port of the NetBSD editline library"""
     homepage = "http://thrysoee.dk/editline/"
-    url      = "http://thrysoee.dk/editline/libedit-20150325-3.1.tar.gz"
+    url      = "http://thrysoee.dk/editline/libedit-20170329-3.1.tar.gz"
 
+    version('3.1-20170329', 'c57a0690e62ef523c083598730272cfd')
     version('3.1-20160903', '0467d27684c453a351fbcefebbcb16a3')
     version('3.1-20150325', '43cdb5df3061d78b5e9d59109871b4f6')
 
@@ -38,3 +39,6 @@ class Libedit(AutotoolsPackage):
     def url_for_version(self, version):
         url = "http://thrysoee.dk/editline/libedit-{0}-{1}.tar.gz"
         return url.format(version[-1], version.up_to(-1))
+
+    def configure_args(self):
+        return ['LIBS=-lncursesw']


Test patch:
Repository: spack/spack

Issue:
How to use ccache with spack?
It seems to me that because spack uses full paths to `gcc` and other compilers, there is no place to inject `ccache` to use it. Does anybody use Spack with ccache? If yes, how do you manage to do that? Particularly, in combination with mpi wrappers?


Discussion:
See #3761

Resolving patch:
diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py
--- a/lib/spack/spack/build_environment.py
+++ b/lib/spack/spack/build_environment.py
@@ -98,6 +98,7 @@
 SPACK_SHORT_SPEC = 'SPACK_SHORT_SPEC'
 SPACK_DEBUG_LOG_ID = 'SPACK_DEBUG_LOG_ID'
 SPACK_DEBUG_LOG_DIR = 'SPACK_DEBUG_LOG_DIR'
+SPACK_CCACHE_BINARY = 'SPACK_CCACHE_BINARY'
 
 
 # Platform-specific library suffix.
@@ -335,6 +336,13 @@ def set_build_environment_variables(pkg, env, dirty):
     env.set(SPACK_DEBUG_LOG_ID, pkg.spec.format('${PACKAGE}-${HASH:7}'))
     env.set(SPACK_DEBUG_LOG_DIR, spack.main.spack_working_dir)
 
+    # Find ccache binary and hand it to build environment
+    if spack.config.get('config:ccache'):
+        ccache = Executable('ccache')
+        if not ccache:
+            raise RuntimeError("No ccache binary found in PATH")
+        env.set(SPACK_CCACHE_BINARY, ccache)
+
     # Add any pkgconfig directories to PKG_CONFIG_PATH
     for prefix in build_link_prefixes:
         for directory in ('lib', 'lib64', 'share'):
diff --git a/lib/spack/spack/schema/config.py b/lib/spack/spack/schema/config.py
--- a/lib/spack/spack/schema/config.py
+++ b/lib/spack/spack/schema/config.py
@@ -69,6 +69,7 @@
                 'locks': {'type': 'boolean'},
                 'dirty': {'type': 'boolean'},
                 'build_jobs': {'type': 'integer', 'minimum': 1},
+                'ccache': {'type': 'boolean'},
             }
         },
     },


Test patch:
Repository: spack/spack

Issue:
git shallow clone of submodules as well?
Currently the repositories are cloned with `--depth=1` but if I set `submodules=True` then submodules are full clones. For large repos it would be nice to have submodules with `shallow` clones as well.
git shallow clone of submodules as well?
Currently the repositories are cloned with `--depth=1` but if I set `submodules=True` then submodules are full clones. For large repos it would be nice to have submodules with `shallow` clones as well.


Discussion:

Resolving patch:
diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py
--- a/lib/spack/spack/fetch_strategy.py
+++ b/lib/spack/spack/fetch_strategy.py
@@ -670,10 +670,20 @@ def fetch(self):
 
         # Init submodules if the user asked for them.
         if self.submodules:
-            if spack.debug:
-                self.git('submodule', 'update', '--init')
+            # only git 1.8.4 and later have --depth option
+            if self.git_version < ver('1.8.4'):
+                if spack.debug:
+                    self.git('submodule', 'update', '--init', '--recursive')
+                else:
+                    self.git('submodule', '--quiet', 'update', '--init',
+                             '--recursive')
             else:
-                self.git('submodule', '--quiet', 'update', '--init')
+                if spack.debug:
+                    self.git('submodule', 'update', '--init', '--recursive',
+                             '--depth=1')
+                else:
+                    self.git('submodule', '--quiet', 'update', '--init',
+                             '--recursive', '--depth=1')
 
     def archive(self, destination):
         super(GitFetchStrategy, self).archive(destination, exclude='.git')


Test patch:
Repository: spack/spack

Issue:
Guidance on adding 'completions' to git package.
I'd like to "gift" the git package with the ability to install the completion bits that live in the `contrib` subdirectory, basically doing [what the homebrew git recipe does](https://github.com/Homebrew/homebrew-core/blob/master/Formula/git.rb#L125-L132).

I'm scratching my head about where to install the bits.

I see that @alalazo has a [TODO about adding completion support in the node.js package](https://github.com/LLNL/spack/blob/8c650303ffdd02c4be273efbce1674706c0182cd/var/spack/repos/builtin/packages/node-js/package.py#L77) as well as a commented-out dependency and variant.  I don't see any other evidence of packages adding completion bits.

I'm on a CentOS 7 system that has all of the RHEL/CentOS bits installed in `/usr/share/bash-completion`.

I see that Spack has a [`bash-completion` package](https://github.com/LLNL/spack/blob/81a5146b1df1f69172c0f76bc3dbe469f4e366f9/var/spack/repos/builtin/packages/bash-completion/package.py) that overlaps with the CentOS stuff (perhaps being newer).  It also pulls in a bash.

I'd like to put the completion files someplace that would be useful to *either/or/both* of consumers of the system's bash-completion bits or the Spack bits.

The best idea I have it to tuck them into $(spack location -i git).

Anyone have a better way to do it?


Discussion:
You can add the git completion scripts to the git package as resources, but I wouldn't try to install them outside of the git installation prefix.
@adamjstewart -- I don't think that they need to be [a real resource](https://github.com/LLNL/spack/blob/7043fff8078d0b7a62895302dabbe71904220edf/lib/spack/spack/resource.py), they're already [part of the git source tree](https://github.com/git/git/tree/master/contrib/completion).  It's just a matter of adding a variant that copies them somewhere appropriate.

Actually, since it's going to take explicit user action to activate them (vs. if I copy them into a system directory), if I just tuck them into $(spack location -i git) then perhaps we can just *always* do it.

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/git/package.py b/var/spack/repos/builtin/packages/git/package.py
--- a/var/spack/repos/builtin/packages/git/package.py
+++ b/var/spack/repos/builtin/packages/git/package.py
@@ -24,6 +24,7 @@
 ##############################################################################
 import sys
 from spack import *
+from distutils.dir_util import copy_tree
 
 
 class Git(AutotoolsPackage):
@@ -166,6 +167,10 @@ def filter_rt(self):
             # Don't link with -lrt; the system has no (and needs no) librt
             filter_file(r' -lrt$', '', 'Makefile')
 
+    @run_after('install')
+    def install_completions(self):
+        copy_tree('contrib/completion', self.prefix.share)
+
     @run_after('install')
     def install_manpages(self):
         prefix = self.prefix


Test patch:
Repository: spack/spack

Issue:
cscope build errors on Centos 7
cscope fails to build on Centos 7. The configure script output says it can't find curses. As a shot-in-the-dark I tried adding ```depends_on('ncurses')``` and get the same result

``` bash
$ spack install -j1 cscope
==> Installing cscope
==> ncurses is already installed in spack/opt/spack/linux-centos7-x86_64/gcc-4.8.5/ncurses-6.0-75hnzrecoib5eqdvfchl6n2jgcxc6dgo
==> Using cached archive: spack/var/spack/cache/cscope/cscope-15.8b.tar.gz
==> Staging archive: spack/var/spack/stage/cscope-15.8b-prz66vexnihyvq54as3ry3f6fucox2rk/cscope-15.8b.tar.gz
==> Created stage in spack/var/spack/stage/cscope-15.8b-prz66vexnihyvq54as3ry3f6fucox2rk
==> Ran patch() for cscope
==> Building cscope [AutotoolsPackage]
==> Executing phase : 'autoreconf'
==> Executing phase : 'configure'
==> Executing phase : 'build'
==> Error: ProcessError: Command exited with status 2:
    'make'
spack/lib/spack/spack/build_systems/autotools.py:273, in build:
     268      def build(self, spec, prefix):
     269          """Makes the build targets specified by
     270          :py:attr:``~.AutotoolsPackage.build_targets``
     271          """
     272          with working_dir(self.build_directory):
  >> 273              inspect.getmodule(self).make(*self.build_targets)

See build log for details:
  /tmp/spack-stage/spack-stage-RqIblB/cscope-15.8b/spack-build.out
```

From spack-build.out
``` bash
spack/lib/spack/env/gcc/gcc  -g -O2   -o cscope fscanner.o egrep.o alloc.o basename.o build.o command.o compath.o crossref.o dir.o display.o edit.o exec.o find.o help.o history.o input.o invlib.o logdir.o lookup.o main.o mouse.o mygetenv.o mypopen.o vpaccess.o vpfopen.o vpinit.o vpopen.o -lcurses
/bin/ld: cannot find -lcurses
collect2: error: ld returned 1 exit status
make[2]: *** [cscope] Error 1
make[2]: Leaving directory `/tmp/spack-stage/spack-stage-RqIblB/cscope-15.8b/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/spack-stage/spack-stage-RqIblB/cscope-15.8b'
make: *** [all] Error 2
```


Discussion:

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/cscope/package.py b/var/spack/repos/builtin/packages/cscope/package.py
--- a/var/spack/repos/builtin/packages/cscope/package.py
+++ b/var/spack/repos/builtin/packages/cscope/package.py
@@ -33,12 +33,10 @@ class Cscope(AutotoolsPackage):
 
     version('15.8b', '8f9409a238ee313a96f9f87fe0f3b176')
 
-    variant('flex', default=False, description="Builds with flex")
+    depends_on('ncurses')
 
-    depends_on('flex', when='+flex')
+    depends_on('flex', type='build')
+    depends_on('bison', type='build')
+    depends_on('pkg-config', type='build')
 
-    def configure_args(self):
-        args = []
-        if '+flex' in self.spec:
-            args.append('--with-flex')
-        return args
+    build_targets = ['CURSES_LIBS=-lncursesw']


Test patch:
Repository: spack/spack

Issue:
Default explicit=True for do_install()
As per @tgamblin 

We should document (the explicit kwarg to do_install()). This adds a flag in the database (not in the spec) to tell you which packages were explicitly requested by a user (True) and which were brought in as dependencies (False).

Spack find has flags to list only explicit packages.

Looking at this, the default should probably be True, as most callers external to Package are usually requesting something they really want. The recursive install calls should worry about setting it to False, not the user.



Discussion:
Are there any other kwargs to do_install() that also need to be examined or documented?


Resolving patch:
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -1145,22 +1145,24 @@ def do_install(self,
         Package implementations should override install() to describe
         their build process.
 
-        :param keep_prefix: Keep install prefix on failure. By default, \
+        :param bool keep_prefix: Keep install prefix on failure. By default,
             destroys it.
-        :param keep_stage: By default, stage is destroyed only if there are \
-            no exceptions during build. Set to True to keep the stage
+        :param bool keep_stage: By default, stage is destroyed only if there
+            are no exceptions during build. Set to True to keep the stage
             even with exceptions.
-        :param install_deps: Install dependencies before installing this \
+        :param bool install_deps: Install dependencies before installing this
             package
-        :param fake: Don't really build; install fake stub files instead.
-        :param skip_patch: Skip patch stage of build if True.
-        :param verbose: Display verbose build output (by default, suppresses \
-            it)
-        :param dirty: Don't clean the build environment before installing.
-        :param make_jobs: Number of make jobs to use for install. Default is \
-            ncpus
-        :param force: Install again, even if already installed.
-        :param run_tests: Run tests within the package's install()
+        :param bool skip_patch: Skip patch stage of build if True.
+        :param bool verbose: Display verbose build output (by default,
+            suppresses it)
+        :param int make_jobs: Number of make jobs to use for install. Default
+            is ncpus
+        :param bool run_tests: Run tests within the package's install()
+        :param bool fake: Don't really build; install fake stub files instead.
+        :param bool explicit: True if package was explicitly installed, False
+            if package was implicitly installed (as a dependency).
+        :param bool dirty: Don't clean the build environment before installing.
+        :param bool force: Install again, even if already installed.
         """
         if not self.spec.concrete:
             raise ValueError("Can only install concrete packages: %s."


Test patch:
Repository: spack/spack

Issue:
`scorep` does not work on Darwin
The Score-P package requires a case-sensitive file system. This is described in the install notes, and I confirmed with the developers. I suggest to disable Score-P on Darwin to avoid others having to track down this problem in the same way I had to. Alternatively, we can add an install-time test whether the build or install directories are on a case-insensitive file system.



Discussion:
We don't currently have a way to check this before install, but I agree a quick check in `install` would be good.


Resolving patch:
diff --git a/var/spack/repos/builtin/packages/scorep/package.py b/var/spack/repos/builtin/packages/scorep/package.py
--- a/var/spack/repos/builtin/packages/scorep/package.py
+++ b/var/spack/repos/builtin/packages/scorep/package.py
@@ -65,6 +65,11 @@ class Scorep(AutotoolsPackage):
 
     variant('shmem', default=False, description='Enable shmem tracing')
 
+    # Score-P requires a case-sensitive file system, and therefore
+    # does not work on macOS
+    # https://github.com/LLNL/spack/issues/1609
+    conflicts('platform=darwin')
+
     def configure_args(self):
         spec = self.spec
 


Test patch: