]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Resolve dependencies before calling load_config()
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 9 Feb 2024 11:21:22 +0000 (12:21 +0100)
committerJörg Behrmann <behrmann@physik.fu-berlin.de>
Fri, 9 Feb 2024 12:28:21 +0000 (13:28 +0100)
Let's not call load_config() for images that we're going to discard
immediately after.

Fixes #2348

mkosi/config.py

index dc8dc409a4fdaa6b17dfcb87bd409b72a5addc00..4f9ed5dbb30884f9f91db76700d816924a528fe0 100644 (file)
@@ -2784,7 +2784,7 @@ def create_argument_parser(action: type[argparse.Action]) -> argparse.ArgumentPa
     return parser
 
 
-def resolve_deps(images: Sequence[Config], include: Sequence[str]) -> list[Config]:
+def resolve_deps(images: Sequence[argparse.Namespace], include: Sequence[str]) -> list[argparse.Namespace]:
     graph = {config.image: config.dependencies for config in images}
 
     if include:
@@ -3197,8 +3197,8 @@ def parse_config(argv: Sequence[str] = (), *, resources: Path = Path("/")) -> tu
     if not images:
         die("No images defined in mkosi.images/")
 
-    images = [load_config(args, ns) for ns in images]
     images = resolve_deps(images, include)
+    images = [load_config(args, ns) for ns in images]
 
     return args, tuple(images)