unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Sarah Morgensen <iskarian@mgsn.dev>
To: Stephen Paul Weber <singpolyma@singpolyma.net>
Cc: 50595@debbugs.gnu.org
Subject: bug#50595: Failure in guix import go
Date: Fri, 17 Sep 2021 14:39:58 -0700	[thread overview]
Message-ID: <86sfy2hoep.fsf@mgsn.dev> (raw)
In-Reply-To: <20210915022754.GC22238@singpolyma-beefy.lan> (Stephen Paul Weber's message of "Tue, 14 Sep 2021 21:27:54 -0500 (2 days, 40 minutes, 7 seconds ago)")

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

Hello,

Stephen Paul Weber <singpolyma@singpolyma.net> writes:

> Getting a similar failure here:
>
> $ guix import go github.com/cncf/udpa/go/
>
> following redirection to `https://proxy.golang.org/github.com/cncf/udpa/go/@v/list'...
> following redirection to `https://proxy.golang.org/github.com/cncf/udpa/go/@latest'...
> following redirection to `https://proxy.golang.org/github.com/cncf/udpa/go/@v/v0.0.0-20210322005330-6414d713912e.mod'...
> guix import: warning: Failed to import package "github.com/cncf/udpa/go/".
> reason: ("vector-ref" "Wrong type argument in position 1 (expecting vector): ~S" (#f) (#f)).
> guix import: error: failed to download meta-data for module 'github.com/cncf/udpa/go/'

This one seems to be caused by the importer incorrectly using the
repository root instead of the module path in a couple places.  The
attached patch fixes this.

Hope that helps,
--
Sarah


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: import: go: Import handling of modules in VCS subdirectories. --]
[-- Type: text/x-patch, Size: 2057 bytes --]

From b9ef64a641c20d331cf1886d71b85b81be910b30 Mon Sep 17 00:00:00 2001
Message-Id: <b9ef64a641c20d331cf1886d71b85b81be910b30.1631914185.git.iskarian@mgsn.dev>
From: Sarah Morgensen <iskarian@mgsn.dev>
Date: Thu, 16 Sep 2021 18:24:40 -0700
Subject: [PATCH] import: go: Improve handling of modules in VCS
 subdirectories.

Use the supplied module path (instead of the repository root) as the import
path for everything except source and homepage URLs.  For modules not in the
root of a VCS repository, set #:unpack-path to the repository root by default.

* guix/import/go.scm (go-module->guix-package): Use 'module-path'
instead of 'root-module-path' for #:import-path.  Emit #:unpack-path
when #:import-path is not equal to 'root-module-path'.
---
 guix/import/go.scm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/guix/import/go.scm b/guix/import/go.scm
index c6ecdbaffd..fe7387dec2 100644
--- a/guix/import/go.scm
+++ b/guix/import/go.scm
@@ -619,7 +619,7 @@ hint: use one of the following available versions ~a\n"
          (meta-data (fetch-module-meta-data root-module-path))
          (vcs-type (module-meta-vcs meta-data))
          (vcs-repo-url (module-meta-data-repo-url meta-data goproxy))
-         (synopsis (go-package-synopsis root-module-path))
+         (synopsis (go-package-synopsis module-path))
          (description (go-package-description module-path))
          (licenses (go-package-licenses module-path)))
     (values
@@ -630,7 +630,10 @@ hint: use one of the following available versions ~a\n"
          ,(vcs->origin vcs-type vcs-repo-url version*))
         (build-system go-build-system)
         (arguments
-         '(#:import-path ,root-module-path))
+         '(#:import-path ,module-path
+           ,@(if (string=? module-path root-module-path)
+                 '()
+                 `(#:unpack-path ,root-module-path))))
         ,@(maybe-propagated-inputs
            (map (match-lambda
                   ((name version)

base-commit: 72297993a174586ee0a23b95b6b9ee2f3db34cf1
--
2.33.0


  reply	other threads:[~2021-09-17 21:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-15  0:32 bug#50595: Faliure in guix import go Stephen Paul Weber
2021-09-15  2:27 ` bug#50595: Failure " Stephen Paul Weber
2021-09-17 21:39   ` Sarah Morgensen [this message]
2021-09-18 21:12     ` bug#50595: Faliure " Ludovic Courtès
2021-09-18 21:37       ` Sarah Morgensen
2021-09-17  3:07 ` Sarah Morgensen

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=86sfy2hoep.fsf@mgsn.dev \
    --to=iskarian@mgsn.dev \
    --cc=50595@debbugs.gnu.org \
    --cc=singpolyma@singpolyma.net \
    /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).