GNU bug report logs - #50914
[PATCH] records: Raise a &fix-hint if a field has multiple values.

Previous Next

Package: guix-patches;

Reported by: Maxime Devos <maximedevos <at> telenet.be>

Date: Thu, 30 Sep 2021 09:33:01 UTC

Severity: normal

Tags: patch

Full log


Message #14 received at 50914 <at> debbugs.gnu.org (full text, mbox):

From: Jack Hill <jackhill <at> jackhill.us>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 50914 <at> debbugs.gnu.org
Subject: Re: [bug#50914] [PATCH] records: Raise a &fix-hint if a field has
 multiple values.
Date: Tue, 5 Oct 2021 00:06:54 -0400 (EDT)
[Message part 1 (text/plain, inline)]
On Mon, 4 Oct 2021, Jack Hill wrote:

> Wow, thanks for picking up on an annoyance I mentioned on IRC an providing a 
> patch!
>
> On Thu, 30 Sep 2021, Maxime Devos wrote:
>
>> * guix/records.scm (report-invalid-field-specifier): If
>>  'weird' is something like (field (record ...) extra ...), hint that 'extra
>>  ...' should probably be moved inside (record ...).
>> ---
>
> I don't have any comments on the code directly, but while the error message 
> is much improved, and would have helped me find my mistake quicker, it's 
> still a bit verbose and doesn't seem to be printing your nice error message.

I did perturb the package definition in different ways and got your error 
message

```
error: field ‘uri’ should only have one value, but an extra value ‘(sha256 (base32 0idhpvafy0gy3bdvw98q974wdv2x6vld2sv1f95ssl4l226cdqs4))’ was passed as well.  Perhaps this extra value was supposed to be a field specifier, and needs to be moved inside the record ‘(git-reference (url https://github.com/mvz/email-outlook-message-perl) (commit dd382f47fd112032bf91cb673178a27142d23e38))’?
hint: (uri (git-reference (url "https://github.com/mvz/email-outlook-message-perl") (commit
"dd382f47fd112032bf91cb673178a27142d23e38") (sha256 (base32
"0idhpvafy0gy3bdvw98q974wdv2x6vld2sv1f95ssl4l226cdqs4")) (file-name (git-file-name
name version))))
```

with

```
(define-public msgconvert
  (package
    (name "msgconvert")
    (version "0.920")
    (source
     (origin
       (method git-fetch)
       (uri
        (git-reference
         (url "https://github.com/mvz/email-outlook-message-perl")
         (commit "dd382f47fd112032bf91cb673178a27142d23e38" ;; (string-append "v" version)
))
        (sha256
         (base32 "0idhpvafy0gy3bdvw98q974wdv2x6vld2sv1f95ssl4l226cdqs4"))
        (file-name (git-file-name name version)))))
    (build-system perl-build-system)
    (native-inputs
     `(("perl-module-build" ,perl-module-build)))
    (inputs
     `(("perl-email-address" ,perl-email-address)
       ("perl-email-mime" ,perl-email-mime)
       ("perl-email-mime-contenttype" ,perl-email-mime-contenttype)
       ("perl-email-sender" ,perl-email-sender)
       ("perl-email-simple" ,perl-email-simple)
       ("perl-io-all" ,perl-io-all)
       ("perl-io-string" ,perl-io-string)
       ("perl-ole-storage-lite" ,perl-ole-storage-lite)))
    (home-page "https://www.matijs.net/software/msgconv")
    (synopsis "Foo")
    (description "Foo.")
    (license license:gpl1+)))
```

Best,
Jack

This bug report was last modified 3 years and 252 days ago.

Previous Next


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