Compare commits
1 Commits
develop
...
remove-pla
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f85f50d64e |
4
etc/spack/defaults/include.yaml
Normal file
4
etc/spack/defaults/include.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
include:
|
||||||
|
- path: "${platform}"
|
||||||
|
optional: true
|
||||||
|
- path: base
|
@ -13,8 +13,7 @@
|
|||||||
#. ``site``
|
#. ``site``
|
||||||
#. ``user``
|
#. ``user``
|
||||||
|
|
||||||
And corresponding :ref:`per-platform scopes <platform-scopes>`. Important
|
Important functions in this module are:
|
||||||
functions in this module are:
|
|
||||||
|
|
||||||
* :func:`~spack.config.Configuration.get_config`
|
* :func:`~spack.config.Configuration.get_config`
|
||||||
* :func:`~spack.config.Configuration.update_config`
|
* :func:`~spack.config.Configuration.update_config`
|
||||||
@ -819,19 +818,6 @@ def override(
|
|||||||
assert scope is overrides
|
assert scope is overrides
|
||||||
|
|
||||||
|
|
||||||
def _add_platform_scope(
|
|
||||||
cfg: Configuration, name: str, path: str, priority: ConfigScopePriority, writable: bool = True
|
|
||||||
) -> None:
|
|
||||||
"""Add a platform-specific subdirectory for the current platform."""
|
|
||||||
import spack.platforms # circular dependency
|
|
||||||
|
|
||||||
platform = spack.platforms.host().name
|
|
||||||
scope = DirectoryConfigScope(
|
|
||||||
f"{name}/{platform}", os.path.join(path, platform), writable=writable
|
|
||||||
)
|
|
||||||
cfg.push_scope(scope, priority=priority)
|
|
||||||
|
|
||||||
|
|
||||||
#: Class for the relevance of an optional path conditioned on a limited
|
#: Class for the relevance of an optional path conditioned on a limited
|
||||||
#: python code that evaluates to a boolean and or explicit specification
|
#: python code that evaluates to a boolean and or explicit specification
|
||||||
#: as optional.
|
#: as optional.
|
||||||
@ -967,9 +953,6 @@ def create_incremental() -> Generator[Configuration, None, None]:
|
|||||||
# add each scope and its platform-specific directory
|
# add each scope and its platform-specific directory
|
||||||
for name, path in configuration_paths:
|
for name, path in configuration_paths:
|
||||||
cfg.push_scope(DirectoryConfigScope(name, path), priority=ConfigScopePriority.CONFIG_FILES)
|
cfg.push_scope(DirectoryConfigScope(name, path), priority=ConfigScopePriority.CONFIG_FILES)
|
||||||
# Each scope can have per-platform overrides in subdirectories
|
|
||||||
_add_platform_scope(cfg, name, path, priority=ConfigScopePriority.CONFIG_FILES)
|
|
||||||
|
|
||||||
# yield the config incrementally so that each config level's init code can get
|
# yield the config incrementally so that each config level's init code can get
|
||||||
# data from the one below. This can be tricky, but it enables us to have a
|
# data from the one below. This can be tricky, but it enables us to have a
|
||||||
# single unified config system.
|
# single unified config system.
|
||||||
|
@ -881,9 +881,6 @@ def add_command_line_scopes(
|
|||||||
spack.config.DirectoryConfigScope(name, path, writable=False),
|
spack.config.DirectoryConfigScope(name, path, writable=False),
|
||||||
priority=ConfigScopePriority.CUSTOM,
|
priority=ConfigScopePriority.CUSTOM,
|
||||||
)
|
)
|
||||||
spack.config._add_platform_scope(
|
|
||||||
cfg, name, path, priority=ConfigScopePriority.CUSTOM, writable=False
|
|
||||||
)
|
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
raise spack.error.ConfigError(f"Invalid configuration scope: {path}")
|
raise spack.error.ConfigError(f"Invalid configuration scope: {path}")
|
||||||
|
Loading…
Reference in New Issue
Block a user