From 227cf291b26a29aa4848bc04438205a75a4827bf Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Wed, 22 Oct 2025 08:45:18 +0200 Subject: [PATCH] Warn on unknown settings instead of failing This makes it easier to adopt new settings or keep compat with older versions of mkosi. --- mkosi/config.py | 6 ++++-- mkosi/resources/man/mkosi.news.7.md | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/mkosi/config.py b/mkosi/config.py index cec8dcdf1..31c199088 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -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"] diff --git a/mkosi/resources/man/mkosi.news.7.md b/mkosi/resources/man/mkosi.news.7.md index 0b77ceee8..428ab346c 100644 --- a/mkosi/resources/man/mkosi.news.7.md +++ b/mkosi/resources/man/mkosi.news.7.md @@ -37,6 +37,11 @@ - 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 -- 2.47.3