From 7585b378659fefb0c69ccb78a67731d34382e858 Mon Sep 17 00:00:00 2001
From: Greg Becker <becker33@llnl.gov>
Date: Fri, 18 Sep 2020 12:21:13 -0700
Subject: [PATCH] do out of source builds in hashed directories (#18574)

---
 lib/spack/spack/build_systems/cmake.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/spack/spack/build_systems/cmake.py b/lib/spack/spack/build_systems/cmake.py
index dfa2c9e47a..0f2970bb3e 100644
--- a/lib/spack/spack/build_systems/cmake.py
+++ b/lib/spack/spack/build_systems/cmake.py
@@ -314,7 +314,8 @@ def build_directory(self):
 
         :return: directory where to build the package
         """
-        return os.path.join(self.stage.path, 'spack-build')
+        dirname = 'spack-build=%s' % self.spec.dag_hash(7)
+        return os.path.join(self.stage.path, dirname)
 
     def cmake_args(self):
         """Produces a list containing all the arguments that must be passed to
-- 
GitLab