Allow usage of config variables and env variables with include_concrete
(#45871)
* Allow usage of spack config vars in concrete env path * Update docs on usage of spack config vars in concrete env path
This commit is contained in:
parent
0f7c1b5e38
commit
1a379215da
@ -539,7 +539,9 @@ from the command line.
|
|||||||
|
|
||||||
You can also include an environment directly in the ``spack.yaml`` file. It
|
You can also include an environment directly in the ``spack.yaml`` file. It
|
||||||
involves adding the ``include_concrete`` heading in the yaml followed by the
|
involves adding the ``include_concrete`` heading in the yaml followed by the
|
||||||
absolute path to the independent environments.
|
absolute path to the independent environments. Note, that you may use Spack
|
||||||
|
config variables such as ``$spack`` or environment variables as long as the
|
||||||
|
expression expands to an absolute path.
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
@ -549,7 +551,7 @@ absolute path to the independent environments.
|
|||||||
unify: true
|
unify: true
|
||||||
include_concrete:
|
include_concrete:
|
||||||
- /absolute/path/to/environment1
|
- /absolute/path/to/environment1
|
||||||
- /absolute/path/to/environment2
|
- $spack/../path/to/environment2
|
||||||
|
|
||||||
|
|
||||||
Once the ``spack.yaml`` has been updated you must concretize the environment to
|
Once the ``spack.yaml`` has been updated you must concretize the environment to
|
||||||
|
@ -1049,7 +1049,11 @@ def add_view(name, values):
|
|||||||
|
|
||||||
def _process_concrete_includes(self):
|
def _process_concrete_includes(self):
|
||||||
"""Extract and load into memory included concrete spec data."""
|
"""Extract and load into memory included concrete spec data."""
|
||||||
self.included_concrete_envs = self.manifest[TOP_LEVEL_KEY].get(included_concrete_name, [])
|
_included_concrete_envs = self.manifest[TOP_LEVEL_KEY].get(included_concrete_name, [])
|
||||||
|
# Expand config and environment variables
|
||||||
|
self.included_concrete_envs = [
|
||||||
|
spack.util.path.canonicalize_path(_env) for _env in _included_concrete_envs
|
||||||
|
]
|
||||||
|
|
||||||
if self.included_concrete_envs:
|
if self.included_concrete_envs:
|
||||||
if os.path.exists(self.lock_path):
|
if os.path.exists(self.lock_path):
|
||||||
|
Loading…
Reference in New Issue
Block a user