all messages for Guix-related lists mirrored at yhetil.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: Faliure in guix import go
Date: Thu, 16 Sep 2021 20:07:52 -0700	[thread overview]
Message-ID: <861r5nj3w7.fsf@mgsn.dev> (raw)
In-Reply-To: <20210915003242.GA22238@singpolyma-beefy.lan> (Stephen Paul Weber's message of "Tue, 14 Sep 2021 19:32:42 -0500 (2 days, 59 minutes, 30 seconds ago)")

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

Hello,

Thanks for your report!

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

> $ guix import go -r bdd.fi/x/runitor
>
> guix import: warning: Failed to import package "bdd.fi/x/runitor".
> reason: ("struct-vtable" "Wrong type argument in position 1 (expecting struct): ~S" (#f) (#f)).

It seems this is occurring because "https://bdd.fi/x/runitor?go-get=1"
does not have the

  <meta "go-import" ...>

tag in the <head> element, as the Go spec requires (it's a direct child
of the <html> element).  However, it seems fairly harmless to relax this
requirement in our importer, so the following patch should fix this.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: import: go: Match go-import meta tags anywhere. --]
[-- Type: text/x-patch, Size: 1359 bytes --]

From ca17299a3011171d6889202003d1e888b22303ec Mon Sep 17 00:00:00 2001
Message-Id: <ca17299a3011171d6889202003d1e888b22303ec.1631842353.git.iskarian@mgsn.dev>
From: Sarah Morgensen <iskarian@mgsn.dev>
Date: Thu, 16 Sep 2021 18:27:09 -0700
Subject: [PATCH] import: go: Match "go-import" meta tags anywhere.

Some personal sites forget to put <meta name="go-import" ...> in a
<head> element, so look anywhere for them.

* guix/import/go.scm (fetch-module-meta-data): Match "go-import" meta
tags anywhere in the page.
---
 guix/import/go.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/guix/import/go.scm b/guix/import/go.scm
index dad007d511..43abe004b3 100644
--- a/guix/import/go.scm
+++ b/guix/import/go.scm
@@ -480,7 +480,7 @@ build a package."
                          (strip-.git-suffix/maybe repo-url)))))
   ;; <meta name="go-import" content="import-prefix vcs repo-root">
   (let* ((meta-data (http-fetch* (format #f "https://~a?go-get=1" module-path)))
-         (select (sxpath `(// head (meta (@ (equal? (name "go-import"))))
+         (select (sxpath `(// (meta (@ (equal? (name "go-import"))))
                               // content))))
     (match (select (html->sxml meta-data #:strict? #t))
       (() #f)                           ;nothing selected

base-commit: 72297993a174586ee0a23b95b6b9ee2f3db34cf1
--
2.33.0


      parent reply	other threads:[~2021-09-17  3:09 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
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 [this message]

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=861r5nj3w7.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 external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.