GNU bug report logs - #49671
[PATCH] guix: records: Improve error reporting.

Previous Next

Package: guix-patches;

Reported by: Julien Lepiller <julien <at> lepiller.eu>

Date: Tue, 20 Jul 2021 23:42:02 UTC

Severity: normal

Tags: patch

Full log


View this message in rfc822 format

From: Julien Lepiller <julien <at> lepiller.eu>
To: 49671 <at> debbugs.gnu.org
Subject: [bug#49671] [PATCH] guix: records: Improve error reporting.
Date: Sun, 31 Oct 2021 03:06:35 +0100
[Message part 1 (text/plain, inline)]
Hi Guix!

Here is a new patch that attempts to better catch various causes of
syntax errors in records. I think I fixed all the concerns Ludo had,
and I draw some inspiration from https://issues.guix.gnu.org/50914 for
using conditions.

Here are examples of what you get:

(operating-system
  ())

test.scm:1:0: error: invalid field specifier: ()
hint: The format of a field is `(field value)'



(operating-system
  ((services %base-services)))

test.scm:1:0: error: invalid field specifier: (services %base-services)
is not a valid field name



(operating-system
  (services))

test.scm:1:0: error: missing value in field specifier
hint: The field is missing a value: `(services <value>)'.



(operating-system
  (services (service tor-service-type) %base-services))

test.scm:1:0: error: multiple values in field specifier
hint: 2 values were associated with field `services'.  We got the
following values:

     (service tor-service-type)
     %base-services
     

Perhaps the additional values were intended to be other field
specifiers.  This usually indicates missing or misplaced parenthesis.



(operating-system
  services %base-services)

test.scm:1:0: error: invalid field specifier: #<syntax services>
hint: The format of a field is `(field value)'



(not sure why the last one is wrapped in syntax...)
[0001-guix-records-Improve-error-reporting.patch (text/x-patch, attachment)]

This bug report was last modified 2 years and 333 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.