]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Warn on unknown settings instead of failing 3971/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 22 Oct 2025 06:45:18 +0000 (08:45 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 22 Oct 2025 11:03:15 +0000 (13:03 +0200)
This makes it easier to adopt new settings or keep compat with older
versions of mkosi.

mkosi/config.py
mkosi/resources/man/mkosi.news.7.md

index cec8dcdf18f709437a31ace277f9119b46585959..31c1990884c691d570f6ef5312d3e4c11728cbf8 100644 (file)
@@ -1921,7 +1921,8 @@ def make_simple_config_parser(
                 continue
 
             if not (s := lookup_by_name.get(name)):
-                die(f"{path.absolute()}: Unknown setting {name}")
+                logging.warning(f"{path.absolute()}: Unknown setting {name}")
+                continue
 
             if section != s.section:
                 logging.warning(
@@ -4949,7 +4950,8 @@ class ParseContext:
                     )
 
                 if not (s := SETTINGS_LOOKUP_BY_NAME.get(name)):
-                    die(f"{path.absolute()}: Unknown setting {name}")
+                    logging.warning(f"{path.absolute()}: Unknown setting {name}")
+                    continue
 
                 image = self.config["image"]
 
index 0b77ceee873cb83c3e0898df8f3acced837fff7e..428ab346c0186d5425a9dd60c10ec57bd6ee76e7 100644 (file)
 - The `RuntimeScratch=` option has been dropped. Use `RuntimeSize=`
   instead to grow the image before booting it.
 - The `CDROM=` option has been dropped.
+- Unknown settings now generate a warning message instead of failing the
+  image build. This allows configs to work across a wider range of mkosi
+  versions while still taking advantage of newer settings. MinimumVersion
+  can still be used to enforce a minimum version of mkosi that knows all
+  required settings.
 
 ## v25