[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#50914] [PATCH] records: Raise a &fix-hint if a field has multiple v
From: |
Jack Hill |
Subject: |
[bug#50914] [PATCH] records: Raise a &fix-hint if a field has multiple values. |
Date: |
Tue, 5 Oct 2021 00:06:54 -0400 (EDT) |
User-agent: |
Alpine 2.21 (DEB 202 2017-01-01) |
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