diff --git a/etc/spack/defaults/packages.yaml b/etc/spack/defaults/base/packages.yaml similarity index 100% rename from etc/spack/defaults/packages.yaml rename to etc/spack/defaults/base/packages.yaml diff --git a/etc/spack/defaults/include.yaml b/etc/spack/defaults/include.yaml new file mode 100644 index 00000000000..40b7cddcb60 --- /dev/null +++ b/etc/spack/defaults/include.yaml @@ -0,0 +1,4 @@ +include: + - path: "${platform}" + optional: true + - path: base diff --git a/lib/spack/spack/config.py b/lib/spack/spack/config.py index 717dfa0c511..0e06d307da1 100644 --- a/lib/spack/spack/config.py +++ b/lib/spack/spack/config.py @@ -13,8 +13,7 @@ #. ``site`` #. ``user`` -And corresponding :ref:`per-platform scopes `. Important -functions in this module are: +Important functions in this module are: * :func:`~spack.config.Configuration.get_config` * :func:`~spack.config.Configuration.update_config` @@ -819,19 +818,6 @@ def override( 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 #: python code that evaluates to a boolean and or explicit specification #: as optional. @@ -967,9 +953,6 @@ def create_incremental() -> Generator[Configuration, None, None]: # add each scope and its platform-specific directory for name, path in configuration_paths: 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 # data from the one below. This can be tricky, but it enables us to have a # single unified config system. diff --git a/lib/spack/spack/main.py b/lib/spack/spack/main.py index 4a2755209cf..3507e70b85a 100644 --- a/lib/spack/spack/main.py +++ b/lib/spack/spack/main.py @@ -881,9 +881,6 @@ def add_command_line_scopes( spack.config.DirectoryConfigScope(name, path, writable=False), priority=ConfigScopePriority.CUSTOM, ) - spack.config._add_platform_scope( - cfg, name, path, priority=ConfigScopePriority.CUSTOM, writable=False - ) continue else: raise spack.error.ConfigError(f"Invalid configuration scope: {path}")