guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Layout of ‘define-configuration’ records


From: Maxim Cournoyer
Subject: Re: Layout of ‘define-configuration’ records
Date: Sun, 20 Nov 2022 08:47:47 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Hi Katherine,

Katherine Cox-Buday <cox.katherine.e@gmail.com> writes:

> Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:
>
>>> Moving the field last is problematic as we’ve seen for any user that
>>> uses ‘match’ on records—something that’s not recommended but still
>>> used a lot.
>
> Some feedback I hope is useful:
>
> I'm one such newbie, and had to stumble my way into discovering why some
> of my services suddenly broke. All I had to go on was with "invalid
> G-expression input" at a location in an `operating-system` declaration.
>
> Initially, because of the reference to gexps, I thought something had
> changed with `local-file` which I am using to deploy source code off of
> a local branch. Through trial and error and reading git logs, I
> discovered this was not the case, and saw that `define-configuration`
> had changed. From there I was able to discover the problem.
>
>> Yep. I had that on mind when I made the change, though I still missed
>> a few occurrences.
>
> I came looking for an announcement of this change somewhere on a mailing
> list (info-guix maybe?) or the Guix blog but couldn't find anything. I
> understand the focus is on in-repo code, but could we consider
> announcing changes which might affect channels and such? I don't always
> have time to stay up to date with the changes to the project :(

Apologies for causing grief!  Ironically, the change was motivated by
going through such pain myself when attempting to migrate the
mcron-configuration from a define-record-type* to a define-configuration
produced record, that's why I wanted to standardize their layout.

I'm taking yours and Ludovic's feedback into account for the future and
will reach out to guix-devel with heads-up when introducing breaking
changes to Guix APIs.  A side-note, it seems that Ludovic has been
working toward eliminating the use of match patterns matching the fields
directly, instead encouraging the use of 'match-record', see
https://issues.guix.gnu.org/59390.  I haven't checked if this is
compatible with define-configuration records though.

-- 
Thanks,
Maxim



reply via email to

[Prev in Thread] Current Thread [Next in Thread]