We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Installation issue: lua-luafilesystem
I have a nightly CI build that now dies while trying to do a `spack install lua-luafilesystem`.  This occurred upon the the merge of #11528 

In other words, I am seeing that `lua-luafilesystem` will not install using commit eb584d8 but will install from 8e3fd3f.

This is on CentOS 7 , gcc 8.2.0

### Steps to reproduce the issue

```
[spack]$ git checkout eb584d8
Previous HEAD position was 8e3fd3f... tty: make tty.* print exception types
HEAD is now at eb584d8... refactor: remove unused spack.stage._get_mirrors() function
[spack]$ ./bin/spack install lua-luafilesystem
...
==> lua is already installed in /home/osolberg/temp/spack/opt/spack/linux-centos7-x86_64/gcc-8.2.0/lua-5.3.5-fulv52lir6poddzxeogk7rgrqglnkbon
==> Installing lua-luafilesystem
==> Searching for binary cache of lua-luafilesystem
==> Finding buildcaches in /bifx/apps/spack/mirror/build_cache
==> No binary for lua-luafilesystem found: installing from source
==> Using cached archive: /home/osolberg/temp/spack/var/spack/cache/lua-luafilesystem/lua-luafilesystem-1_7_0_2.tar.gz
==> Staging archive: /home/osolberg/temp/spack/var/spack/stage/lua-luafilesystem-1_7_0_2-dhumhtidskeakxzmlru6qnprnpw7lthz/v1_7_0_2.tar.gz
==> Created stage in /home/osolberg/temp/spack/var/spack/stage/lua-luafilesystem-1_7_0_2-dhumhtidskeakxzmlru6qnprnpw7lthz
==> No patches needed for lua-luafilesystem
==> Building lua-luafilesystem [Package]
==> Error: OSError: [Errno 2] No such file or directory: '/home/osolberg/temp/spack/var/spack/stage/lua-luafilesystem-1_7_0_2-dhumhtidskeakxzmlru6qnprnpw7lthz/src'

/home/osolberg/temp/spack/lib/spack/spack/package.py:1577, in build_process:
       1574                    echo = logger.echo
       1575                    self.log()
       1576
  >>   1577                # Run post install hooks before build stage is removed.
       1578                spack.hooks.post_install(self.spec)
       1579
       1580            # Stop timer.

```

### Platform and user environment

```commandline
[spack]$ uname -a
Linux bifx1n03.bold.bio 3.10.0-957.1.3.el7.x86_64 #1 SMP Thu Nov 29 14:49:43 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

[spack]$ ./bin/spack spec --install-status lua-luafilesystem
Input spec
--------------------------------
 -   lua-luafilesystem

Concretized
--------------------------------
 -   lua-luafilesystem@1_7_0_2%gcc@8.2.0 arch=linux-centos7-x86_64
[+]      ^git@2.21.0%gcc@8.2.0~tcltk arch=linux-centos7-x86_64
[+]          ^autoconf@2.69%gcc@8.2.0 arch=linux-centos7-x86_64
[+]              ^m4@1.4.18%gcc@8.2.0 patches=3877ab548f88597ab2327a2230ee048d2d07ace1062efe81fc92e91b7f39cd00,c0a408fbffb7255fcc75e26bd8edab116fc81d216bfd18b473668b7739a4158e,fc9b61654a3ba1a8d6cd78ce087e7c96366c290bc8d2c299f09828d793b853c8 +sigsegv arch=linux-centos7-x86_64
[+]                  ^libsigsegv@2.11%gcc@8.2.0 arch=linux-centos7-x86_64
[+]              ^perl@5.26.2%gcc@8.2.0+cpanm patches=0eac10ed90aeb0459ad8851f88081d439a4e41978e586ec743069e8b059370ac +shared+threads arch=linux-centos7-x86_64
[+]                  ^gdbm@1.18.1%gcc@8.2.0 arch=linux-centos7-x86_64
[+]                      ^readline@7.0%gcc@8.2.0 arch=linux-centos7-x86_64
[+]                          ^ncurses@6.1%gcc@8.2.0~symlinks~termlib arch=linux-centos7-x86_64
[+]                              ^pkgconf@1.6.0%gcc@8.2.0 arch=linux-centos7-x86_64
[+]          ^automake@1.16.1%gcc@8.2.0 arch=linux-centos7-x86_64
[+]          ^curl@7.63.0%gcc@8.2.0~darwinssl~gssapi~libssh~libssh2~nghttp2 arch=linux-centos7-x86_64
[+]              ^openssl@1.1.1b%gcc@8.2.0+systemcerts arch=linux-centos7-x86_64
[+]                  ^zlib@1.2.11%gcc@8.2.0+optimize+pic+shared arch=linux-centos7-x86_64
[+]          ^expat@2.2.5%gcc@8.2.0+libbsd arch=linux-centos7-x86_64
[+]              ^libbsd@0.9.1%gcc@8.2.0 arch=linux-centos7-x86_64
[+]          ^gettext@0.19.8.1%gcc@8.2.0+bzip2+curses+git~libunistring+libxml2 patches=9acdb4e73f67c241b5ef32505c9ddf7cf6884ca8ea661692f21dca28483b04b8 +tar+xz arch=linux-centos7-x86_64
[+]              ^bzip2@1.0.6%gcc@8.2.0+shared arch=linux-centos7-x86_64
[+]                  ^diffutils@3.7%gcc@8.2.0 arch=linux-centos7-x86_64
[+]              ^libxml2@2.9.9%gcc@8.2.0~python arch=linux-centos7-x86_64
[+]                  ^libiconv@1.15%gcc@8.2.0 arch=linux-centos7-x86_64
[+]                  ^xz@5.2.4%gcc@8.2.0 arch=linux-centos7-x86_64
[+]              ^tar@1.31%gcc@8.2.0 arch=linux-centos7-x86_64
[+]          ^libtool@2.4.6%gcc@8.2.0 arch=linux-centos7-x86_64
[+]          ^pcre@8.42%gcc@8.2.0+jit+multibyte+utf arch=linux-centos7-x86_64
[+]      ^lua@5.3.5%gcc@8.2.0 arch=linux-centos7-x86_64
[+]          ^unzip@6.0%gcc@8.2.0 arch=linux-centos7-x86_64
```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `var/spack/repos/builtin/packages/lua-luafilesystem/package.py`
Content:
```
1 # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
2 # Spack Project Developers. See the top-level COPYRIGHT file for details.
3 #
4 # SPDX-License-Identifier: (Apache-2.0 OR MIT)
5 
6 import os.path
7 
8 
9 class LuaLuafilesystem(Package):
10     """LuaFileSystem is a Lua library developed to complement the set of
11     functions related to file systems offered by the standard Lua distribution.
12 
13     LuaFileSystem offers a portable way to access the underlying directory
14     structure and file attributes.
15 
16     LuaFileSystem is free software and uses the same license as Lua 5.1
17     """
18 
19     homepage = 'http://keplerproject.github.io/luafilesystem'
20     url = 'https://github.com/keplerproject/luafilesystem/archive/v1_6_3.tar.gz'
21 
22     version('1_7_0_2', sha256='23b4883aeb4fb90b2d0f338659f33a631f9df7a7e67c54115775a77d4ac3cc59')
23     version('1_6_3', 'bed11874cfded8b4beed7dd054127b24')
24 
25     # The version constraint here comes from this post:
26     #
27     # https://www.perforce.com/blog/git-beyond-basics-using-shallow-clones
28     #
29     # where it is claimed that full shallow clone support was added @1.9
30     depends_on('git@1.9.0:', type='build')
31     extends('lua')
32 
33     @property
34     def rockspec(self):
35         version = self.spec.version
36         semver = version[0:3]
37         tweak_level = version[3] if len(version) > 3 else 1
38         fmt = os.path.join(
39             self.stage.path,
40             'luafilesystem-{version.underscored}',
41             'rockspecs',
42             'luafilesystem-{semver.dotted}-{tweak_level}.rockspec'
43         )
44         return fmt.format(
45             version=version, semver=semver, tweak_level=tweak_level
46         )
47 
48     def install(self, spec, prefix):
49         luarocks('--tree=' + prefix, 'install', self.rockspec)
50
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/var/spack/repos/builtin/packages/lua-luafilesystem/package.py b/var/spack/repos/builtin/packages/lua-luafilesystem/package.py
--- a/var/spack/repos/builtin/packages/lua-luafilesystem/package.py
+++ b/var/spack/repos/builtin/packages/lua-luafilesystem/package.py
@@ -36,8 +36,7 @@
         semver = version[0:3]
         tweak_level = version[3] if len(version) > 3 else 1
         fmt = os.path.join(
-            self.stage.path,
-            'luafilesystem-{version.underscored}',
+            self.stage.source_path,
             'rockspecs',
             'luafilesystem-{semver.dotted}-{tweak_level}.rockspec'
         )

{"golden_diff": "diff --git a/var/spack/repos/builtin/packages/lua-luafilesystem/package.py b/var/spack/repos/builtin/packages/lua-luafilesystem/package.py\n--- a/var/spack/repos/builtin/packages/lua-luafilesystem/package.py\n+++ b/var/spack/repos/builtin/packages/lua-luafilesystem/package.py\n@@ -36,8 +36,7 @@\n         semver = version[0:3]\n         tweak_level = version[3] if len(version) > 3 else 1\n         fmt = os.path.join(\n-            self.stage.path,\n-            'luafilesystem-{version.underscored}',\n+            self.stage.source_path,\n             'rockspecs',\n             'luafilesystem-{semver.dotted}-{tweak_level}.rockspec'\n         )\n", "issue": "Installation issue: lua-luafilesystem\nI have a nightly CI build that now dies while trying to do a `spack install lua-luafilesystem`.  This occurred upon the the merge of #11528 \r\n\r\nIn other words, I am seeing that `lua-luafilesystem` will not install using commit eb584d8 but will install from 8e3fd3f.\r\n\r\nThis is on CentOS 7 , gcc 8.2.0\r\n\r\n### Steps to reproduce the issue\r\n\r\n```\r\n[spack]$ git checkout eb584d8\r\nPrevious HEAD position was 8e3fd3f... tty: make tty.* print exception types\r\nHEAD is now at eb584d8... refactor: remove unused spack.stage._get_mirrors() function\r\n[spack]$ ./bin/spack install lua-luafilesystem\r\n...\r\n==> lua is already installed in /home/osolberg/temp/spack/opt/spack/linux-centos7-x86_64/gcc-8.2.0/lua-5.3.5-fulv52lir6poddzxeogk7rgrqglnkbon\r\n==> Installing lua-luafilesystem\r\n==> Searching for binary cache of lua-luafilesystem\r\n==> Finding buildcaches in /bifx/apps/spack/mirror/build_cache\r\n==> No binary for lua-luafilesystem found: installing from source\r\n==> Using cached archive: /home/osolberg/temp/spack/var/spack/cache/lua-luafilesystem/lua-luafilesystem-1_7_0_2.tar.gz\r\n==> Staging archive: /home/osolberg/temp/spack/var/spack/stage/lua-luafilesystem-1_7_0_2-dhumhtidskeakxzmlru6qnprnpw7lthz/v1_7_0_2.tar.gz\r\n==> Created stage in /home/osolberg/temp/spack/var/spack/stage/lua-luafilesystem-1_7_0_2-dhumhtidskeakxzmlru6qnprnpw7lthz\r\n==> No patches needed for lua-luafilesystem\r\n==> Building lua-luafilesystem [Package]\r\n==> Error: OSError: [Errno 2] No such file or directory: '/home/osolberg/temp/spack/var/spack/stage/lua-luafilesystem-1_7_0_2-dhumhtidskeakxzmlru6qnprnpw7lthz/src'\r\n\r\n/home/osolberg/temp/spack/lib/spack/spack/package.py:1577, in build_process:\r\n       1574                    echo = logger.echo\r\n       1575                    self.log()\r\n       1576\r\n  >>   1577                # Run post install hooks before build stage is removed.\r\n       1578                spack.hooks.post_install(self.spec)\r\n       1579\r\n       1580            # Stop timer.\r\n\r\n```\r\n\r\n### Platform and user environment\r\n\r\n```commandline\r\n[spack]$ uname -a\r\nLinux bifx1n03.bold.bio 3.10.0-957.1.3.el7.x86_64 #1 SMP Thu Nov 29 14:49:43 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux\r\n\r\n[spack]$ ./bin/spack spec --install-status lua-luafilesystem\r\nInput spec\r\n--------------------------------\r\n -   lua-luafilesystem\r\n\r\nConcretized\r\n--------------------------------\r\n -   lua-luafilesystem@1_7_0_2%gcc@8.2.0 arch=linux-centos7-x86_64\r\n[+]      ^git@2.21.0%gcc@8.2.0~tcltk arch=linux-centos7-x86_64\r\n[+]          ^autoconf@2.69%gcc@8.2.0 arch=linux-centos7-x86_64\r\n[+]              ^m4@1.4.18%gcc@8.2.0 patches=3877ab548f88597ab2327a2230ee048d2d07ace1062efe81fc92e91b7f39cd00,c0a408fbffb7255fcc75e26bd8edab116fc81d216bfd18b473668b7739a4158e,fc9b61654a3ba1a8d6cd78ce087e7c96366c290bc8d2c299f09828d793b853c8 +sigsegv arch=linux-centos7-x86_64\r\n[+]                  ^libsigsegv@2.11%gcc@8.2.0 arch=linux-centos7-x86_64\r\n[+]              ^perl@5.26.2%gcc@8.2.0+cpanm patches=0eac10ed90aeb0459ad8851f88081d439a4e41978e586ec743069e8b059370ac +shared+threads arch=linux-centos7-x86_64\r\n[+]                  ^gdbm@1.18.1%gcc@8.2.0 arch=linux-centos7-x86_64\r\n[+]                      ^readline@7.0%gcc@8.2.0 arch=linux-centos7-x86_64\r\n[+]                          ^ncurses@6.1%gcc@8.2.0~symlinks~termlib arch=linux-centos7-x86_64\r\n[+]                              ^pkgconf@1.6.0%gcc@8.2.0 arch=linux-centos7-x86_64\r\n[+]          ^automake@1.16.1%gcc@8.2.0 arch=linux-centos7-x86_64\r\n[+]          ^curl@7.63.0%gcc@8.2.0~darwinssl~gssapi~libssh~libssh2~nghttp2 arch=linux-centos7-x86_64\r\n[+]              ^openssl@1.1.1b%gcc@8.2.0+systemcerts arch=linux-centos7-x86_64\r\n[+]                  ^zlib@1.2.11%gcc@8.2.0+optimize+pic+shared arch=linux-centos7-x86_64\r\n[+]          ^expat@2.2.5%gcc@8.2.0+libbsd arch=linux-centos7-x86_64\r\n[+]              ^libbsd@0.9.1%gcc@8.2.0 arch=linux-centos7-x86_64\r\n[+]          ^gettext@0.19.8.1%gcc@8.2.0+bzip2+curses+git~libunistring+libxml2 patches=9acdb4e73f67c241b5ef32505c9ddf7cf6884ca8ea661692f21dca28483b04b8 +tar+xz arch=linux-centos7-x86_64\r\n[+]              ^bzip2@1.0.6%gcc@8.2.0+shared arch=linux-centos7-x86_64\r\n[+]                  ^diffutils@3.7%gcc@8.2.0 arch=linux-centos7-x86_64\r\n[+]              ^libxml2@2.9.9%gcc@8.2.0~python arch=linux-centos7-x86_64\r\n[+]                  ^libiconv@1.15%gcc@8.2.0 arch=linux-centos7-x86_64\r\n[+]                  ^xz@5.2.4%gcc@8.2.0 arch=linux-centos7-x86_64\r\n[+]              ^tar@1.31%gcc@8.2.0 arch=linux-centos7-x86_64\r\n[+]          ^libtool@2.4.6%gcc@8.2.0 arch=linux-centos7-x86_64\r\n[+]          ^pcre@8.42%gcc@8.2.0+jit+multibyte+utf arch=linux-centos7-x86_64\r\n[+]      ^lua@5.3.5%gcc@8.2.0 arch=linux-centos7-x86_64\r\n[+]          ^unzip@6.0%gcc@8.2.0 arch=linux-centos7-x86_64\r\n```\n", "before_files": [{"content": "# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other\n# Spack Project Developers. See the top-level COPYRIGHT file for details.\n#\n# SPDX-License-Identifier: (Apache-2.0 OR MIT)\n\nimport os.path\n\n\nclass LuaLuafilesystem(Package):\n    \"\"\"LuaFileSystem is a Lua library developed to complement the set of\n    functions related to file systems offered by the standard Lua distribution.\n\n    LuaFileSystem offers a portable way to access the underlying directory\n    structure and file attributes.\n\n    LuaFileSystem is free software and uses the same license as Lua 5.1\n    \"\"\"\n\n    homepage = 'http://keplerproject.github.io/luafilesystem'\n    url = 'https://github.com/keplerproject/luafilesystem/archive/v1_6_3.tar.gz'\n\n    version('1_7_0_2', sha256='23b4883aeb4fb90b2d0f338659f33a631f9df7a7e67c54115775a77d4ac3cc59')\n    version('1_6_3', 'bed11874cfded8b4beed7dd054127b24')\n\n    # The version constraint here comes from this post:\n    #\n    # https://www.perforce.com/blog/git-beyond-basics-using-shallow-clones\n    #\n    # where it is claimed that full shallow clone support was added @1.9\n    depends_on('git@1.9.0:', type='build')\n    extends('lua')\n\n    @property\n    def rockspec(self):\n        version = self.spec.version\n        semver = version[0:3]\n        tweak_level = version[3] if len(version) > 3 else 1\n        fmt = os.path.join(\n            self.stage.path,\n            'luafilesystem-{version.underscored}',\n            'rockspecs',\n            'luafilesystem-{semver.dotted}-{tweak_level}.rockspec'\n        )\n        return fmt.format(\n            version=version, semver=semver, tweak_level=tweak_level\n        )\n\n    def install(self, spec, prefix):\n        luarocks('--tree=' + prefix, 'install', self.rockspec)\n", "path": "var/spack/repos/builtin/packages/lua-luafilesystem/package.py"}], "after_files": [{"content": "# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other\n# Spack Project Developers. See the top-level COPYRIGHT file for details.\n#\n# SPDX-License-Identifier: (Apache-2.0 OR MIT)\n\nimport os.path\n\n\nclass LuaLuafilesystem(Package):\n    \"\"\"LuaFileSystem is a Lua library developed to complement the set of\n    functions related to file systems offered by the standard Lua distribution.\n\n    LuaFileSystem offers a portable way to access the underlying directory\n    structure and file attributes.\n\n    LuaFileSystem is free software and uses the same license as Lua 5.1\n    \"\"\"\n\n    homepage = 'http://keplerproject.github.io/luafilesystem'\n    url = 'https://github.com/keplerproject/luafilesystem/archive/v1_6_3.tar.gz'\n\n    version('1_7_0_2', sha256='23b4883aeb4fb90b2d0f338659f33a631f9df7a7e67c54115775a77d4ac3cc59')\n    version('1_6_3', 'bed11874cfded8b4beed7dd054127b24')\n\n    # The version constraint here comes from this post:\n    #\n    # https://www.perforce.com/blog/git-beyond-basics-using-shallow-clones\n    #\n    # where it is claimed that full shallow clone support was added @1.9\n    depends_on('git@1.9.0:', type='build')\n    extends('lua')\n\n    @property\n    def rockspec(self):\n        version = self.spec.version\n        semver = version[0:3]\n        tweak_level = version[3] if len(version) > 3 else 1\n        fmt = os.path.join(\n            self.stage.source_path,\n            'rockspecs',\n            'luafilesystem-{semver.dotted}-{tweak_level}.rockspec'\n        )\n        return fmt.format(\n            version=version, semver=semver, tweak_level=tweak_level\n        )\n\n    def install(self, spec, prefix):\n        luarocks('--tree=' + prefix, 'install', self.rockspec)\n", "path": "var/spack/repos/builtin/packages/lua-luafilesystem/package.py"}]}