From 6b1a15189e9f02f2962c4885092533f817d0375c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 12 Mar 2026 10:00:55 +0100 Subject: [PATCH] news: Add entry for record field inherited values. * etc/news.scm: Add entry. Change-Id: Id4d40ee995f03a8fe785782513f9451c8bd71389 Merges: #6955 --- etc/news.scm | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/etc/news.scm b/etc/news.scm index a67f8901e4..de3f24edef 100644 --- a/etc/news.scm +++ b/etc/news.scm @@ -1,6 +1,6 @@ ;; GNU Guix news, for use by 'guix pull'. ;; -;; Copyright © 2019-2025 Ludovic Courtès +;; Copyright © 2019-2026 Ludovic Courtès ;; Copyright © 2019–2021, 2024 Tobias Geerinckx-Rice ;; Copyright © 2019, 2020 Miguel Ángel Arruga Vivas ;; Copyright © 2019, 2020 Konrad Hinsen @@ -43,6 +43,44 @@ (channel-news (version 0) + (entry (commit "a7c8e68dc51144a6d3981b770aca9c4897fc7c0c") + (title + (en "Records such as packages can refer to inherited values")) + (body + (en "A new feature has been added to records—the facility used when +defining packages, services, operating systems, and many other things—that, +when inheriting from another record, allows you to refer to inherited field +values. When defining package variants, you may have seen this pattern: + +@lisp +(package + (inherit gdb) + (inputs (modify-inputs (package-inputs gdb) + (delete \"guile\")))) +@end lisp + +This can now be written like this: + +@lisp +(package + (inherit gdb) + (inputs (modify-inputs inputs ;<- notice the change + (delete \"guile\")))) +@end lisp + +Within the @code{inputs} body, the @code{inputs} identifier is now bound to +the @dfn{inherited value}—i.e., the value this field inherits from @code{gdb}. +The same mechanism can be used when changing other input fields or the +@code{arguments} field. It is less verbose but also +@uref{https://issues.guix.gnu.org/50335, more accurate}. + +This change applies to all record types produced by +@code{define-record-type*}: @code{package}, @code{origin}, +@code{operating-system}, @code{home-environment}, and so on. + +Note that this is an incompatible change: the newly introduced +bindings—@code{inputs} in the example above—could shadow same-named bindings."))) + (entry (commit "b52ce9041ad58aeababd2d50d3e72bc23dffff60") (title (en "GNOME 48 is now available")