Faliure in guix import go

OpenSubmitted by Stephen Paul Weber.
Details
2 participants
  • Sarah Morgensen
  • Stephen Paul Weber
Owner
unassigned
Severity
normal
S
S
Stephen Paul Weber wrote 4 days ago
(address . bug-guix@gnu.org)
20210915003242.GA22238@singpolyma-beefy.lan
$ 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)).
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEWeaCw+rzmiEMpzU00RwpEc5RnN4FAmFBPyUACgkQ0RwpEc5RnN69rxAAjyULgWYkXQXhZMxpdijPh6OzSXmHpKbLYAAjW3TqxaN/ZuHJrQIb8w8CFN5oF18tx/deF2Vm9zT3VSeV+poNDREMLOU9fn5ruQ2PJlmLmw62sP06aByDtAz41LAX+BpHUddosbm4YSQiu7pQttXjImoybx8C16+u4cZdMmVqKNm9Qv09eyGris8BclP3XW2/34myBLRjLQUhK+qFtN4Zb6v3z8YaKTlFoTIb8YkANwnHy/DjdjfJNA+vxcLLTcgAVvYk5uJb9nWqKlNPh3KKvL2Bj7wB4aoTAB1dSA0P5mvTjmh6C6AKzvMidjlDJUtIxK1BN63rPddi4OvTmtfGkDP62jmteUSM5CZvzoPCz5vkiOWDtB+S9thxEMRFbL81LUxqU8aSBismeOy9Ja01NI2OoHndEQUzq7DClxEHEY35CuEPDKN10b9sevg2wEn0cK4HS0BmryjwinIJxSmHJbqNACdRc9GSysVTumKvWiZyGobDhnqZTy7hoSyzH0Ek8RnWiv14Z5xoTYEN90sb6q4chzBA/U6w4yeBRc37XodMqhHJP2WRk/OsOs5X2+InthrlCiU7dj08yAnhQ3uClIe+37AbUVrVBW+6HSriLsrP5JNzavqDMLZu/cu/ubcKaEISyjWleRRhMapqyX9nFtu1uiDgLLVIaQJ4kF7hJro==OueR-----END PGP SIGNATURE-----

S
S
Stephen Paul Weber wrote 4 days ago
Re: Failure in guix import go
(address . 50595@debbugs.gnu.org)
20210915022754.GC22238@singpolyma-beefy.lan
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/'
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEWeaCw+rzmiEMpzU00RwpEc5RnN4FAmFBWiUACgkQ0RwpEc5RnN6UnQ/9HZuFZYLgQrLT7htlABH66lLFG3gGWlMQJk82oSledcfzsEkCYVmhatCwRY7dknRPpcP2tW+CztgH1vFu144dgIjsNkJjLMsK9jEzbKPHpuXaS74qiu09SkOIVbafXWYQckHKLXomhXYs79II1iBbhEzc62NduUVioUY2fbsojEph/o46GXBvb+a5evNobc0Gkjb3InmOORvrSbuZnOAOHS2kd6qEJ4Vz6ZrKl4gaOzBFFDP3U9g3XiSpDuF3oUWeTS9d5sGmvrXp0OTSUUdIDujwZOQT9kB2/r32dwDTyX6Y2sBJpGPYqXQ5xVBEVS/s1buRS8nBS/GhkN7fOntiE/sN0OlldhoafwG9JsOLvx8u2vMSsqKgbphWIQ+tjdYLBoUS7qqUpJR5JAjknEKZXK+NiwIJCBvnlAyXd9i5enzcrTeEzwqQ/TE8/9AXg4aRwf8p9/riXhruLbHsyqn5Gbubenf3joC863D9TK+sUJN+Nh4afkkAAiK54YKi7TjLyXNtJ3HWBg+RZWmZ79X2lRHNJsC1lcYZivsJELKrKAE0s+yDN/bRGVjiHkwjEgkp8FPVQvjvCFlTUMa39oentjEoxB8KlKWpbfcGA3c8oCCxcjPf7WEFvL0paj4iFdoXmbuvlPN52nTOsar8J6v7lpz2DpmCs4AZOxQ6TvmqSn0==oiBs-----END PGP SIGNATURE-----

S
S
Sarah Morgensen wrote 41 hours ago
Re: bug#50595: Faliure in guix import go
(name . Stephen Paul Weber)(address . singpolyma@singpolyma.net)(address . 50595@debbugs.gnu.org)
861r5nj3w7.fsf@mgsn.dev
Hello,
Thanks for your report!
Stephen Paul Weber <singpolyma@singpolyma.net> writes:
Toggle quote (5 lines)> $ 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 childof the <html> element). However, it seems fairly harmless to relax thisrequirement in our importer, so the following patch should fix this.
From ca17299a3011171d6889202003d1e888b22303ec Mon Sep 17 00:00:00 2001Message-Id: <ca17299a3011171d6889202003d1e888b22303ec.1631842353.git.iskarian@mgsn.dev>From: Sarah Morgensen <iskarian@mgsn.dev>Date: Thu, 16 Sep 2021 18:27:09 -0700Subject: [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" metatags anywhere in the page.--- guix/import/go.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Toggle diff (15 lines)diff --git a/guix/import/go.scm b/guix/import/go.scmindex 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
S
S
Sarah Morgensen wrote 23 hours ago
Re: bug#50595: Failure in guix import go
(name . Stephen Paul Weber)(address . singpolyma@singpolyma.net)(address . 50595@debbugs.gnu.org)
86sfy2hoep.fsf@mgsn.dev
Hello,
Stephen Paul Weber <singpolyma@singpolyma.net> writes:
Toggle quote (11 lines)> 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 therepository root instead of the module path in a couple places. Theattached patch fixes this.
Hope that helps,--Sarah
From b9ef64a641c20d331cf1886d71b85b81be910b30 Mon Sep 17 00:00:00 2001Message-Id: <b9ef64a641c20d331cf1886d71b85b81be910b30.1631914185.git.iskarian@mgsn.dev>From: Sarah Morgensen <iskarian@mgsn.dev>Date: Thu, 16 Sep 2021 18:24:40 -0700Subject: [PATCH] import: go: Improve handling of modules in VCS subdirectories.
Use the supplied module path (instead of the repository root) as the importpath for everything except source and homepage URLs. For modules not in theroot 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-pathwhen #:import-path is not equal to 'root-module-path'.--- guix/import/go.scm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
Toggle diff (27 lines)diff --git a/guix/import/go.scm b/guix/import/go.scmindex 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
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send email to 50595@debbugs.gnu.org