]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Revert "mkosi: Always use the embedded default version when no release is specified"
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 26 Oct 2022 21:16:56 +0000 (23:16 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 27 Oct 2022 08:07:37 +0000 (10:07 +0200)
This reverts commit 093d48a97b8211ff549f78f2b3b2ef77fcd45573.

I used mkosi without any explicit distro/version parameters and was surprised
that it built for Fedora 36 after successfully detecting that it's running on
Fedora 37. Using the host version is more likely to be what users expect, and
also avoids the awkward issue that when we hardcode some default version, this
version is likely to be "wrong" (not the latest) until both the distro and we
make a release.

Looking at this more generally, if we have some constant config that doesn't
specify the distro version, we have three possible source of the version
default: host distro version, latest version that was known was mkosi was
released, and actual latest released distro version. It is nice to use the
first option, because that is what users generally expect, and also this makes
mkosi "stable", i.e. we may upgrade it at any time and users will not observe
unexpected changes in defaults. This makes mkosi closer to guidelines for
upgrades in stable distros, see
https://docs.fedoraproject.org/en-US/fesco/Updates_Policy/#stable-releases.

093d48a97b8211ff549f78f2b3b2ef77fcd45573 was aiming for "consistent results",
but this gives consistency with the wrong thing. For a normal user, the host
distro version would never change "unexpectedly", and in fact it is expected
that the defaults of programs change when the host distro is upgraded and not
at any other time. Mkosi itself should provide stable and backwards-compatible
behaviour over releases.

NEWS.md
mkosi/__init__.py

diff --git a/NEWS.md b/NEWS.md
index bee99a5124930c167a550475195b380aa0503b5c..92ac3fa3f4a6894bbb15a101c2aab3467355c7a0 100644 (file)
--- a/NEWS.md
+++ b/NEWS.md
@@ -44,6 +44,8 @@
 - Split dm-verity artifacts default names have been changed to match what
   `systemd` and other tools expect: `image.root.raw`, `image.root.verity`,
   `image.root.roothash`, `image.root.roothash.p7s` (same for `usr` variants).
+- `mkosi` will again default to the same OS release as the host system when the
+  host system uses the same distribution as the image that's being built.
 
 ## v13
 
index 8475af9013b13094fb05acfabd595600a8d18ff5..7e63e40565bc87ecd0eb5adc2883704c10e758e1 100644 (file)
@@ -5878,6 +5878,9 @@ def load_distribution(args: argparse.Namespace) -> argparse.Namespace:
         if args.distribution is None:
             args.distribution = d
 
+        if args.distribution == d and args.release is None:
+            args.release = r
+
     if args.distribution is None:
         die("Couldn't detect distribution.")