From 83f8b6d32c76c56e4bb58eeb5af1259028d7ee72 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Sun, 21 Mar 2021 00:16:22 -0400 Subject: import: go: Append version to symbol name in the pinned version mode. This allows importing packages with complicated version specific dependency chains without the package symbol names colliding. * doc/guix.texi (Invoking guix import): Document the --pin-versions option. Mention that a specific version can be imported. Remove the experimental warning. * guix/import/go.scm (go-module->guix-package-name)[version]: Add optional argument. Rewrite the character translation in terms of string-map. (go-module->guix-package): Conditionally use dependencies whose symbol include their version, based no the value of the PIN-VERSIONS? argument. * guix/import/utils.scm (package->definition): Add a new case where the full version string is appended to the package symbol. * guix/scripts/import.scm (guix-import): Correctly print forms starting with '(define-public [...]'. * guix/scripts/import/go.scm (guix-import-go): Conditionally include the version in the package symbols defined. --- doc/guix.texi | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index d4320f16e1..84d8bf50be 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -11553,13 +11553,13 @@ Select the given repository (a repository name). Possible values include: Import metadata for a Go module using @uref{https://proxy.golang.org, proxy.golang.org}. -This importer is highly experimental. See the source code for more info -about the current state. - @example guix import go gopkg.in/yaml.v2 @end example +It is possible to use a package specification with a @code{@@VERSION} +suffix to import a specific version. + Additional options include: @table @code @@ -11568,6 +11568,14 @@ Additional options include: Traverse the dependency graph of the given upstream package recursively and generate package expressions for all those packages that are not yet in Guix. +@item --pin-versions +When using this option, the importer preserves the exact versions of the +Go modules dependencies instead of using their latest available +versions. This can be useful when attempting to import packages that +recursively depend on former versions of themselves to build. When +using this mode, the symbol of the package is made by appending the +version to its name, so that multiple versions of the same package can +coexist. @end table @end table -- cgit v1.2.3