Skip to content

Commit 5944c20

Browse files
author
Vasileios Karakasis
committed
Fine tune PR
1 parent 8e53b0b commit 5944c20

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

reframe/core/buildsystems.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -846,12 +846,13 @@ class Spack(BuildSystem):
846846
install_opts = variable(typ.List[str], value=[])
847847

848848
def __init__(self):
849-
self._rfm_spack_env = False
849+
# Set to True if the environment was auto-generated
850+
self._auto_env = False
850851

851852
def emit_build_commands(self, environ):
852853
ret = self._env_activate_cmds()
853854

854-
if self._rfm_spack_env:
855+
if self._auto_env:
855856
install_tree = self.install_tree or 'opt/spack'
856857
ret.append(f'spack config add '
857858
f'"config:install_tree:root:{install_tree}"')
@@ -872,7 +873,7 @@ def _env_activate_cmds(self):
872873
if not self.environment:
873874
self.environment = 'rfm_spack_env'
874875
cmds.append(f'spack env create -d {self.environment}')
875-
self._rfm_spack_env = True
876+
self._auto_env = True
876877

877878
cmds.append(f'spack env activate -V -d {self.environment}')
878879
return cmds

unittests/test_buildsystems.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,9 @@ def test_spack_no_env(environ, tmp_path):
289289
f'spack install'
290290
]
291291

292+
assert build_system.environment == 'rfm_spack_env'
293+
294+
292295
def test_easybuild(environ, tmp_path):
293296
build_system = bs.EasyBuild()
294297
build_system.easyconfigs = ['ec1.eb', 'ec2.eb']

0 commit comments

Comments
 (0)