guix import go error

  • Open
  • quality assurance status badge
Details
4 participants
  • Attila Lendvai
  • Nicolas Goaziou
  • Stephen Paul Weber
  • Simon Tournier
Owner
unassigned
Submitted by
Stephen Paul Weber
Severity
normal
S
S
Stephen Paul Weber wrote on 7 Dec 2021 23:08
(address . bug-guix@gnu.org)
Ya/bU8a43auuMRP0@singpolyma-beefy.lan
$ 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'.
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEWeaCw+rzmiEMpzU00RwpEc5RnN4FAmGv208ACgkQ0RwpEc5R
nN5VWxAAiYeDjqejJ2X9XHJOWZVn+IIybHTe8euPpzOzF/SfufeGabNr9fy8J0wx
qpKZYNUH18S/3vyAqPILBgGodbv72aNtxRvbgz3PFLVY3bH7lh52/KeQlpI8E9Hu
aU3URzbtHC7HkTx0DwTzNgj09Ds9OfsZV6jAttTqn3jkZA2+deP6MtiYLooEsoln
5LhXIqHj+4BBah2w+ev/yqu57EOQDwCw3mHFeMGC2Qllez7laXVbo9WgiVokpULd
1cImRzTt3Aa017Fbdi/+IzEH2LlimcFL2FEKph0v3wTUpCk8EAmenhEVNOKpFAvN
bSIGbF3aGKEgT7Ajh3dUI4curp+cV/awKpmNF7+5BfVMzS41M3z9zWqovrxuisF0
0E5VAaUatNtnp2WESikRrSwcG2ivi1vCZR4nVm/KCKXm4m3xzqe2CcEjbr8AWyqL
T4b7iarraDmHjMNm6jmzFyRHuXR64CrqLgTjREho8Z7OBa+q09d6NNBryiLlZnCK
cjWO8aasQq18Om08QU7yISoHShhUTrWDhTsKJZH4R0UZ1+EZVXZst3rGbR/ISTU5
Tpwg2PoerOH8FEW3AsQ41jvByxuofCs0xcr3CCVrgzNVbFRbJVzMY01j79Xvn+K3
3ClJIQL4e8EViK6bUTNcTGRbmAofIvagrhgG4itMNTyFYjEB9mg=
=IRJz
-----END PGP SIGNATURE-----


S
S
Stephen Paul Weber wrote on 12 Jan 2022 04:58
(address . 52362@debbugs.gnu.org)
Yd5R+fEA+Czl6HwA@singpolyma-beefy.lan
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
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEWeaCw+rzmiEMpzU00RwpEc5RnN4FAmHeUfQACgkQ0RwpEc5R
nN5Acg/8D9RyaNa5gjjfe6fFOPwzO0nm9ibT3dEYKaswGhp1FuKeevXPp3zmPUGu
6hXaTqfloWAMBsAbInvyJBR97KTRiVnzVvd+8MI/MXtCVwHPPdwMrCmAeFV+zyR/
4XhuTP/rYA+PktqpTX+0J7xTQH+gtB5xJMSCK37yp4wdIwVwX/KybKYMburweD2o
LHnixL8fnOCFfK+TkelKMab/GQb0EsCFO0MWLpxAnGho1abiwNnw11/0KiODHqy7
i1J/Hj97vczPoUMoaN+HvLcec+blGJcnMnHFAjPui//zJ3mG/gCbG+JAKInE1hhY
MrHNyyvQJRvVlMkDYQby9PeZEAtNabhGvufTJ2qJEXW41lF+WEoKoR9ynjbOZbRC
ZZJmhmFcPvIZoOBzd8L5ktK4Hdm4WEnsrDcp/YJ6h3WAUj9lzLPqImHFDeHD16pG
7VWhK2QZ6MwjdnMKSMiy+hst65lzknlwxRwvxhlYsdOC5gOveabAZzZbWPkgfI5c
zhC1fEZqlUrZkZU+Xnuij39M/W30fznMJRT7tiWVGc4jC5tFEw13O51Wzu07tPW3
baYr2Zq17/lw8r+6RGdFe9KcajEJSDFlgsJs6BAv012C8farpAYgI2BqqH/kzwqL
ZiO/fBgV2kE30mwFvR1/Dx6bTxP9m16DP8SInOETwjD5DJcnWp4=
=x2Hk
-----END PGP SIGNATURE-----


S
S
Stephen Paul Weber wrote on 12 Jan 2022 05:28
(address . 52362@debbugs.gnu.org)
Yd5Y3KcqyWg33n+H@singpolyma-beefy.lan
Alright, I think I have found the issue. https://go.dev/ref/modsays:

Toggle quote (7 lines)
> 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.
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEWeaCw+rzmiEMpzU00RwpEc5RnN4FAmHeWNYACgkQ0RwpEc5R
nN5g+Q/8DpO2RDwQqzRaiBnU7IZ5eqsvBXJG9cSBP0BRBQL9cmkHhGtp5TBYaUy4
h9YSN7NI3XMMmOXH3QMACNvRHblyjBuwe9GYqyu8G344rqKhmmWLY8FWNNOrLuJV
bDVGGEP4LM+0CevrmiIRQe8QqXdULjOD55UaSuREh7cU4k/U4INJ5GHRqVkiLI2e
uKUEgh7FijbDXwAduu/Ay88zclrJS3DZdMhDkydeGjvLbeveV77LSlyhVfVpScMA
froV5OPIfTTEseLvg2+MNB7/CzQFa49+fAcHvS2nsUz5pQhOaXMkg//5por/ToEG
Abw3+LWM51iFFkcqd9ZCPCYXXCCLLmps8orRaYAmso/Y+vD3YNo5XhVbnpW+W1Mm
j3E1fDpCVxvnIYJBZxtC0Cch4IEmnNVdN9RcEzbfwTtyJp/+BnKBpQOusD6LaaVB
mfHbC3qpzdnuxeo5OnKPryj/wEkoV0xvzyC2R5+LSL4KhxlYldJEsEEKDCW3LydJ
/j3C9eCwkRHlEIDdx9nSaLHINV/xaVHUyqxPLF33uvOtaR1PlRX/ZHIa+diPoT/Z
pVGvduSAtrvefcvEx7Z1YMhZUhHQyMrcL0YpPDgccMRssF+Btk1M0X6c9PaH0MpT
obcB4gMsLL6v9vsuZRAlM9b/96ake0Th3iMM3nNdvaJxZyJFPmI=
=TIPZ
-----END PGP SIGNATURE-----


S
S
Stephen Paul Weber wrote on 15 Jan 2022 02:43
[PATCH] guix: import: go: Use correct tag for go module in subdirectory.
(address . 52362@debbugs.gnu.org)(name . Stephen Paul Weber)(address . singpolyma@singpolyma.net)
20220115014333.26372-1-singpolyma@singpolyma.net
https://go.dev/ref/modsays 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(-)

Toggle diff (65 lines)
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
S
S
Stephen Paul Weber wrote on 15 Jan 2022 02:56
(address . 52362@debbugs.gnu.org)
YeIpthv5P/B5zTbG@singpolyma-beefy.lan
Somebody claiming to be Stephen Paul Weber wrote:
Toggle quote (3 lines)
>https://go.dev/ref/modsays 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?
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEWeaCw+rzmiEMpzU00RwpEc5RnN4FAmHiKbEACgkQ0RwpEc5R
nN4tCg//dGl3uOpdc5UE0atj0/rpUjsReDLJnPoDgA3McPh3ciAT8X8FS9RZF+6Y
M0wrIXqb3yRJzZ6PBjs68OiUZ1dBAseuxsFwzfi8DDF7dYlS20TQ8gh4eP2D54qy
AH9hiQccp/Emy7M0n93pMAD2+NBLNcGALxhBau5ZFwecGJEg3iSGhrGi6Enwpz7d
G9i/vv+ijzZU9jQXaJkpr7iaEMf4S3SUrv6jj4QvfsSwGxMijPK+7ugfzS9kbn0h
EFRBIvR1EF+JVGgPMsrzN8e56NQ7jKqWNZNLCJ3GUPefnyEVleYCmxC0HX5pwE7f
1rsaKFH8OGC4Vzj/r4JJ46yz3lNCdc/srxL6+tAkakrBC7JEhZrWpBesKEU67a/o
o3D7Sa6/6VuA4b2p4K4UyKyhTz7M6usTrXtyhfJYNXUbBrVSZH33z51oEyFX4UHU
2Bxp5G06F/jnBR20CjwUeLkGf4TkkajEORJn0y5qkkVJ9lsyQrML44Mz9S7j3f/o
HngQTG+WLOJaSnw7OB9+eD7wwRdeGbqf0iaJvYSnvJx4ns+mXHbWtsj0rrjQ5Z0c
qPWc38Goye92sH1JuGjcNslDzcLkZi9+mM40o5fI2kFhK62D/QWoJG3hvvj7YFQS
VvEy8hWKKd+zE16i9EwdPiynLZOMSICV2BdWyxSj3JP+h3OSRj0=
=JXfH
-----END PGP SIGNATURE-----


S
S
Stephen Paul Weber wrote on 16 Jan 2022 03:56
[PATCH v2] guix: import: go: Use correct tag for go module in subdirectory.
(address . 52362@debbugs.gnu.org)(name . Stephen Paul Weber)(address . singpolyma@singpolyma.net)
20220116025634.43833-1-singpolyma@singpolyma.net
https://go.dev/ref/modsays 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(-)

Toggle diff (77 lines)
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
S
S
Stephen Paul Weber wrote on 16 Jan 2022 04:32
[PATCH v3] guix: import: go: Use correct tag for go module in subdirectory.
(address . 52362@debbugs.gnu.org)(name . Stephen Paul Weber)(address . singpolyma@singpolyma.net)
20220116033208.54370-1-singpolyma@singpolyma.net
https://go.dev/ref/modsays 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(-)

Toggle diff (81 lines)
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
N
N
Nicolas Goaziou wrote on 1 Mar 2022 00:55
(address . 52362@debbugs.gnu.org)
875yoywnpx.fsf@nicolasgoaziou.fr
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:

Toggle snippet (38 lines)
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

Do you know why it is failing like this?

Regards,
--
Nicolas Goaziou
A
A
Attila Lendvai wrote on 13 Apr 2022 16:26
another patchset
(name . 52362@debbugs.gnu.org)(address . 52362@debbugs.gnu.org)
y9U5agWrhqQDaR0EieoAUTleO_qyVlmgazVP0ilnWM18wIaWY1HKJPQM57N-aV6oA2RonxFQ59fTqY_uG-FHPJpsdS0nUBlxmaDa43XMR54=@lendvai.name
FYI,

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


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
S
S
Simon Tournier wrote on 25 May 2023 16:21
Re: bug#52362: guix import go error
(name . Nicolas Goaziou)(address . mail@nicolasgoaziou.fr)(address . 52362@debbugs.gnu.org)
87lehcwkyq.fsf_-_@gmail.com
Hi,


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

Toggle quote (2 lines)
> ./pre-inst-env guix import go --recursive rclone

Using Guix 14c0380, I get:

Toggle snippet (6 lines)
$ 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.

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,

Toggle snippet (35 lines)
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)))

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



Cheers,
simon
S
S
Simon Tournier wrote on 25 May 2023 18:13
(name . Stephen Paul Weber)(address . singpolyma@singpolyma.net)(address . 52362@debbugs.gnu.org)
87bki8wfs0.fsf_-_@gmail.com
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?



Cheers,
simon
N
N
Nicolas Goaziou wrote on 25 May 2023 20:58
(name . Simon Tournier)(address . zimon.toutoune@gmail.com)(address . 52362@debbugs.gnu.org)
87pm6ofdbc.fsf@nicolasgoaziou.fr
Hello,

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

Toggle quote (13 lines)
> 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
S
S
Simon Tournier wrote on 25 May 2023 21:08
(name . Nicolas Goaziou)(address . mail@nicolasgoaziou.fr)(address . 52362@debbugs.gnu.org)
87edn4ut2w.fsf@gmail.com
Hi,

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

Toggle quote (4 lines)
> Oops! For the record, I meant:
>
> guix import go --recursive github.com/rclone/rclone

I get:

Toggle snippet (40 lines)
$ ./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

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,

Toggle snippet (36 lines)
$ ./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


Cheers,
simon
?
Your comment

Commenting via the web interface is currently disabled.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 52362
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch