GNU bug report logs - #49200
[PATCH] import: go: Fix match-error in 'go-package-description'

Previous Next

Package: guix-patches;

Reported by: Sarah Morgensen <iskarian <at> mgsn.dev>

Date: Wed, 23 Jun 2021 22:47:01 UTC

Severity: normal

Tags: patch

Done: Björn Höfling <bjoern.hoefling <at> bjoernhoefling.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 49200 in the body.
You can then email your comments to 49200 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#49200; Package guix-patches. (Wed, 23 Jun 2021 22:47:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sarah Morgensen <iskarian <at> mgsn.dev>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Wed, 23 Jun 2021 22:47:01 GMT) Full text and rfc822 format available.

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

From: Sarah Morgensen <iskarian <at> mgsn.dev>
To: guix-patches <at> gnu.org
Subject: [PATCH] import: go: Fix match-error in 'go-package-description'
Date: Wed, 23 Jun 2021 15:46:46 -0700
* guix/import/go.scm (go-package-description): Make sure description* is
always a list, so the result is properly matched.
---
Hello Guix,

In the process of using `guix import go` I encountered a rare issue when the
go.pkg.dev Documentation and UnitInfo sections for a package are both blank:

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix import go github.com/neelance/sourcemap
Backtrace:
In ice-9/boot-9.scm:
  1752:10  7 (with-exception-handler _ _ #:unwind? _ # _)
In unknown file:
           6 (apply-smob/0 #<thunk 7fd10955ef60>)
In ice-9/boot-9.scm:
    724:2  5 (call-with-prompt _ _ #<procedure default-prompt-handle…>)
In ice-9/eval.scm:
    619:8  4 (_ #(#(#<directory (guile-user) 7fd109558c80>)))
In guix/ui.scm:
  2147:12  3 (run-guix-command _ . _)
In guix/scripts/import.scm:
   120:11  2 (guix-import . _)
In guix/scripts/import/go.scm:
   118:27  1 (guix-import-go . _)
In guix/import/go.scm:
    191:4  0 (go-module->guix-package _ #:goproxy _ #:version _ # _)

guix/import/go.scm:191:4: In procedure go-module->guix-package:
Throw to key `match-error' with args `("match" "no matching pattern" #f)'.
--8<---------------cut here---------------end--------------->8---

Looks like the error is due to using false where the empty list was expected.
This tiny patch fixes that. Copyright for go.scm was added in
<https://issues.guix.gnu.org/49196>.

Sarah

 guix/import/go.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/guix/import/go.scm b/guix/import/go.scm
index d110954664..cf8c62abe2 100644
--- a/guix/import/go.scm
+++ b/guix/import/go.scm
@@ -186,8 +186,9 @@ e.g. \"google.golang.org/protobuf/proto\"."
          (description (if (not (null? overview))
                           overview
                           (select-content sxml)))
-         (description* (and (not (null? description))
-                            (first description))))
+         (description* (if (not (null? description))
+                           (first description)
+                           description)))
     (match description*
       (() #f)                           ;nothing selected
       ((p elements ...)

base-commit: 1f3d7b45349d43e5cc02594083e0cd44ef730992
-- 
2.31.1





Information forwarded to guix-patches <at> gnu.org:
bug#49200; Package guix-patches. (Mon, 28 Jun 2021 06:56:02 GMT) Full text and rfc822 format available.

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

From: Björn Höfling <bjoern.hoefling <at> bjoernhoefling.de>
To: Sarah Morgensen via Guix-patches via <guix-patches <at> gnu.org>
Cc: 49200-done <at> debbugs.gnu.org, Sarah Morgensen <iskarian <at> mgsn.dev>
Subject: Re: [bug#49200] [PATCH] import: go: Fix match-error in
 'go-package-description'
Date: Mon, 28 Jun 2021 08:54:58 +0200
[Message part 1 (text/plain, inline)]
On Wed, 23 Jun 2021 15:46:46 -0700
Sarah Morgensen via Guix-patches via <guix-patches <at> gnu.org> wrote:

> * guix/import/go.scm (go-package-description): Make sure description*
> is always a list, so the result is properly matched.


Pushed as

9d9152425e96c408357d0f4961767a5c08076c13

Thanks,

Björn
[Message part 2 (application/pgp-signature, inline)]

Reply sent to Björn Höfling <bjoern.hoefling <at> bjoernhoefling.de>:
You have taken responsibility. (Mon, 28 Jun 2021 06:56:02 GMT) Full text and rfc822 format available.

Notification sent to Sarah Morgensen <iskarian <at> mgsn.dev>:
bug acknowledged by developer. (Mon, 28 Jun 2021 06:56:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 26 Jul 2021 11:24:05 GMT) Full text and rfc822 format available.

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

Previous Next


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