unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#52362: guix import go error
@ 2021-12-07 22:08 Stephen Paul Weber
  2022-01-12  3:58 ` Stephen Paul Weber
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Stephen Paul Weber @ 2021-12-07 22:08 UTC (permalink / raw)
  To: 52362

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

$ guix import go github.com/Azure/go-autorest/autorest

guix import: warning: Failed to import package "github.com/Azure/go-autorest/autorest".
reason: (#<<git-error> code: -3 message: "reference 'refs/tags/v0.11.22' not found" class: 4>).
guix import: error: failed to download meta-data for module 'github.com/Azure/go-autorest/autorest'.

Similarly:

$ guix import go github.com/Azure/go-autorest/autorest/adal

guix import: warning: Failed to import package "github.com/Azure/go-autorest/autorest/adal".
reason: (#<<git-error> code: -3 message: "reference 'refs/tags/v0.9.17' not found" class: 4>).
guix import: error: failed to download meta-data for module 'github.com/Azure/go-autorest/autorest/adal'.

And, from a different package but seems also similar:

$ guix import go cloud.google.com/go/storage

guix import: warning: Failed to import package "cloud.google.com/go/storage".
reason: (#<<git-error> code: -3 message: "reference 'refs/tags/v1.18.2' not found" class: 4>).
guix import: error: failed to download meta-data for module 'cloud.google.com/go/storage'.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#52362: guix import go error
  2021-12-07 22:08 bug#52362: guix import go error Stephen Paul Weber
@ 2022-01-12  3:58 ` Stephen Paul Weber
  2022-01-12  4:28   ` Stephen Paul Weber
  2022-01-15  1:43 ` bug#52362: [PATCH] guix: import: go: Use correct tag for go module in subdirectory Stephen Paul Weber
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Stephen Paul Weber @ 2022-01-12  3:58 UTC (permalink / raw)
  To: 52362

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

Ran into another like this today:

     guix import go github.com/aws/aws-sdk-go-v2/service/s3

Gives:

Backtrace:
           14 (primitive-load "/gnu/store/6rjb4c80l53n98cl6h0s3q1zmkg…")
In guix/ui.scm:
    2209:7 13 (run-guix . _)
   2172:10 12 (run-guix-command _ . _)
In guix/scripts/import.scm:
    124:11 11 (guix-import . _)
In ice-9/boot-9.scm:
   1752:10 10 (with-exception-handler _ _ #:unwind? _ # _)
In guix/scripts/import/go.scm:
    116:29  9 (_)
In ice-9/exceptions.scm:
    406:15  8 (go-module->guix-package* . _)
In ice-9/boot-9.scm:
   1752:10  7 (with-exception-handler _ _ #:unwind? _ # _)
In guix/import/go.scm:
    519:18  6 (go-module->guix-package "github.com/aws/aws-sdk-go-v2…" …)
In guix/git.scm:
     277:4  5 (update-cached-checkout _ #:ref _ #:recursive? _ # _ # _ …)
    266:18  4 (resolve _)
In git/reference.scm:
      60:8  3 (_ _ _)
In git/bindings.scm:
      77:2  2 (raise-git-error _)
In ice-9/boot-9.scm:
   1685:16  1 (raise-exception _ #:continuable? _)
   1683:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1683:16: In procedure raise-exception:
Git error: reference 'refs/tags/v1.23.0' not found

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#52362: guix import go error
  2022-01-12  3:58 ` Stephen Paul Weber
@ 2022-01-12  4:28   ` Stephen Paul Weber
  0 siblings, 0 replies; 13+ messages in thread
From: Stephen Paul Weber @ 2022-01-12  4:28 UTC (permalink / raw)
  To: 52362

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

Alright, I think I have found the issue.  https://go.dev/ref/mod says:

> If a module is defined in a subdirectory within the repository, that is,
> the module subdirectory portion of the module path is not empty, then each
> tag name must be prefixed with the module subdirectory, followed by a slash.
> For example, the module golang.org/x/tools/gopls is defined in the gopls
> subdirectory of the repository with root path golang.org/x/tools. The version
> v0.4.0 of that module must have the tag named gopls/v0.4.0 in that repository.

Right now the importer code assumes that either we have a pseudo version (and
thus can extract a raw commit hash) or else that the tag will be exactly
(string-append "v" version) but this does not take into account the rule about
subdirectory packages.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#52362: [PATCH] guix: import: go: Use correct tag for go module in subdirectory.
  2021-12-07 22:08 bug#52362: guix import go error Stephen Paul Weber
  2022-01-12  3:58 ` Stephen Paul Weber
@ 2022-01-15  1:43 ` Stephen Paul Weber
  2022-01-15  1:56   ` Stephen Paul Weber
  2022-01-16  2:56 ` bug#52362: [PATCH v2] " Stephen Paul Weber
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Stephen Paul Weber @ 2022-01-15  1:43 UTC (permalink / raw)
  To: 52362; +Cc: Stephen Paul Weber

https://go.dev/ref/mod says a module in a subdirectory has a tag prefixed with
the subdirectory.

* guix/import/go.scm (version+subdirectory->tag-name): New variable.
(vcs->origin): New argument module-path-subdirectory.
---
 guix/import/go.scm | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/guix/import/go.scm b/guix/import/go.scm
index d00c13475a..6fae1994b8 100644
--- a/guix/import/go.scm
+++ b/guix/import/go.scm
@@ -521,28 +521,30 @@ tag."
                                           `(tag-or-commit . ,reference)))))
     (file-hash* checkout #:algorithm algorithm #:recursive? #true)))
 
-(define (vcs->origin vcs-type vcs-repo-url version)
+(define (version+subdirectory->tag-name version subdirectory)
+  (if (string=? subdirectory "")
+      version
+      (string-append (substring subdirectory 1) "/" version)))
+
+(define (vcs->origin vcs-type vcs-repo-url module-path-subdirectory version)
   "Generate the `origin' block of a package depending on what type of source
 control system is being used."
   (case vcs-type
     ((git)
-     (let ((plain-version? (string=? version (go-version->git-ref version)))
-           (v-prefixed?    (string-prefix? "v" version)))
+     (let ((git-commit (if (string=? version (go-version->git-ref version))
+                           (version+subdirectory->tag-name
+                              version module-path-subdirectory)
+                           (go-version->git-ref version))))
        `(origin
           (method git-fetch)
           (uri (git-reference
                 (url ,vcs-repo-url)
-                ;; This is done because the version field of the package,
-                ;; which the generated quoted expression refers to, has been
-                ;; stripped of any 'v' prefixed.
-                (commit ,(if (and plain-version? v-prefixed?)
-                             '(string-append "v" version)
-                             '(go-version->git-ref version)))))
+                (commit ,git-commit)))
           (file-name (git-file-name name version))
           (sha256
            (base32
             ,(bytevector->nix-base32-string
-              (git-checkout-hash vcs-repo-url (go-version->git-ref version)
+              (git-checkout-hash vcs-repo-url git-commit
                                  (hash-algorithm sha256))))))))
     ((hg)
      `(origin
@@ -621,6 +623,8 @@ When VERSION is unspecified, the latest version available is used."
           (match:prefix (string-match "([\\./]v[0-9]+)?$" module-path)))
          (guix-name (go-module->guix-package-name module-path))
          (root-module-path (module-path->repository-root module-path))
+         (module-path-subdirectory
+           (substring module-path (string-length root-module-path)))
          ;; The VCS type and URL are not included in goproxy information. For
          ;; this we need to fetch it from the official module page.
          (meta-data (fetch-module-meta-data root-module-path))
@@ -634,7 +638,7 @@ When VERSION is unspecified, the latest version available is used."
         (name ,guix-name)
         (version ,(strip-v-prefix version*))
         (source
-         ,(vcs->origin vcs-type vcs-repo-url version*))
+         ,(vcs->origin vcs-type vcs-repo-url module-path-subdirectory version*))
         (build-system go-build-system)
         (arguments
          '(#:import-path ,module-path
-- 
2.30.2




^ permalink raw reply related	[flat|nested] 13+ messages in thread

* bug#52362: [PATCH] guix: import: go: Use correct tag for go module in subdirectory.
  2022-01-15  1:43 ` bug#52362: [PATCH] guix: import: go: Use correct tag for go module in subdirectory Stephen Paul Weber
@ 2022-01-15  1:56   ` Stephen Paul Weber
  0 siblings, 0 replies; 13+ messages in thread
From: Stephen Paul Weber @ 2022-01-15  1:56 UTC (permalink / raw)
  To: 52362

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

Somebody claiming to be Stephen Paul Weber wrote:
>https://go.dev/ref/mod says a module in a subdirectory has a tag prefixed with
>the subdirectory.

Dang.  This patch as written causes import of guix import go
github.com/jackc/pgx/v4 to fail. The /v4 suffix in this case appears to refer to
a branch and not a subdirectory, but the syntax is identical?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#52362: [PATCH v2] guix: import: go: Use correct tag for go module in subdirectory.
  2021-12-07 22:08 bug#52362: guix import go error Stephen Paul Weber
  2022-01-12  3:58 ` Stephen Paul Weber
  2022-01-15  1:43 ` bug#52362: [PATCH] guix: import: go: Use correct tag for go module in subdirectory Stephen Paul Weber
@ 2022-01-16  2:56 ` Stephen Paul Weber
  2022-01-16  3:32 ` bug#52362: [PATCH v3] " Stephen Paul Weber
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: Stephen Paul Weber @ 2022-01-16  2:56 UTC (permalink / raw)
  To: 52362; +Cc: Stephen Paul Weber

https://go.dev/ref/mod says a module in a subdirectory has a tag prefixed with
the subdirectory.

* guix/import/go.scm (version+subdirectory->tag-prefix): New variable.
(vcs->origin): New argument module-path-subdirectory.
---
 guix/import/go.scm | 35 ++++++++++++++++++++++++-----------
 1 file changed, 24 insertions(+), 11 deletions(-)

diff --git a/guix/import/go.scm b/guix/import/go.scm
index d00c13475a..b6f8686c0d 100644
--- a/guix/import/go.scm
+++ b/guix/import/go.scm
@@ -521,28 +521,37 @@ tag."
                                           `(tag-or-commit . ,reference)))))
     (file-hash* checkout #:algorithm algorithm #:recursive? #true)))
 
-(define (vcs->origin vcs-type vcs-repo-url version)
+(define (version+subdirectory->tag-prefix subdirectory)
+  (if (string=? subdirectory "")
+      ""
+      (string-append (substring subdirectory 1) "/")))
+
+(define (vcs->origin vcs-type vcs-repo-url module-path-subdirectory version)
   "Generate the `origin' block of a package depending on what type of source
 control system is being used."
   (case vcs-type
     ((git)
-     (let ((plain-version? (string=? version (go-version->git-ref version)))
-           (v-prefixed?    (string-prefix? "v" version)))
+     (let* ((plain-version? (string=? version (go-version->git-ref version)))
+            (v-prefixed?    (string-prefix? "v" version))
+            (tag-prefix     (version+subdirectory->tag-prefix
+                             module-path-subdirectory))
+            (git-commit     (if plain-version?
+                                (string-append tag-prefix version)
+                                (go-version->git-ref version))))
        `(origin
           (method git-fetch)
           (uri (git-reference
                 (url ,vcs-repo-url)
-                ;; This is done because the version field of the package,
-                ;; which the generated quoted expression refers to, has been
-                ;; stripped of any 'v' prefixed.
                 (commit ,(if (and plain-version? v-prefixed?)
-                             '(string-append "v" version)
+                             (if (string=? module-path-subdirectory "")
+                                 '(string-append "v" version)
+                                 `(string-append ,tag-prefix "v" version))
                              '(go-version->git-ref version)))))
           (file-name (git-file-name name version))
           (sha256
            (base32
             ,(bytevector->nix-base32-string
-              (git-checkout-hash vcs-repo-url (go-version->git-ref version)
+              (git-checkout-hash vcs-repo-url git-commit
                                  (hash-algorithm sha256))))))))
     ((hg)
      `(origin
@@ -618,9 +627,13 @@ When VERSION is unspecified, the latest version available is used."
                            dependencies+versions
                            (map car dependencies+versions)))
          (module-path-sans-suffix
-          (match:prefix (string-match "([\\./]v[0-9]+)?$" module-path)))
+           (if (string-prefix? "gopkg.in" module-path)
+               module-path
+               (match:prefix (string-match "([\\./]v[0-9]+)?$" module-path))))
          (guix-name (go-module->guix-package-name module-path))
-         (root-module-path (module-path->repository-root module-path))
+         (root-module-path (module-path->repository-root module-path-sans-suffix))
+         (module-path-subdirectory
+           (substring module-path-sans-suffix (string-length root-module-path)))
          ;; The VCS type and URL are not included in goproxy information. For
          ;; this we need to fetch it from the official module page.
          (meta-data (fetch-module-meta-data root-module-path))
@@ -634,7 +647,7 @@ When VERSION is unspecified, the latest version available is used."
         (name ,guix-name)
         (version ,(strip-v-prefix version*))
         (source
-         ,(vcs->origin vcs-type vcs-repo-url version*))
+         ,(vcs->origin vcs-type vcs-repo-url module-path-subdirectory version*))
         (build-system go-build-system)
         (arguments
          '(#:import-path ,module-path
-- 
2.30.2




^ permalink raw reply related	[flat|nested] 13+ messages in thread

* bug#52362: [PATCH v3] guix: import: go: Use correct tag for go module in subdirectory.
  2021-12-07 22:08 bug#52362: guix import go error Stephen Paul Weber
                   ` (2 preceding siblings ...)
  2022-01-16  2:56 ` bug#52362: [PATCH v2] " Stephen Paul Weber
@ 2022-01-16  3:32 ` Stephen Paul Weber
  2023-05-25 16:13   ` bug#52362: guix import go error Simon Tournier
  2022-02-28 23:55 ` bug#52362: [PATCH v3] guix: import: go: Use correct tag for go module in subdirectory Nicolas Goaziou
  2022-04-13 14:26 ` bug#52362: another patchset Attila Lendvai
  5 siblings, 1 reply; 13+ messages in thread
From: Stephen Paul Weber @ 2022-01-16  3:32 UTC (permalink / raw)
  To: 52362; +Cc: Stephen Paul Weber

https://go.dev/ref/mod says a module in a subdirectory has a tag prefixed with
the subdirectory.

* guix/import/go.scm (version+subdirectory->tag-prefix): New variable.
(vcs->origin): New argument module-path-subdirectory.
---
 guix/import/go.scm | 36 +++++++++++++++++++++++++-----------
 1 file changed, 25 insertions(+), 11 deletions(-)

diff --git a/guix/import/go.scm b/guix/import/go.scm
index d00c13475a..f2ea9dbbae 100644
--- a/guix/import/go.scm
+++ b/guix/import/go.scm
@@ -521,28 +521,37 @@ tag."
                                           `(tag-or-commit . ,reference)))))
     (file-hash* checkout #:algorithm algorithm #:recursive? #true)))
 
-(define (vcs->origin vcs-type vcs-repo-url version)
+(define (version+subdirectory->tag-prefix subdirectory)
+  (if (string=? subdirectory "")
+      ""
+      (string-append (substring subdirectory 1) "/")))
+
+(define (vcs->origin vcs-type vcs-repo-url module-path-subdirectory version)
   "Generate the `origin' block of a package depending on what type of source
 control system is being used."
   (case vcs-type
     ((git)
-     (let ((plain-version? (string=? version (go-version->git-ref version)))
-           (v-prefixed?    (string-prefix? "v" version)))
+     (let* ((plain-version? (string=? version (go-version->git-ref version)))
+            (v-prefixed?    (string-prefix? "v" version))
+            (tag-prefix     (version+subdirectory->tag-prefix
+                             module-path-subdirectory))
+            (git-commit     (if plain-version?
+                                (string-append tag-prefix version)
+                                (go-version->git-ref version))))
        `(origin
           (method git-fetch)
           (uri (git-reference
                 (url ,vcs-repo-url)
-                ;; This is done because the version field of the package,
-                ;; which the generated quoted expression refers to, has been
-                ;; stripped of any 'v' prefixed.
                 (commit ,(if (and plain-version? v-prefixed?)
-                             '(string-append "v" version)
+                             (if (string=? module-path-subdirectory "")
+                                 '(string-append "v" version)
+                                 `(string-append ,tag-prefix "v" version))
                              '(go-version->git-ref version)))))
           (file-name (git-file-name name version))
           (sha256
            (base32
             ,(bytevector->nix-base32-string
-              (git-checkout-hash vcs-repo-url (go-version->git-ref version)
+              (git-checkout-hash vcs-repo-url git-commit
                                  (hash-algorithm sha256))))))))
     ((hg)
      `(origin
@@ -618,12 +627,17 @@ When VERSION is unspecified, the latest version available is used."
                            dependencies+versions
                            (map car dependencies+versions)))
          (module-path-sans-suffix
-          (match:prefix (string-match "([\\./]v[0-9]+)?$" module-path)))
+           (if (string-prefix? "gopkg.in" module-path)
+               module-path
+               (match:prefix (string-match "([\\./]v[0-9]+)?$" module-path))))
          (guix-name (go-module->guix-package-name module-path))
-         (root-module-path (module-path->repository-root module-path))
+         (root-module-path (module-path->repository-root module-path-sans-suffix))
          ;; The VCS type and URL are not included in goproxy information. For
          ;; this we need to fetch it from the official module page.
          (meta-data (fetch-module-meta-data root-module-path))
+         (module-path-subdirectory
+           (substring module-path-sans-suffix
+             (string-length (module-meta-import-prefix meta-data))))
          (vcs-type (module-meta-vcs meta-data))
          (vcs-repo-url (module-meta-data-repo-url meta-data goproxy))
          (synopsis (go-package-synopsis module-path))
@@ -634,7 +648,7 @@ When VERSION is unspecified, the latest version available is used."
         (name ,guix-name)
         (version ,(strip-v-prefix version*))
         (source
-         ,(vcs->origin vcs-type vcs-repo-url version*))
+         ,(vcs->origin vcs-type vcs-repo-url module-path-subdirectory version*))
         (build-system go-build-system)
         (arguments
          '(#:import-path ,module-path
-- 
2.30.2




^ permalink raw reply related	[flat|nested] 13+ messages in thread

* bug#52362: [PATCH v3] guix: import: go: Use correct tag for go module in subdirectory.
  2021-12-07 22:08 bug#52362: guix import go error Stephen Paul Weber
                   ` (3 preceding siblings ...)
  2022-01-16  3:32 ` bug#52362: [PATCH v3] " Stephen Paul Weber
@ 2022-02-28 23:55 ` Nicolas Goaziou
  2023-05-25 14:21   ` bug#52362: guix import go error Simon Tournier
  2022-04-13 14:26 ` bug#52362: another patchset Attila Lendvai
  5 siblings, 1 reply; 13+ messages in thread
From: Nicolas Goaziou @ 2022-02-28 23:55 UTC (permalink / raw)
  To: 52362

Hello,

I tested v3 of this change, which looks great.

Unfortunately, when running

  ./pre-inst-env guix import go --recursive rclone

I get the following backtrace:

--8<---------------cut here---------------start------------->8---
following redirection to `https://github.com/qingstor/qingstor-sdk-go?go-get=1'...
Backtrace:
In ice-9/boot-9.scm:
  1752:10 19 (with-exception-handler _ _ #:unwind? _ # _)
In guix/scripts/import/go.scm:
   114:22 18 (_)
In guix/import/utils.scm:
   509:23 17 (recursive-import _ #:repo->guix-package _ #:guix-name _ …)
In srfi/srfi-1.scm:
   586:29 16 (map1 _)
   586:29 15 (map1 _)
   586:29 14 (map1 _)
   586:29 13 (map1 _)
   586:29 12 (map1 _)
   586:29 11 (map1 _)
   586:17 10 (map1 (("github.com/yunify/qingstor-sdk-go/v3" #f) (…) …))
In guix/import/utils.scm:
   497:33  9 (lookup-node "github.com/yunify/qingstor-sdk-go/v3" #f)
In guix/memoization.scm:
     98:0  8 (mproc "github.com/yunify/qingstor-sdk-go/v3" #:version …)
In unknown file:
           7 (_ #<procedure 7f09be40e0c0 at guix/memoization.scm:17…> …)
           6 (_ #<procedure 7f09be40e080 at ice-9/eval.scm:330:13 ()> …)
In ice-9/boot-9.scm:
    724:2  5 (call-with-prompt _ _ #<procedure 7f09be413e20 at ice-9…>)
  1752:10  4 (with-exception-handler _ _ #:unwind? _ # _)
In ice-9/eval.scm:
   293:34  3 (_ #(#(#(#(#(#(#(#(#(#(#(#) …) …) …) …) …) …) …) …) …) …))
In unknown file:
           2 (substring "github.com/yunify/qingstor-sdk-go" 35 #<und…>)
In ice-9/boot-9.scm:
  1685:16  1 (raise-exception _ #:continuable? _)
  1683:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1683:16: In procedure raise-exception:
Value out of range 0 to< 33: 35
--8<---------------cut here---------------end--------------->8---

Do you know why it is failing like this?

Regards,
-- 
Nicolas Goaziou




^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#52362: another patchset
  2021-12-07 22:08 bug#52362: guix import go error Stephen Paul Weber
                   ` (4 preceding siblings ...)
  2022-02-28 23:55 ` bug#52362: [PATCH v3] guix: import: go: Use correct tag for go module in subdirectory Nicolas Goaziou
@ 2022-04-13 14:26 ` Attila Lendvai
  5 siblings, 0 replies; 13+ messages in thread
From: Attila Lendvai @ 2022-04-13 14:26 UTC (permalink / raw)
  To: 52362@debbugs.gnu.org

FYI,

i have extensive fixes to the go importer that i'm preparing for submission:

https://github.com/attila-lendvai-patches/guix/tree/import

it fixes this issue, and it can also recursively import rclone (and go-ethereum for that matter):

./pre-inst-env guix import go --recursive github.com/rclone/rclone

emits 100+ packages.

unfortunately, it fails on/skips:

guix import go github.com/billziss-gh/cgofuse

i suspect that it's probably because that module is not adhering to the git tag name rules.

-- 
- attila
PGP: 5D5F 45C7 DFCD 0A39




^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#52362: guix import go error
  2022-02-28 23:55 ` bug#52362: [PATCH v3] guix: import: go: Use correct tag for go module in subdirectory Nicolas Goaziou
@ 2023-05-25 14:21   ` Simon Tournier
  2023-05-25 18:58     ` Nicolas Goaziou
  0 siblings, 1 reply; 13+ messages in thread
From: Simon Tournier @ 2023-05-25 14:21 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: 52362

Hi,


On mar., 01 mars 2022 at 00:55, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:

>   ./pre-inst-env guix import go --recursive rclone

Using Guix 14c0380, I get:

--8<---------------cut here---------------start------------->8---
$ guix import go --recursive rclone
guix import: warning: Failed to import package "rclone".
reason: "https://proxy.golang.org/rclone/@v/list" could not be fetched: HTTP error 404 ("Not Found").
This package and its dependencies won't be imported.
--8<---------------cut here---------------end--------------->8---

Moreover, instead of the patch in this thread, I am proposing #63647 [1]
which warns by handling the error, for instance, it displays using
another example from the thread,

--8<---------------cut here---------------start------------->8---
guix import: warning: Git error: reference 'refs/tags/v0.11.29' not found in https://github.com/Azure/go-autorest
(define-public go-github-com-azure-go-autorest-autorest
  (package
    (name "go-github-com-azure-go-autorest-autorest")
    (version "0.11.29")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url "https://github.com/Azure/go-autorest")
                    (commit (string-append "v" version))))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "0000000000000000000000000000000000000000000000000000"))))
    (build-system go-build-system)
    (arguments
     '(#:import-path "github.com/Azure/go-autorest/autorest"
       #:unpack-path "github.com/Azure/go-autorest"))
    (propagated-inputs `(("go-golang-org-x-crypto" ,go-golang-org-x-crypto)
                         ("go-github-com-golang-jwt-jwt-v4" ,go-github-com-golang-jwt-jwt-v4)
                         ("go-github-com-azure-go-autorest-tracing" ,go-github-com-azure-go-autorest-tracing)
                         ("go-github-com-azure-go-autorest-logger" ,go-github-com-azure-go-autorest-logger)
                         ("go-github-com-azure-go-autorest-autorest-mocks" ,go-github-com-azure-go-autorest-autorest-mocks)
                         ("go-github-com-azure-go-autorest-autorest-adal" ,go-github-com-azure-go-autorest-autorest-adal)
                         ("go-github-com-azure-go-autorest" ,go-github-com-azure-go-autorest)))
    (home-page "https://github.com/Azure/go-autorest")
    (synopsis #f)
    (description
     "Package autorest implements an HTTP request pipeline suitable for use across
multiple go-routines and provides the shared routines relied on by AutoRest (see
@@url{https://github.com/Azure/autorest/,https://github.com/Azure/autorest/})
generated Go code.")
    (license license:asl2.0)))
--8<---------------cut here---------------end--------------->8---

Aside, indeed the proposed patch in this thread could also be merged.

1: https://issues.guix.gnu.org/issue/63647


Cheers,
simon




^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#52362: guix import go error
  2022-01-16  3:32 ` bug#52362: [PATCH v3] " Stephen Paul Weber
@ 2023-05-25 16:13   ` Simon Tournier
  0 siblings, 0 replies; 13+ messages in thread
From: Simon Tournier @ 2023-05-25 16:13 UTC (permalink / raw)
  To: Stephen Paul Weber; +Cc: 52362

Hi,

Sorry for the delay.  Thanks for this contribution.  I included this
patch in the series #63647 [1].  Therefore, I guess this bug report can
be close.  WDYT?

1: https://issues.guix.gnu.org/issue/63647#6


Cheers,
simon




^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#52362: guix import go error
  2023-05-25 14:21   ` bug#52362: guix import go error Simon Tournier
@ 2023-05-25 18:58     ` Nicolas Goaziou
  2023-05-25 19:08       ` Simon Tournier
  0 siblings, 1 reply; 13+ messages in thread
From: Nicolas Goaziou @ 2023-05-25 18:58 UTC (permalink / raw)
  To: Simon Tournier; +Cc: 52362

Hello,

Simon Tournier <zimon.toutoune@gmail.com> writes:

> On mar., 01 mars 2022 at 00:55, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
>
>>   ./pre-inst-env guix import go --recursive rclone
>
> Using Guix 14c0380, I get:
>
> --8<---------------cut here---------------start------------->8---
> $ guix import go --recursive rclone
> guix import: warning: Failed to import package "rclone".
> reason: "https://proxy.golang.org/rclone/@v/list" could not be fetched: HTTP error 404 ("Not Found").
> This package and its dependencies won't be imported.
> --8<---------------cut here---------------end--------------->8---

Oops! For the record, I meant:

   guix import go --recursive github.com/rclone/rclone

Regards,
-- 
Nicolas Goaziou




^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#52362: guix import go error
  2023-05-25 18:58     ` Nicolas Goaziou
@ 2023-05-25 19:08       ` Simon Tournier
  0 siblings, 0 replies; 13+ messages in thread
From: Simon Tournier @ 2023-05-25 19:08 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: 52362

Hi,

On jeu., 25 mai 2023 at 20:58, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:

> Oops! For the record, I meant:
>
>    guix import go --recursive github.com/rclone/rclone

I get:

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix import go --recursive github.com/rclone/rclone
following redirection to `https://github.com/storj/eventkit?go-get=1'...
following redirection to `https://goftp.io/server/?go-get=1'...
following redirection to `https://github.com/qingstor/qingstor-sdk-go?go-get=1'...
Backtrace:
In srfi/srfi-1.scm:
   586:29 19 (map1 _)
   586:29 18 (map1 _)
   586:29 17 (map1 _)
   586:29 16 (map1 _)
   586:29 15 (map1 _)
   586:29 14 (map1 _)
   586:29 13 (map1 _)
   586:29 12 (map1 _)
   586:29 11 (map1 _)
   586:17 10 (map1 (("github.com/yunify/qingstor-sdk-go/v3" #f) ("github.com/youmark/pkcs8" #f) ("github.com/winfsp/cgofuse" #f) ("github.com/t3rm1…" …) …))
In guix/import/utils.scm:
   630:33  9 (lookup-node "github.com/yunify/qingstor-sdk-go/v3" #f)
In guix/memoization.scm:
     98:0  8 (mproc "github.com/yunify/qingstor-sdk-go/v3" #:repo->guix-package #<procedure mproc args> #:guix-name #<procedure go-module->guix-package-…> …)
In unknown file:
           7 (_ #<procedure 7f95e4ebcfc0 at guix/memoization.scm:179:32 ()> #<procedure list _> (this is nothing))
In guix/import/go.scm:
   708:10  6 (_ _ #:version _ #:repo _)
In ice-9/exceptions.scm:
   406:15  5 (go-module->guix-package* . _)
In ice-9/boot-9.scm:
  1752:10  4 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _)
In guix/import/go.scm:
   641:11  3 (go-module->guix-package "github.com/yunify/qingstor-sdk-go/v3" #:goproxy _ #:version _ #:pin-versions? _)
In unknown file:
           2 (substring "github.com/yunify/qingstor-sdk-go" 35 #<undefined>)
In ice-9/boot-9.scm:
  1685:16  1 (raise-exception _ #:continuable? _)
  1683:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1683:16: In procedure raise-exception:
Value out of range 0 to< 33: 35
--8<---------------cut here---------------end--------------->8---

which is a bug but another one. :-)

Well, we can keep this bug open in order to address this other bug or
close it – since the issue with labels is done by Stephen’s patch – and
then open another one for tackle the issue above.

For instance, it reads,

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix import go github.com/yunify/qingstor-sdk-go
Backtrace:
In ice-9/boot-9.scm:
  1752:10 14 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _)
In unknown file:
          13 (apply-smob/0 #<thunk 7fa1f7e7d2a0>)
In ice-9/boot-9.scm:
    724:2 12 (call-with-prompt _ _ #<procedure default-prompt-handler (k proc)>)
In ice-9/eval.scm:
    619:8 11 (_ #(#(#<directory (guile-user) 7fa1f7e82c80>)))
In guix/ui.scm:
   2300:7 10 (run-guix . _)
  2263:10  9 (run-guix-command _ . _)
In guix/scripts/import.scm:
    89:11  8 (guix-import . _)
In ice-9/boot-9.scm:
  1752:10  7 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _)
In guix/scripts/import/go.scm:
   116:29  6 (_)
In ice-9/exceptions.scm:
   406:15  5 (go-module->guix-package* . _)
In ice-9/boot-9.scm:
  1752:10  4 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _)
In guix/import/go.scm:
   598:11  3 (go-module->guix-package "github.com/yunify/qingstor-sdk-go" #:goproxy _ #:version _ #:pin-versions? _)
In unknown file:
           2 (regexp-exec #<regexp 7fa1ec976580> #f #<undefined> #<undefined>)
In ice-9/boot-9.scm:
  1685:16  1 (raise-exception _ #:continuable? _)
  1683:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1683:16: In procedure raise-exception:
In procedure regexp-exec: Wrong type argument in position 2 (expecting string): #f
--8<---------------cut here---------------end--------------->8---


Cheers,
simon




^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-05-26 12:18 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-07 22:08 bug#52362: guix import go error Stephen Paul Weber
2022-01-12  3:58 ` Stephen Paul Weber
2022-01-12  4:28   ` Stephen Paul Weber
2022-01-15  1:43 ` bug#52362: [PATCH] guix: import: go: Use correct tag for go module in subdirectory Stephen Paul Weber
2022-01-15  1:56   ` Stephen Paul Weber
2022-01-16  2:56 ` bug#52362: [PATCH v2] " Stephen Paul Weber
2022-01-16  3:32 ` bug#52362: [PATCH v3] " Stephen Paul Weber
2023-05-25 16:13   ` bug#52362: guix import go error Simon Tournier
2022-02-28 23:55 ` bug#52362: [PATCH v3] guix: import: go: Use correct tag for go module in subdirectory Nicolas Goaziou
2023-05-25 14:21   ` bug#52362: guix import go error Simon Tournier
2023-05-25 18:58     ` Nicolas Goaziou
2023-05-25 19:08       ` Simon Tournier
2022-04-13 14:26 ` bug#52362: another patchset Attila Lendvai

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).