diff --git a/lib/spack/spack/compiler.py b/lib/spack/spack/compiler.py index 8ed125ae24f..31067a14d9f 100644 --- a/lib/spack/spack/compiler.py +++ b/lib/spack/spack/compiler.py @@ -275,7 +275,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 976a9777fcd..81460882108 100644 --- a/lib/spack/spack/schema/compilers.py +++ b/lib/spack/spack/schema/compilers.py @@ -61,7 +61,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": implicit_rpaths, "environment": spack.schema.environment.definition,