unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Cc: 55407-done@debbugs.gnu.org
Subject: [bug#55407] [PATCH] system: Improve warning when using LUKS mapped devices without UUIDs.
Date: Sat, 21 May 2022 18:46:03 +0200	[thread overview]
Message-ID: <87h75iu94k.fsf@gnu.org> (raw)
In-Reply-To: <87o7zrbju2.fsf@gmail.com> (Maxim Cournoyer's message of "Sat, 21 May 2022 00:17:25 -0400")

Hi!

Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:

>>> +          (warning (N_ "\
>>> +the following mapped device may not be mounted by the bootloader: ~s
>>> +hint: specify the mapped device source via its LUKS UUID.~%"
>>> +                       "\
>>> +the following mapped devices may not be mounted by the bootloader: ~s
>>> +hint: specify the mapped device sources via their LUKS UUID.~%"
>>> +                       (length non-uuid-crypto-devices))
>>> +                   (map mapped-device-source non-uuid-crypto-devices)))
>>
>> By convention, warnings should fit on a single line and not be full
>> sentences.
>
> This is a Guix-specific convention, right?  I couldn't find a reference
> to it in the GNU Standards (info standards) document.

It’s more or less the GNU convention (info "(standards) Errors").

The bit about hints is Guix-specific, but it’s the same idea: having a
consistent way to report diagnostics.

> I'd be more of the thinking that warnings directed at *users* should
> be as human readable as possible; the motivation for my fix was
> because that for more than a year, I read that warning without having
> clue about what it really meant and had to review the source to get
> the answer.

Yes, and I agree that’s a problem.  Hopefully hints help address that.

(The Elm compiler for instance is famous for having verbose diagnostics
*and* hints.  Perhaps something to look at and take inspiration from in
the future.)

> It produced this output:
>
> /home/maxim/stow/guix/hurd.scm:109:8: warning: mapped device '/dev/sda2' may be ignored by bootloader
> /home/maxim/stow/guix/hurd.scm:113:8: warning: mapped device '/dev/sdb2' may be ignored by bootloader
> /home/maxim/stow/guix/hurd.scm:117:8: warning: mapped device '/dev/sdc2' may be ignored by bootloader
> hint: Specify mapped device sources via their LUKS UUID.

Nice.  You could even add an @example block in the hint to illustrate
what that means.

> Pushed as 39a9404c99.

Thank you!

Ludo’.




      reply	other threads:[~2022-05-21 16:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-14  6:05 [bug#55407] [PATCH] system: Improve warning when using LUKS mapped devices without UUIDs Maxim Cournoyer
2022-05-18 20:44 ` Ludovic Courtès
2022-05-21  4:17   ` bug#55407: " Maxim Cournoyer
2022-05-21 16:46     ` Ludovic Courtès [this message]

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=87h75iu94k.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=55407-done@debbugs.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).