]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Remove sandbox verb from needs_build()
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 3 Nov 2024 19:18:39 +0000 (20:18 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 3 Nov 2024 19:34:50 +0000 (20:34 +0100)
It's not a clear cut case whether the sandbox needs a build or not.
The needs_build() method was originally intended for verbs that need
a full image build but the sandbox build only needs the tools tree.
Also, the tools tree is only built if ToolsTree=default and not if
set explicitly.

More practically, we don't want the JSON history from .mkosi-private
to be used when using mkosi sandbox, and that's the only usage of
the needs_build() method, so to fix that problem let's remove the sandbox
verb from needs_build().

mkosi/__init__.py
mkosi/config.py

index dfc59d27d0699a2d73bdcb50f0cf05e0dbf690e3..afcc21b00416800cfd8fb68490ab2511ab04579f 100644 (file)
@@ -4596,7 +4596,7 @@ def run_verb(args: Args, images: Sequence[Config], *, resources: Path) -> None:
 
         return
 
-    assert args.verb.needs_build()
+    assert args.verb == Verb.sandbox or args.verb.needs_build()
 
     if (
         tools
index 75bdb140193d7cea3b60eddf4dcd372c9f146c6f..0d09ce2da908fa4352a96de088b8ade9b8c76fd5 100644 (file)
@@ -104,7 +104,6 @@ class Verb(StrEnum):
             Verb.serve,
             Verb.burn,
             Verb.sysupdate,
-            Verb.sandbox,
         )
 
     def needs_config(self) -> bool: