summaryrefslogtreecommitdiff
path: root/guix/import
diff options
context:
space:
mode:
authorSarah Morgensen <iskarian@mgsn.dev>2021-09-28 19:59:32 -0700
committerLudovic Courtès <ludo@gnu.org>2021-10-04 16:36:59 +0200
commit834ff65e8525a9a90545b34504a9098142e3163b (patch)
tree805212aecb16b2f0bb74e3f2a49a38f15f713238 /guix/import
parentac43ead7741357cb620d6a0eb80ae754851b8fa1 (diff)
import: go: Recognize major version suffixes.
Do not treat major version suffixes (such as "/v3") as repository subdirectories. See <https://golang.org/ref/mod#major-version-suffixes>. * guix/import/go.scm (go-module->guix-package): When determining the unpack path, compare 'root-module-path' to 'module-path-sans-suffix' instead of 'module-path'. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'guix/import')
-rw-r--r--guix/import/go.scm4
1 files changed, 3 insertions, 1 deletions
diff --git a/guix/import/go.scm b/guix/import/go.scm
index ca909ab35a..26dbc34b63 100644
--- a/guix/import/go.scm
+++ b/guix/import/go.scm
@@ -612,6 +612,8 @@ hint: use one of the following available versions ~a\n"
(dependencies (if pin-versions?
dependencies+versions
(map car dependencies+versions)))
+ (module-path-sans-suffix
+ (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))
;; The VCS type and URL are not included in goproxy information. For
@@ -631,7 +633,7 @@ hint: use one of the following available versions ~a\n"
(build-system go-build-system)
(arguments
'(#:import-path ,module-path
- ,@(if (string=? module-path root-module-path)
+ ,@(if (string=? module-path-sans-suffix root-module-path)
'()
`(#:unpack-path ,root-module-path))))
,@(maybe-propagated-inputs