diff --git a/lib/spack/spack/compiler.py b/lib/spack/spack/compiler.py index 72d56e590f4..d799ca01ea3 100644 --- a/lib/spack/spack/compiler.py +++ b/lib/spack/spack/compiler.py @@ -290,7 +290,7 @@ def __init__( operating_system, target, paths, - modules=None, + modules: Optional[List[str]] = None, alias=None, environment=None, extra_rpaths=None, diff --git a/lib/spack/spack/schema/compilers.py b/lib/spack/spack/schema/compilers.py index 1df696cda98..c894c2e32e3 100644 --- a/lib/spack/spack/schema/compilers.py +++ b/lib/spack/spack/schema/compilers.py @@ -52,7 +52,10 @@ "target": {"type": "string"}, "alias": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "modules": { - "anyOf": [{"type": "string"}, {"type": "null"}, {"type": "array"}] + "anyOf": [ + {"type": "null"}, + {"type": "array", "items": {"type": "string"}}, + ] }, "implicit_rpaths": { "anyOf": [