summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/environment/environment.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/spack/spack/environment/environment.py b/lib/spack/spack/environment/environment.py
index b6875653df..720819695b 100644
--- a/lib/spack/spack/environment/environment.py
+++ b/lib/spack/spack/environment/environment.py
@@ -1897,10 +1897,14 @@ class Environment(object):
fs.mkdirp(pkg_dir)
spack.repo.path.dump_provenance(dep, pkg_dir)
- # write the lock file last
+ self._update_and_write_manifest(raw_yaml_dict, yaml_dict)
+
+ # Write the lock file last. This is useful for Makefiles
+ # with `spack.lock: spack.yaml` rules, where the target
+ # should be newer than the prerequisite to avoid
+ # redundant re-concretization.
with fs.write_tmp_and_move(self.lock_path) as f:
sjson.dump(self._to_lockfile_dict(), stream=f)
- self._update_and_write_manifest(raw_yaml_dict, yaml_dict)
else:
with fs.safe_remove(self.lock_path):
self._update_and_write_manifest(raw_yaml_dict, yaml_dict)