unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Jack Hill <jackhill@jackhill.us>
To: Maxime Devos <maximedevos@telenet.be>
Cc: 50914@debbugs.gnu.org
Subject: [bug#50914] [PATCH] records: Raise a &fix-hint if a field has multiple values.
Date: Mon, 4 Oct 2021 22:02:18 -0400 (EDT)	[thread overview]
Message-ID: <alpine.DEB.2.21.2110042156400.4243@marsh.hcoop.net> (raw)
In-Reply-To: <20210930093229.4730-1-maximedevos@telenet.be>

[-- Attachment #1: Type: text/plain, Size: 2919 bytes --]

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. The error I now get is,

```
gnu/packages/mail.scm:2884:2: error: (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"))))) (sha256 (base32 "0idhpvafy0gy3bdvw98q974wdv2x6vld2sv1f95ssl4l226cdqs4")) (file-name (git-file-name name version)) (build-system perl-build-system) (native-inputs (quasiquote (("perl-module-build" (unquote perl-module-build))))) (inputs (quasiquote (("perl-email-address" (unquote perl-email-address)) ("perl-email-mime" (unquote perl-email-mime)) ("perl-email-mime-contenttype" (unquote perl-email-mime-contenttype)) ("perl-email-sender" (unquote perl-email-sender)) ("perl-email-simple" (unquote perl-email-simple)) ("perl-io-all" (unquote perl-io-all)) ("perl-io-string" (unquote perl-io-string)) ("perl-ole-storage-lite" (unquote perl-ole-storage-lite))))) (home-page "https://www.matijs.net/software/msgconv") (synopsis "Foo") (description "
 Foo.") (license license:gpl1+)): extraneous field initializers (sha256 file-name)
```

For reference, the faulty package definition I used to test:

```
(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

  parent reply	other threads:[~2021-10-05  2:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-30  9:32 [bug#50914] [PATCH] records: Raise a &fix-hint if a field has multiple values Maxime Devos
2021-10-04 14:26 ` Ludovic Courtès
2021-10-05  2:02 ` Jack Hill [this message]
2021-10-05  4:06   ` Jack Hill

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=alpine.DEB.2.21.2110042156400.4243@marsh.hcoop.net \
    --to=jackhill@jackhill.us \
    --cc=50914@debbugs.gnu.org \
    --cc=maximedevos@telenet.be \
    /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).