unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Attila Lendvai <attila@lendvai.name>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 56799@debbugs.gnu.org, Maxim Cournoyer <maxim.cournoyer@gmail.com>
Subject: bug#56799: (gnu services configuration) usage of *unspecified* is problematic
Date: Mon, 08 Aug 2022 22:27:32 +0000	[thread overview]
Message-ID: <DdbGT0j9-gqlFuSurMIdU89IKjh-DSoHe40ILSbh7qW29r5TIeRwanmFtDimp2u3o42MKIgsjiw1wQ8gyB0q6NoXTZwADYwvY7YjHG5sEGo=@lendvai.name> (raw)
In-Reply-To: <877d3omc9c.fsf@gnu.org>

i got back online...


> That said, whether it’s ‘unspecified?’ or something else, you have to
> have a check in place, right? With the new interface it becomes:
>
> (if (eq? port 'unset) #f port)
>
> Or you can provide an actual default value (an integer in this case),
> but that’s possible whether or not unspecified is the default value.


i agree.


> With the xvnc example, I better understand the kind of situation where
> a field value might end up directly in a gexp, though I’m still unsure
> whether use of unspecified really makes things worse. At least,
> because it lacks a read syntax, the problem is caught early on; whereas
> with 'unset, you might end up stuffing 'unset in your config file
> without noticing.


i agree with this, too.

also, seems like it didn't register in this discussion, so i press it once again: if the default/unspecified value is a symbol (any symbol), then those configuration fields, whose type is set to be of symbol, will not error when they are left unspecified. (see the FIELD-SANITIZER: it simply does a (IF (PRED VALUE) ...) check, which doesn't fail because 'UNSET satisfies SYMBOL?). i should have added a unit test for this...

i think moving back from *UNSPECIFIED* to using 'UNSET only has drawbacks. and if it works (read: it doesn't error out while guix is deploying the config), then it probably produces illegal config files by serializing the unspecified value into an "unset" string in the config files.

i'm obviously not aware of the entire complexity here, othrwise there wouldn't have remained a bug... but regardless of the actual API/value used, i don't see how any of this could work without the service code explicitly checking for the unspecified value for fields that have a maybe type (i.e. whose type allows the value to be unspecified). i think using a symbol instead of *unspecified* only pushes the appearance of the symptoms farther away both in time and space (otherwise there should have been a trivial fix to this without changing *unspecified* back to 'unset).

either way, if there was a failing test case that i could run locally, then i would have been more than happy to fix it... now i'm only dismayed that all my service code, and my entire channel got broken. seems like i went offline in the worst two weeks.

sidenote: what srfi-189 does is basically introduce such a special value that we are trying to hone in on here (i.e. Nothing, which is implemented as a record instance) in a standardized way, and also an API to deal with this special value in various different contexts (i.e. it exports stuff like MAYBE-IF, MAYBE-FOLD, MAYBE-AND, etc).

https://srfi.schemers.org/srfi-189/srfi-189.html

--
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
“Although teachers do care and do work very, very hard, the institution is psychopathic-it has no conscience. It rings a bell and the young man in the middle of writing a poem must close his notebook and move to a different cell where he must memorize that humans and monkeys derive from a common ancestor.”
	— John Taylor Gatto (1935–), 'Dumbing Us Down: The Hidden Curriculum of Compulsory Education' (1992)





  parent reply	other threads:[~2022-08-08 22:29 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-27 16:23 bug#56799: (gnu services configuration) usage of *unspecified* is problematic Maxim Cournoyer
2022-07-27 16:43 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
2022-07-27 18:27   ` Attila Lendvai
2022-07-28 15:15     ` Maxim Cournoyer
2022-07-27 18:31   ` Maxim Cournoyer
2022-07-27 18:45     ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
2022-07-27 19:09       ` Maxim Cournoyer
2022-07-27 19:45         ` bug#56799: [PATCH] services: configuration: Step back from *unspecified* Maxim Cournoyer
2022-07-27 19:46         ` bug#56799: (gnu services configuration) usage of *unspecified* is problematic Maxim Cournoyer
2022-07-27 20:20           ` bug#56799: [PATCH v2] gexp: Handle *unspecified* as a gexp input Maxim Cournoyer
2022-07-27 21:43             ` Maxime Devos
2022-07-28 14:58               ` Maxim Cournoyer
2022-07-28  4:41           ` bug#56799: [PATCH v3] " Maxim Cournoyer
2022-08-01  5:08             ` bug#56799: (gnu services configuration) usage of *unspecified* is problematic Maxim Cournoyer
2022-08-01 10:00               ` Maxime Devos
2022-08-01 12:46                 ` Maxim Cournoyer
2022-08-01 13:44             ` Ludovic Courtès
2022-08-01 16:55       ` Maxim Cournoyer
2022-07-28  4:55     ` bokr
2022-07-28 10:26       ` Maxime Devos
2022-07-28 15:09         ` Maxim Cournoyer
2022-08-01 13:49 ` Ludovic Courtès
2022-08-01 15:55   ` Maxim Cournoyer
2022-08-02  7:31     ` Ludovic Courtès
2022-08-02  8:45       ` bokr
2022-08-02 15:06       ` Maxim Cournoyer
2022-08-04 12:19         ` Ludovic Courtès
2022-08-07 22:44           ` Ludovic Courtès
2022-08-08 22:27           ` Attila Lendvai [this message]
2022-08-08 23:35             ` Attila Lendvai
2022-08-10  2:17               ` Maxim Cournoyer
2022-08-10  3:26             ` Maxim Cournoyer
2022-08-11 10:15               ` Attila Lendvai
2022-08-13  6:31                 ` Maxim Cournoyer
2022-08-13 16:47                   ` Attila Lendvai
2022-08-14  2:57                     ` Maxim Cournoyer
2022-08-16 14:00                       ` Attila Lendvai
2022-08-17 13:16                         ` Maxim Cournoyer
2022-08-17 16:00                           ` paren--- via Bug reports for GNU Guix
2022-08-10  0:43           ` Maxim Cournoyer
2022-08-24 12:40 ` bug#56799: [PATCH 1/5] services: configuration: Add a 'maybe-value-set?' procedure Attila Lendvai
2022-08-24 12:40   ` bug#56799: [PATCH 2/5] services: configuration: Add %unset-value exported variable Attila Lendvai
2022-08-24 12:40   ` bug#56799: [PATCH 3/5] services: configuration: Add maybe-value exported procedure Attila Lendvai
2022-08-24 12:40   ` bug#56799: [PATCH 4/5] services: Use the new maybe/unset API Attila Lendvai
2022-08-25  4:18     ` bug#56799: (gnu services configuration) usage of *unspecified* is problematic Maxim Cournoyer
2022-08-24 12:40   ` bug#56799: [PATCH 5/5] services: configuration: Change the value of the unset marker Attila Lendvai
2022-08-25  4:14     ` bug#56799: (gnu services configuration) usage of *unspecified* is problematic Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='DdbGT0j9-gqlFuSurMIdU89IKjh-DSoHe40ILSbh7qW29r5TIeRwanmFtDimp2u3o42MKIgsjiw1wQ8gyB0q6NoXTZwADYwvY7YjHG5sEGo=@lendvai.name' \
    --to=attila@lendvai.name \
    --cc=56799@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    --cc=maxim.cournoyer@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).