Skip to content

The spec parser depends on the global configuration #51727

@alalazo

Description

@alalazo

Steps to reproduce

This is reported as a bug, but it's really a tech debt. Our spec parser depends on the global user configuration since #50481 This is also reported in:

# TODO: Move toolchains out of the parser, and expand them as a separate step
self.toolchains = {}
configuration = getattr(spack.config, "CONFIG", None)
if configuration is not None:
self.toolchains = configuration.get_config("toolchains")
self.parsed_toolchains: Dict[str, "spack.spec.Spec"] = {}

We should remove this dependency, and expand toolchains in a later step.

Error message

Since toolchains are expanded very early, there are a few issues that become more acute than they would be otherwise, like #51703.

Also, the spec parser module has a dependency on config that could be removed.

Information on your system

N/A

General information

  • I have run spack debug report and reported the version of Spack/Python/Platform
  • I have searched the issues of this repo and believe this is not a duplicate
  • I have run the failing commands in debug mode and reported the output

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageThe issue needs to be prioritized

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions