GNU bug report logs -
#50595
Faliure in guix import go
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Hello,
Thanks for your report!
Stephen Paul Weber <singpolyma <at> 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.
[0001-import-go-Match-go-import-meta-tags-anywhere.patch (text/x-patch, inline)]
From ca17299a3011171d6889202003d1e888b22303ec Mon Sep 17 00:00:00 2001
Message-Id: <ca17299a3011171d6889202003d1e888b22303ec.1631842353.git.iskarian <at> mgsn.dev>
From: Sarah Morgensen <iskarian <at> 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
This bug report was last modified 3 years and 324 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.