summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorScott Wittenburg <scott.wittenburg@kitware.com>2020-08-12 13:12:00 -0600
committerScott Wittenburg <scott.wittenburg@kitware.com>2020-09-14 10:37:42 -0600
commit28ef5b12040662d40ad7b58042b86c3da186da76 (patch)
treea1dd67a46f6b99a3fff9d69cb81e616414546e56 /lib
parent031490f6aa80a3a6eb4acaab73a23fad3197ee7c (diff)
downloadspack-28ef5b12040662d40ad7b58042b86c3da186da76.tar.gz
spack-28ef5b12040662d40ad7b58042b86c3da186da76.tar.bz2
spack-28ef5b12040662d40ad7b58042b86c3da186da76.tar.xz
spack-28ef5b12040662d40ad7b58042b86c3da186da76.zip
Do not assume we sit in the directory where the env file lives.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/ci.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/spack/spack/cmd/ci.py b/lib/spack/spack/cmd/ci.py
index 61f866693e..e0b9b6e0fa 100644
--- a/lib/spack/spack/cmd/ci.py
+++ b/lib/spack/spack/cmd/ci.py
@@ -237,8 +237,11 @@ def ci_rebuild(args):
# Make a copy of the environment file, so we can overwrite the changed
# version in between the two invocations of "spack install"
- env_src_path = os.path.join(current_directory, 'spack.yaml')
- env_dst_path = os.path.join(current_directory, 'spack.yaml_BACKUP')
+ env_src_path = env.manifest_path
+ env_dirname = os.path.dirname(env_src_path)
+ env_filename = os.path.basename(env_src_path)
+ env_copyname = '{0}_BACKUP'.format(env_filename)
+ env_dst_path = os.path.join(env_dirname, env_copyname)
shutil.copyfile(env_src_path, env_dst_path)
tty.debug('job concrete spec path: {0}'.format(job_spec_yaml_path))
@@ -327,8 +330,10 @@ def ci_rebuild(args):
first_pass_args))
spack_cmd(*first_pass_args)
- # Overwrite the changed environment file so it doesn't
+ # Overwrite the changed environment file so it doesn't break
# the next install invocation.
+ tty.debug('Copying {0} to {1}'.format(
+ env_dst_path, env_src_path))
shutil.copyfile(env_dst_path, env_src_path)
second_pass_args = install_args + [