Message ID | 58c2e5ecbfef887de1414a4fed38634b0ed6c259.1632884296.git.iskarian@mgsn.dev |
---|---|
State | Accepted |
Headers | show |
Series | [bug#50885] import: go: Recognize major version suffixes. | expand |
Context | Check | Description |
---|---|---|
cbaines/applying patch | fail | View Laminar job |
cbaines/issue | success | View issue |
cbaines/applying patch | fail | View Laminar job |
cbaines/issue | success | View issue |
cbaines/applying patch | fail | View Laminar job |
cbaines/issue | success | View issue |
cbaines/applying patch | fail | View Laminar job |
cbaines/issue | success | View issue |
cbaines/applying patch | fail | View Laminar job |
cbaines/issue | success | View issue |
Sarah Morgensen <iskarian@mgsn.dev> skribis: > 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'. Applied as well, but I feel that it may be useful to have tests for these fine points that where regressions would otherwise be hard to notice. Thanks, Ludo’.
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