Hello, Thanks for your report!
Stephen Paul Weber <singpol...@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.
>From ca17299a3011171d6889202003d1e888b22303ec Mon Sep 17 00:00:00 2001 Message-Id: <ca17299a3011171d6889202003d1e888b22303ec.1631842353.git.iskar...@mgsn.dev> From: Sarah Morgensen <iskar...@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