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

Issue:
HDF 5 tests linking to the system HDF 5 installation
I just tried installing a pre-release version of HDF 5, but `--run-tests` failed for me with the following message:
```
Produced output does not match expected output.
Expected output:
--------------------------------------------------------------------------------
HDF5 version 1.8.18 1.8.18
--------------------------------------------------------------------------------
Produced output:
--------------------------------------------------------------------------------
HDF5 version 1.8.5 1.8.5
```
Upon further investigation, I found that the executable is not RPATHed, and is linking to my system installation:
```
$ ldd -r check
	linux-vdso.so.1 =>  (0x00007ffe1b97a000)
	libhdf5.so.6 => /usr/lib64/libhdf5.so.6 (0x00002ae35a9e9000)
	libz.so.1 => /blues/gpfs/home/software/spack-0.9.1/opt/spack/linux-centos6-x86_64/nag-6.1/zlib-1.2.8-6fzvpidg3txst33copiumbget2zovbw2/lib/libz.so.1 (0x00002ae35afd1000)
	libc.so.6 => /lib64/libc.so.6 (0x00002ae35b1ff000)
	libm.so.6 => /lib64/libm.so.6 (0x00002ae35b594000)
	/lib64/ld-linux-x86-64.so.2 (0x00002ae35a7c7000)
```
This is causing the incorrect version to be picked up.
```
$ grep Version /usr/lib64/libhdf5.settings 
		   HDF5 Version: 1.8.5-patch1
```
@eschnett 


Discussion:
The test outputs the version number twice. The first is taken at compile time from the header file, the second at run time from the library. Your error might be that you're also picking up the wrong header files -- this seems to go deeper than just an rpath problem.

I'm digging a little deeper into this and I think I know what the problem is now. When I run on a system without HDF 5 installed, I'm seeing:

```
'/home/ajstewart/spack/lib/spack/env/cc' '-c' '-I/home/ajstewart/spack/opt/spack/linux-fedora24-x86_64/gcc-6.2.1/hdf5-1.10.0-patch1-ivfp3fna6jinvmi3kxopz5o36y5jss3p/include' 'check.c'
check.c:2:18: fatal error: hdf5.h: No such file or directory
 #include <hdf5.h>
                  ^
compilation terminated.
```

That entire directory isn't present yet because HDF 5 hasn't been installed yet. #1186 broke this one. The tests were previously run post-installation and now they are run pre-installation. I'll submit a PR to fix this soon.


Resolving patch:
diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py
--- a/var/spack/repos/builtin/packages/hdf5/package.py
+++ b/var/spack/repos/builtin/packages/hdf5/package.py
@@ -143,8 +143,8 @@ def configure_args(self):
 
         return ["--with-zlib=%s" % spec['zlib'].prefix] + extra_args
 
-    def check(self):
-        super(Hdf5, self).check()
+    @AutotoolsPackage.sanity_check('install')
+    def check_install(self):
         # Build and run a small program to test the installed HDF5 library
         spec = self.spec
         print("Checking HDF5 installation...")


Test patch:
Repository: spack/spack

Issue:
Fix help string with `spack install --only`
@alalazo 
See output now, I don't think this is quite descriptive of how it's supposed to work:
```
  --only {package,dependencies,package,dependencies}
```



Discussion:

Resolving patch:
diff --git a/lib/spack/spack/cmd/install.py b/lib/spack/spack/cmd/install.py
--- a/lib/spack/spack/cmd/install.py
+++ b/lib/spack/spack/cmd/install.py
@@ -47,7 +47,7 @@ def setup_parser(subparser):
         '--only',
         default='package,dependencies',
         dest='things_to_install',
-        choices=['package', 'dependencies', 'package,dependencies'],
+        choices=['package', 'dependencies'],
         help="""Select the mode of installation.
 The default is to install the package along with all its dependencies.
 Alternatively one can decide to install only the package or only


Test patch:
Repository: spack/spack

Issue:
`spack setup` does not run
Should be easy to fix, does anyone know what to change here?
```
$ spack setup pism@dev
Traceback (most recent call last):
  File "/home2/rpfische/spack4/bin/spack", line 203, in <module>
    main()
  File "/home2/rpfische/spack4/bin/spack", line 180, in main
    return_val = command(parser, args)
  File "/home2/rpfische/spack4/lib/spack/spack/cmd/setup.py", line 133, in setup
    with spack.installed_db.write_transaction():
AttributeError: 'module' object has no attribute 'installed_db'
```



Discussion:

Resolving patch:
diff --git a/lib/spack/spack/cmd/graph.py b/lib/spack/spack/cmd/graph.py
--- a/lib/spack/spack/cmd/graph.py
+++ b/lib/spack/spack/cmd/graph.py
@@ -28,6 +28,7 @@
 
 import spack
 import spack.cmd
+import spack.store
 from spack.spec import *
 from spack.graph import *
 
@@ -73,7 +74,7 @@ def graph(parser, args):
         if args.specs:
             tty.die("Can't specify specs with --installed")
         args.dot = True
-        specs = spack.installed_db.query()
+        specs = spack.store.db.query()
 
     else:
         specs = spack.cmd.parse_specs(
diff --git a/lib/spack/spack/cmd/setup.py b/lib/spack/spack/cmd/setup.py
--- a/lib/spack/spack/cmd/setup.py
+++ b/lib/spack/spack/cmd/setup.py
@@ -30,6 +30,7 @@
 
 import llnl.util.tty as tty
 import spack
+import spack.store
 import spack.cmd
 import spack.cmd.install as install
 import spack.cmd.common.arguments as arguments
@@ -130,7 +131,7 @@ def setup(self, args):
         tty.die("spack setup only takes one spec.")
 
     # Take a write lock before checking for existence.
-    with spack.installed_db.write_transaction():
+    with spack.store.db.write_transaction():
         spec = specs[0]
         if not spack.repo.exists(spec.name):
             tty.warn("No such package: %s" % spec.name)


Test patch:
Repository: spack/spack

Issue:
Document spack repo and repos.yaml
> FWIW, spack repo and repos.yaml still need to be documented a bit and needs a reference guide section. That can wait for another PR.



Discussion:

Resolving patch:
diff --git a/lib/spack/spack/cmd/repo.py b/lib/spack/spack/cmd/repo.py
--- a/lib/spack/spack/cmd/repo.py
+++ b/lib/spack/spack/cmd/repo.py
@@ -106,7 +106,7 @@ def repo_add(args):
 
     repos.insert(0, canon_path)
     spack.config.update_config('repos', repos, args.scope)
-    tty.msg("Created repo with namespace '%s'." % repo.namespace)
+    tty.msg("Added repo with namespace '%s'." % repo.namespace)
 
 
 def repo_remove(args):
diff --git a/lib/spack/spack/cmd/spec.py b/lib/spack/spack/cmd/spec.py
--- a/lib/spack/spack/cmd/spec.py
+++ b/lib/spack/spack/cmd/spec.py
@@ -40,6 +40,9 @@ def setup_parser(subparser):
         '-c', '--cover', action='store',
         default='nodes', choices=['nodes', 'edges', 'paths'],
         help='How extensively to traverse the DAG. (default: nodes).')
+    subparser.add_argument(
+        '-N', '--namespaces', action='store_true', default=False,
+        help='Show fully qualified package names.')
     subparser.add_argument(
         '-I', '--install-status', action='store_true', default=False,
         help='Show install status of packages.  Packages can be: '
@@ -50,11 +53,13 @@ def setup_parser(subparser):
 
 
 def spec(parser, args):
+    name_fmt = '$.' if args.namespaces else '$_'
     kwargs = {'color': True,
               'cover': args.cover,
-              'install_status': args.install_status,
+              'format': name_fmt + '$@$%@+$+$=',
               'hashes': args.long or args.very_long,
-              'hashlen': None if args.very_long else 7}
+              'hashlen': None if args.very_long else 7,
+              'install_status': args.install_status}
 
     for spec in spack.cmd.parse_specs(args.specs):
         # With -y, just print YAML to output.


Test patch:
Repository: spack/spack

Issue:
bzip2 fails to install, "argument of type 'ArchSpec' is not iterable"
Does this ring any bells with anyone?  Otherwise I'll dig in.

I'm trying a clean install in a just-cloned repository.

I'm installing gcc-5.4.0.  It fails early on with:

```
[...]
==> Installing bzip2
==> Fetching http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz
==> Staging archive: /rss/spack-20161204/var/spack/stage/bzip2-1.0.6-y37ln2uyixh4hdxovx5hz2klnkdfapxl/bzip2-1.0.6.tar.gz
==> Created stage in /rss/spack-20161204/var/spack/stage/bzip2-1.0.6-y37ln2uyixh4hdxovx5hz2klnkdfapxl
==> patch() function failed for bzip2
==> Error: TypeError: argument of type 'ArchSpec' is not iterable
```


Discussion:

Resolving patch:
diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py
--- a/lib/spack/spack/spec.py
+++ b/lib/spack/spack/spec.py
@@ -449,6 +449,9 @@ def __str__(self):
     def __repr__(self):
         return str(self)
 
+    def __contains__(self, string):
+        return string in str(self)
+
 
 @key_ordering
 class CompilerSpec(object):


Test patch:
Repository: spack/spack

Issue:
flex and scotch conflicts
Hello,

I was trying to install something else that through the chain wanted to install `scotch`.  I originally thought that `scotch` was failing, it had a bunch of `undefined reference to scotchyywrap` stuff going on.  The great google gods led me to [here](http://stackoverflow.com/questions/1811125/undefined-reference-to-yywrap), and I realized it was probably a `flex` conflict.  I really have no idea what these things are doing, but `scotch@6.0.3` could not install using `flex@2.6.2`.  I simply commented out the `2.6.2` version of flex (therefore defaulting to `2.6.1`) and then `scotch@6.0.3` was able to install.

If it means anything, the package that was ultimately installing both of these was `eigen` which came from a complicated `opencv` (test) installation.

If helpful, I am compiling with `gcc 5.3.1`.  Unsure if anybody else is even affected by this, but figured I'd post it in case it's helpful to somebody else somewhere :)


Discussion:
Confirmed that this bug occurs for me on CentOS 6 with GCC 6.1.0. Confirmed that rolling back to an older version of flex works. Will submit PR shortly.

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/scotch/package.py b/var/spack/repos/builtin/packages/scotch/package.py
--- a/var/spack/repos/builtin/packages/scotch/package.py
+++ b/var/spack/repos/builtin/packages/scotch/package.py
@@ -50,7 +50,7 @@ class Scotch(Package):
     variant('metis', default=True,
             description='Build metis and parmetis wrapper libraries')
 
-    depends_on('flex', type='build')
+    depends_on('flex@:2.6.1', type='build')
     depends_on('bison', type='build')
     depends_on('mpi', when='+mpi')
     depends_on('zlib', when='+compression')


Test patch:
Repository: spack/spack

Issue:
Decompressing a .zip file spits out thousands of lines of text
If you run `spack install` on a package that downloads a .zip archive, the decompression stage spits out thousands of lines of text like:
```
inflating: sys/java/jre/glnxa64/jre/lib/security/cacerts  
```
You can suppress this output by using `unzip -q` or `unzip -qq` if you want it to be really quiet. I tried adding this to `spack.util.compression.decompressor_for`, but `which()` can't accept a second argument. Can someone else figure this out? We should probably also add it to `spack create`, which is much easier.

Here are a list of packages for testing:

- bliss
- bowtie2
- cryptopp
- docbook-xml
- exodusii
- jasper
- py-3to2
- triangle
- ncl
- openscenegraph
- py-pydatalog


Discussion:
call `add_default_arg('-q')` (or `-qq`) on the `Executable` object returned by `which` in `decompressor_for()`

Resolving patch:
diff --git a/lib/spack/spack/cmd/create.py b/lib/spack/spack/cmd/create.py
--- a/lib/spack/spack/cmd/create.py
+++ b/lib/spack/spack/cmd/create.py
@@ -314,7 +314,7 @@ def __call__(self, stage, url):
         if stage.archive_file.endswith('.zip'):
             try:
                 unzip  = which('unzip')
-                output = unzip('-l', stage.archive_file, output=str)
+                output = unzip('-lq', stage.archive_file, output=str)
             except:
                 output = ''
         else:
diff --git a/lib/spack/spack/util/compression.py b/lib/spack/spack/util/compression.py
--- a/lib/spack/spack/util/compression.py
+++ b/lib/spack/spack/util/compression.py
@@ -45,6 +45,7 @@ def decompressor_for(path, extension=None):
     if ((extension and re.match(r'\.?zip$', extension)) or
             path.endswith('.zip')):
         unzip = which('unzip', required=True)
+        unzip.add_default_arg('-q')
         return unzip
     if extension and re.match(r'gz', extension):
         gunzip = which('gunzip', required=True)


Test patch:
Repository: spack/spack

Issue:
NCO versions not being detected properly
```
$ spack checksum nco
==> Found 5 versions of nco
  4.6.2     https://github.com/nco/nco/archive/4.6.2.tar.gz
  04        https://github.com/nco/nco/archive/4.6.3-alpha04.tar.gz
  03        https://github.com/nco/nco/archive/4.6.2-beta03.tar.gz
  02        https://github.com/nco/nco/archive/4.6.3-alpha02.tar.gz
  01        https://github.com/nco/nco/archive/4.6.2-beta01.tar.gz
```
Looks like we need to add another regex for this URL scheme. I would expect the alpha/beta versions to look like `4.6.3-alpha04` instead of `04`.


Discussion:

Resolving patch:
diff --git a/lib/spack/spack/url.py b/lib/spack/spack/url.py
--- a/lib/spack/spack/url.py
+++ b/lib/spack/spack/url.py
@@ -189,7 +189,7 @@ def parse_version_offset(path, debug=False):
         (r'github.com/.+/(?:zip|tar)ball/v?((\d+\.)+\d+_(\d+))$', path),
 
         # e.g. https://github.com/hpc/lwgrp/archive/v1.0.1.tar.gz
-        (r'github.com/[^/]+/[^/]+/archive/v?(\d+(?:\.\d+)*)$', path),
+        (r'github.com/[^/]+/[^/]+/archive/v?(\w+(?:[.-]\w+)*)$', path),
 
         # e.g. https://github.com/erlang/otp/tarball/OTP_R15B01 (erlang style)
         (r'[-_](R\d+[AB]\d*(-\d+)?)', path),


Test patch:
diff --git a/lib/spack/spack/test/url_parse.py b/lib/spack/spack/test/url_parse.py
--- a/lib/spack/spack/test/url_parse.py
+++ b/lib/spack/spack/test/url_parse.py
@@ -331,3 +331,12 @@ def test_r_xml_version(self):
         self.check(
             'xml', '3.98-1.4',
             'https://cran.r-project.org/src/contrib/XML_3.98-1.4.tar.gz')
+
+    def test_nco_version(self):
+        self.check(
+            'nco', '4.6.2-beta03',
+            'https://github.com/nco/nco/archive/4.6.2-beta03.tar.gz')
+
+        self.check(
+            'nco', '4.6.3-alpha04',
+            'https://github.com/nco/nco/archive/4.6.3-alpha04.tar.gz')
Repository: spack/spack

Issue:
luaposix (lmod) fetch error
Link and md5 correct in package.py, .... but debug shows incorrect path during install:

```python
homepage = "https://github.com/luaposix/luaposix/"
url      = "https://github.com/luaposix/luaposix/archive/release-v33.4.0.tar.gz"

version('33.4.0', 'b36ff049095f28752caeb0b46144516c')
```
```
==> Fetching from https://github.com/luaposix/luaposix/archive/33.4.0.tar.gz failed.
==> Failed to fetch file from URL: https://github.com/luaposix/luaposix/archive/33.4.0.tar.gz
    URL https://github.com/luaposix/luaposix/archive/33.4.0.tar.gz was not found!
```


Discussion:
The [package](https://github.com/LLNL/spack/blob/develop/var/spack/repos/builtin/packages/lua-luaposix/package.py) could probably use a proper `url_for_version` method.

I think we need to figure out how to offload some of the URL special cases from Spack's `url.py` to package files.  @adamjstewart might like that.
Getting rid of special cases is good, but hiding complexity inside of the Spack core libraries is probably better. My goal is that someone who has never even heard of Python can easily use and contribute packages to Spack.
Would it be possible to use the link containing the git SHA1 of the release ?

Resolving patch:
diff --git a/lib/spack/spack/url.py b/lib/spack/spack/url.py
--- a/lib/spack/spack/url.py
+++ b/lib/spack/spack/url.py
@@ -193,7 +193,7 @@ def parse_version_offset(path, debug=False):
         (r'github.com/[^/]+/yorick/archive/y_(\d+(?:_\d+)*)$', path),
 
         # e.g. https://github.com/hpc/lwgrp/archive/v1.0.1.tar.gz
-        (r'github.com/[^/]+/[^/]+/archive/v?(\w+(?:[.-]\w+)*)$', path),
+        (r'github.com/[^/]+/[^/]+/archive/(?:release-)?v?(\w+(?:[.-]\w+)*)$', path),  # noqa
 
         # e.g. https://github.com/erlang/otp/tarball/OTP_R15B01 (erlang style)
         (r'[-_](R\d+[AB]\d*(-\d+)?)', path),


Test patch:
diff --git a/lib/spack/spack/test/url_parse.py b/lib/spack/spack/test/url_parse.py
--- a/lib/spack/spack/test/url_parse.py
+++ b/lib/spack/spack/test/url_parse.py
@@ -345,3 +345,8 @@ def test_yorick_version(self):
         self.check(
             'yorick', '2_2_04',
             'https://github.com/dhmunro/yorick/archive/y_2_2_04.tar.gz')
+
+    def test_luaposix_version(self):
+        self.check(
+            'luaposix', '33.4.0',
+            'https://github.com/luaposix/luaposix/archive/release-v33.4.0.tar.gz')
Repository: spack/spack

Issue:
spack find does not accept same specs as other commands
The following works:
```
$ spack find hdf5~mpi
```
but the following equivalent command does not:
```
$ spack find hdf5 -mpi
usage: spack find [-h] [-s | -p | -d] [-l] [-L] [-f] [-e | -E] [-u] [-m] [-v]
                  [-M] [-N]
                  [constraint [constraint ...]]
spack find: error: argument -p/--paths: ignored explicit argument 'i'
```


Discussion:
That is due to @alalazo in 5b5894af.  @alalazo: is there a reason you changed this to `nargs='*'` as opposed to using `nargs=argparse.REMAINDER`?  In general the spec parsing should use `REMAINDER` to avoid the issue above with dashes.
@tgamblin Not really. I think it's just lack of tests + the fact that I never used `-mpi` to substitute `~mpi`. If there's no hurry I'll self assign this to me and have a look at it tomorrow.

Resolving patch:
diff --git a/lib/spack/spack/cmd/common/arguments.py b/lib/spack/spack/cmd/common/arguments.py
--- a/lib/spack/spack/cmd/common/arguments.py
+++ b/lib/spack/spack/cmd/common/arguments.py
@@ -75,7 +75,7 @@ def _specs(self, **kwargs):
 
 
 _arguments['constraint'] = Args(
-    'constraint', nargs='*', action=ConstraintAction,
+    'constraint', nargs=argparse.REMAINDER, action=ConstraintAction,
     help='Constraint to select a subset of installed packages')
 
 _arguments['module_type'] = Args(
diff --git a/lib/spack/spack/cmd/find.py b/lib/spack/spack/cmd/find.py
--- a/lib/spack/spack/cmd/find.py
+++ b/lib/spack/spack/cmd/find.py
@@ -117,7 +117,8 @@ def find(parser, args):
 
     # Exit early if no package matches the constraint
     if not query_specs and args.constraint:
-        msg = "No package matches the query: {0}".format(args.constraint)
+        msg = "No package matches the query: {0}".format(
+            ' '.join(args.constraint))
         tty.msg(msg)
         return
 


Test patch:
Repository: spack/spack

Issue:
boost-1.55 compilation issue with gcc-5
I got a failure compiling boost 1.55.0 with gcc 5.4.0 (got hit by [this](https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=197594)). 
```
boost error: no matching function for call to ‘call_once
```
From the thread it seems that 1.56 is fine.

How does one blacklist a specific compiler/compiler version for a specific version of a package?


Discussion:
I guess another solution is to patch the 1.55.0 version. Which one is preferable?

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
@@ -130,6 +130,9 @@ class Boost(Package):
     # Patch fix from https://svn.boost.org/trac/boost/ticket/11856
     patch('boost_11856.patch', when='@1.60.0%gcc@4.4.7')
 
+    # Patch fix from https://svn.boost.org/trac/boost/ticket/10125
+    patch('boost_10125.patch', when='@1.55.0%gcc@5.0:5.9')
+
     def url_for_version(self, version):
         """
         Handle Boost's weird URLs,


Test patch:
Repository: spack/spack

Issue:
Python error in m4 package file for OS X 10.11
Receiving an error on OS X 10.11.6 (using Homebrew installed gcc@6.2.0):

```
==> Already patched m4
==> Building m4 [AutotoolsPackage]
==> Executing phase : 'autoreconf'
==> Executing phase : 'configure'
==> Error: AttributeError: 'str' object has no attribute 'version'
```

It looks like the `.version` of `platform_os` does not exist as referenced in m4 package.py:
```
(spec.architecture.platform_os.version == '10.12')
```

This appears to have been introduced in commit 6ef6428331db023cc8f7af2ca5ff86ab488ad777 .


Discussion:
@davydden 
something must have changed since September and now `spec.architecture.platform_os` mis-behaves.  @tgamblin  @alalazo any ideas?
@davydden Here's [the history](https://github.com/LLNL/spack/commits/develop/lib/spack/spack/architecture.py) for `architecture.py`. I don't have an OSX machine to do it myself, but I would try checking out 193f68083f71f43027e8c89e11319b9e64a70bce and see if it works. Then go on with the other commits in the history and check which one breaks the package.
i think `platform_os` used to contain an object of type `OperatingSystem` but now it is a string. I will try to dig more...
ok, this behaviour is due to 552b4eae9e633e380e9ebe323222dc6a805aaaa2 . @xjrc how can one get `os` version after your patch?

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/m4/package.py b/var/spack/repos/builtin/packages/m4/package.py
--- a/var/spack/repos/builtin/packages/m4/package.py
+++ b/var/spack/repos/builtin/packages/m4/package.py
@@ -23,7 +23,6 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 ##############################################################################
 from spack import *
-import sys
 
 
 class M4(AutotoolsPackage):
@@ -52,8 +51,9 @@ def configure_args(self):
             args.append('--without-libsigsegv-prefix')
 
         # http://lists.gnu.org/archive/html/bug-m4/2016-09/msg00002.html
-        if (sys.platform == 'darwin') and (spec.satisfies('%gcc')) and \
-           (spec.architecture.platform_os.version == '10.12'):
+        arch = spec.architecture
+        if (arch.platform == 'darwin' and arch.platform_os == 'sierra' and
+            '%gcc' in spec):
             args.append('ac_cv_type_struct_sched_param=yes')
 
         return args


Test patch:
Repository: spack/spack

Issue:
python: str object is not callable
i get the following error:
```
==> Building py-mpmath [PythonPackage]
==> Executing phase : 'build'
==> Error: TypeError: 'str' object is not callable
/Users/davydden/spack/lib/spack/spack/build_systems/python.py:115, in setup_py:
     112      def setup_py(self, *args):
     113          setup = self.setup_file()
     114
  >> 115          with working_dir(self.build_directory()):
     116              self.python(setup, '--no-user-cfg', *args)
```


Discussion:
@davydden Give me a sec. This is a thing the slipped from a rebase.

Resolving patch:
diff --git a/lib/spack/spack/build_systems/python.py b/lib/spack/spack/build_systems/python.py
--- a/lib/spack/spack/build_systems/python.py
+++ b/lib/spack/spack/build_systems/python.py
@@ -112,7 +112,7 @@ def python(self, *args):
     def setup_py(self, *args):
         setup = self.setup_file()
 
-        with working_dir(self.build_directory()):
+        with working_dir(self.build_directory):
             self.python(setup, '--no-user-cfg', *args)
 
     # The following phases and their descriptions come from:


Test patch: