]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Make more trees required 2973/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 23 Aug 2024 18:34:23 +0000 (20:34 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 23 Aug 2024 19:44:13 +0000 (21:44 +0200)
- Tools tree is a universal setting and has to be available at the start
- Sandbox trees are a universal setting and have to be available at the start
- Skeleton trees should be available at the start to make sure caching works
  properly

mkosi/config.py
mkosi/resources/mkosi.md

index 03b5407a5dfc92827e33a4705b3f19de4c394289..60f3ba452d0d6246e360517e610483321669996d 100644 (file)
@@ -539,12 +539,12 @@ def config_parse_key(value: Optional[str], old: Optional[str]) -> Optional[Path]
     return parse_path(value, secret=True) if Path(value).exists() else Path(value)
 
 
-def make_tree_parser(absolute: bool = True) -> Callable[[str], ConfigTree]:
+def make_tree_parser(absolute: bool = True, required: bool = False) -> Callable[[str], ConfigTree]:
     def parse_tree(value: str) -> ConfigTree:
         src, sep, tgt = value.partition(':')
 
         return ConfigTree(
-            source=parse_path(src, required=False),
+            source=parse_path(src, required=required),
             target=parse_path(
                 tgt,
                 required=False,
@@ -2017,7 +2017,7 @@ SETTINGS = (
         compat_longs=("--package-manager-tree",),
         metavar="PATH",
         section="Distribution",
-        parse=config_make_list_parser(delimiter=",", parse=make_tree_parser()),
+        parse=config_make_list_parser(delimiter=",", parse=make_tree_parser(required=True)),
         help="Use a sandbox tree to configure the various tools that mkosi executes",
         paths=("mkosi.sandbox", "mkosi.sandbox.tar", "mkosi.pkgmngr", "mkosi.pkgmngr.tar",),
         scope=SettingScope.universal,
@@ -2285,7 +2285,7 @@ SETTINGS = (
         long="--skeleton-tree",
         metavar="PATH",
         section="Content",
-        parse=config_make_list_parser(delimiter=",", parse=make_tree_parser()),
+        parse=config_make_list_parser(delimiter=",", parse=make_tree_parser(required=True)),
         paths=("mkosi.skeleton", "mkosi.skeleton.tar"),
         help="Use a skeleton tree to bootstrap the image before installing anything",
     ),
@@ -2394,7 +2394,7 @@ SETTINGS = (
         dest="build_sources",
         metavar="PATH",
         section="Content",
-        parse=config_make_list_parser(delimiter=",", parse=make_tree_parser(absolute=False)),
+        parse=config_make_list_parser(delimiter=",", parse=make_tree_parser(absolute=False, required=True)),
         match=config_match_build_sources,
         default_factory=lambda ns: [ConfigTree(ns.directory, None)] if ns.directory else [],
         help="Path for sources to build",
@@ -2890,7 +2890,7 @@ SETTINGS = (
         dest="tools_tree",
         metavar="PATH",
         section="Host",
-        parse=config_make_path_parser(required=False, constants=("default",)),
+        parse=config_make_path_parser(constants=("default",)),
         paths=("mkosi.tools",),
         help="Look up programs to execute inside the given tree",
         nargs="?",
@@ -2939,7 +2939,7 @@ SETTINGS = (
         compat_longs=("--tools-tree-package-manager-tree",),
         metavar="PATH",
         section="Host",
-        parse=config_make_list_parser(delimiter=",", parse=make_tree_parser()),
+        parse=config_make_list_parser(delimiter=",", parse=make_tree_parser(required=True)),
         help="Sandbox trees for the default tools tree",
     ),
     ConfigSetting(
index 43f51349e321e84bef03468efe373aebdd36c62b..7692b2a83f52934f22a6c81860e32a718dab9b28 100644 (file)
@@ -2518,10 +2518,7 @@ for the following options, mkosi will only check whether the inputs
 exist just before building the image:
 
 - `BaseTrees=`
-- `SandboxTrees=`
-- `SkeletonTrees=`
 - `ExtraTrees=`
-- `ToolsTree=`
 - `Initrds=`
 
 To refer to outputs of a image's dependencies, simply configure any of