all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#50885] [PATCH] import: go: Recognize major version suffixes.
@ 2021-09-29  2:59 Sarah Morgensen
  2021-10-04 14:08 ` bug#50885: " Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Sarah Morgensen @ 2021-09-29  2:59 UTC (permalink / raw)
  To: 50885

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'.
---
 guix/import/go.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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

base-commit: c582be4c38596a6a31a39c6799723dcd8b6eb909
prerequisite-patch-id: dbb8a05982f57aefffd5b97ab3dac4073b48245d
-- 
2.33.0





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

* bug#50885: [PATCH] import: go: Recognize major version suffixes.
  2021-09-29  2:59 [bug#50885] [PATCH] import: go: Recognize major version suffixes Sarah Morgensen
@ 2021-10-04 14:08 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2021-10-04 14:08 UTC (permalink / raw)
  To: Sarah Morgensen; +Cc: 50885-done

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’.




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

end of thread, other threads:[~2021-10-04 14:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-29  2:59 [bug#50885] [PATCH] import: go: Recognize major version suffixes Sarah Morgensen
2021-10-04 14:08 ` bug#50885: " Ludovic Courtès

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.