diff mbox series

[bug#44178]

Message ID bc9fc787f49a9722396ed97554e2a7c634f830a0.camel@free.fr
State Accepted
Headers show
Series [bug#44178] | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

dftxbs3e Dec. 10, 2020, 2:42 a.m. UTC
On Wed, 2020-12-09 at 15:22 +0100, dftxbs3e wrote:
> Thanks a lot for this!
> 
> I'm getting some error trying to use it (patching on top of
> 8e2aad26ae9b7365db83d4f6c74e9e79c57766a6), maybe that's fixed in your
> local changes?
> 
> $ ./pre-inst-env guix import go -r github.com/syncthing/syncthing
> WARNING: (guix import go): `url-fetch' imported from both (guix
> import
> utils) and (guix build download)
> Backtrace:
> In ice-9/boot-9.scm:
>   1736:10  7 (with-exception-handler _ _ #:unwind? _ # _)
> In unknown file:
>            6 (apply-smob/0 #<thunk 7ff10807d9a0>)
> In ice-9/boot-9.scm:
>     718:2  5 (call-with-prompt _ _ #<procedure default-prompt-
> handle…>)
> In ice-9/eval.scm:
>     619:8  4 (_ #(#(#<directory (guile-user) 7ff107cadf00>)))
> In guix/ui.scm:
>   2127:12  3 (run-guix-command _ . _)
> In guix/scripts/import.scm:
>    120:11  2 (guix-import . _)
> In ice-9/eval.scm:
>     159:9  1 (_ #(#(#(#(#(#(#(#(#(#<directo…>) …) …) …) …) …) …) …)
> …))
> In guix/import/utils.scm:
>     429:0  0 (recursive-import _ #:repo->guix-package _ #:guix-name _
> …)
> 
> guix/import/utils.scm:429:0: In procedure recursive-import:
> Invalid keyword: #f

I could fix it using the attached patch!

However, I noticed it doesnt pin versions in GNU Guix to what they are
in go.mod file, is that expected? It always takes the latest. It might
work but I am thinking it might cause breakage at some point?

Thank you!

Comments

dftxbs3e Dec. 10, 2020, 3:14 a.m. UTC | #1
It now fails with:

$ ./pre-inst-env guix import go -r github.com/hashicorp/consul/api
WARNING: (guix import go): `url-fetch' imported from both (guix import
utils) and (guix build download)

Starting download of /tmp/guix-file.i8tqa2
From 
https://proxy.golang.org/github.com/hashicorp/consul/api/@v/v1.8.0.mod.
..
 v1.8.0.mod  424B                     334KiB/s 00:00
[##################] 100.0%
Backtrace:
In ice-9/boot-9.scm:
  1736:10 17 (with-exception-handler _ _ #:unwind? _ # _)
In unknown file:
          16 (apply-smob/0 #<thunk 7fc5871054a0>)
In ice-9/boot-9.scm:
    718:2 15 (call-with-prompt _ _ #<procedure default-prompt-handle…>)
In ice-9/eval.scm:
    619:8 14 (_ #(#(#<directory (guile-user) 7fc586d40f00>)))
In guix/ui.scm:
  2127:12 13 (run-guix-command _ . _)
In guix/scripts/import.scm:
   120:11 12 (guix-import . _)
In ice-9/eval.scm:
    159:9 11 (_ _)
In guix/import/utils.scm:
   458:31 10 (recursive-import _ #:repo->guix-package _ #:guix-name _
…)
   449:33  9 (lookup-node "github.com/hashicorp/consul/api" #f)
In guix/utils.scm:
    697:8  8 (call-with-temporary-output-file _)
In ice-9/eval.scm:
   293:34  7 (_ #(#(#(#(#<directory (guix import go) 7fc…> …) …) …) …))
    159:9  6 (_ #(#(#(#(#<directory (guix import go) 7fc…> …) …) …) …))
In ice-9/ports.scm:
   445:17  5 (call-with-input-file _ _ #:binary _ #:encoding _ # _)
    470:4  4 (_ _)
In ice-9/eval.scm:
    619:8  3 (_ #(#(#(#<directory (guix import go) 7fc584cbef00>)) …))
    619:8  2 (_ #(#(#<directory (guix import go) 7fc584cbef00> # …) …))
   293:34  1 (_ #(#(#(#(#(#<directory (guix import go…> …) …) …) …) …))
In unknown file:
           0 (list-ref ("replace" "github.com/hashicorp/consul/s…" …)
…)

ERROR: In procedure list-ref:
In procedure list-ref: Argument 2 out of range: 4


It's probably because the go.mod file contains a self-referencing
replace line (seems unsupported by the code):

module github.com/hashicorp/consul/api

go 1.12

replace github.com/hashicorp/consul/sdk => ../sdk

require (
	github.com/hashicorp/consul/sdk v0.7.0
	github.com/hashicorp/go-cleanhttp v0.5.1
	github.com/hashicorp/go-hclog v0.12.0
	github.com/hashicorp/go-rootcerts v1.0.2
	github.com/hashicorp/go-uuid v1.0.1
	github.com/hashicorp/serf v0.9.5
	github.com/mitchellh/mapstructure v1.1.2
	github.com/stretchr/testify v1.4.0
)
diff mbox series

Patch

diff --git a/guix/import/go.scm b/guix/import/go.scm
index 61009f3565..c7a1b1a5d4 100644
--- a/guix/import/go.scm
+++ b/guix/import/go.scm
@@ -23,7 +23,7 @@ 
   #:use-module (ice-9 regex)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-9)
-  #:use-module (guix json)
+  #:use-module (json)
   #:use-module ((guix download) #:prefix download:)
   #:use-module (guix import utils)
   #:use-module (guix import json)
@@ -268,9 +268,9 @@  control system is being used."
 
 (define* (go-module-recursive-import package-name
                                      #:key (goproxy-url "https://proxy.golang.org"))
-  (recursive-import package-name #f
+  (recursive-import package-name
                     #:repo->guix-package
-                    (lambda (name _)
+                    (lambda* (name #:key repo version)
                       (go-module->guix-package name
                                                #:goproxy-url goproxy-url))
                     #:guix-name to-guix-package-name))