GNU bug report logs - #47310
[PATCH 0/4] go importer: Better synopsis and descriptions, pinned versions mode

Previous Next

Package: guix-patches;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Mon, 22 Mar 2021 04:18:02 UTC

Severity: normal

Tags: patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: guix-patches <at> gnu.org
Subject: [PATCH 0/4] Improve parsing of synopsis and description, add pinned
 versions mode
Date: Mon, 22 Mar 2021 00:10:37 -0400
Hi Guix!

This furthers the Go importer some more by adding better parsing of the
description and synopsis field.  It's now also possible to import specific
versions, or to import dependencies at the exact version.

A good example to try this new mode with is the protobuf package at version
1.24.0, which is what originally motivated this change:

./pre-inst-env guix import go -r --pin-versions google.golang.org/protobuf <at> v1.24.0

--8<---------------cut here---------------start------------->8---
(define-public go-google-golang-org-protobuf-1.23.1-0.20200526195155-81db48ad09cc
  (package
    (name "go-google-golang-org-protobuf")
    (version "1.23.1-0.20200526195155-81db48ad09cc")
    (source
      (origin
        (method git-fetch)
        (uri (git-reference
               (url "https://go.googlesource.com/protobuf")
               (commit (go-version->git-ref version))))
        (file-name (git-file-name name version))
        (sha256
          (base32
            "02cpr8rqr5wmpj2fqb32mzilsdnxkh52g1jz95a3ck3gzffc7hh1"))))
    (build-system go-build-system)
    (arguments
      '(#:import-path "google.golang.org/protobuf"))
    (propagated-inputs
      `(("go-github-com-google-go-cmp-0.4.0"
         ,go-github-com-google-go-cmp-0.4.0)
        ("go-github-com-golang-protobuf-1.4.0"
         ,go-github-com-golang-protobuf-1.4.0)))
    (home-page "https://google.golang.org/protobuf")
    (synopsis "Go support for Protocol Buffers")
    (description
      "This project hosts the Go implementation for
@url{https://developers.google.com/protocol-buffers,protocol buffers}, which is a
language-neutral, platform-neutral, extensible mechanism for serializing
structured data.  The protocol buffer language is a language for specifying the
schema for structured data.  This schema is compiled into language specific
bindings.  This project provides both a tool to generate Go code for the
protocol buffer language, and also the runtime implementation to handle
serialization of messages in Go.  See the
@url{https://developers.google.com/protocol-buffers/docs/overview,protocol buffer developer guide}
for more information about protocol buffers themselves.")
    (license license:bsd-3)))

(define-public go-honnef-co-go-tools-0.0.0-20190523083050-ea95bdfd59fc
  (package
    (name "go-honnef-co-go-tools")
    (version "0.0.0-20190523083050-ea95bdfd59fc")
    (source
      (origin
        (method git-fetch)
        (uri (git-reference
               (url "https://github.com/dominikh/go-tools")
               (commit (go-version->git-ref version))))
        (file-name (git-file-name name version))
        (sha256
          (base32
            "1763nw7pwpzkvzfnm63dgzcgbq9hwmq5l1nffchnhh77vgkaq4ic"))))
    (build-system go-build-system)
    (arguments '(#:import-path "honnef.co/go/tools"))
    (home-page "https://honnef.co/go/tools")
    (synopsis "Documentation")
    (description
      "Staticcheck is a state of the art linter for the .  Using static analysis, it finds bugs and performance issues,
offers simplifications, and enforces style rules.")
    (license license:expat)))

(define-public go-google-golang-org-genproto-0.0.0-20200526211855-cb27e3aa2013
  (package
    (name "go-google-golang-org-genproto")
    (version "0.0.0-20200526211855-cb27e3aa2013")
    (source
      (origin
        (method git-fetch)
        (uri (git-reference
               (url "https://github.com/googleapis/go-genproto")
               (commit (go-version->git-ref version))))
        (file-name (git-file-name name version))
        (sha256
          (base32
            "0ml73ghqcwbz7ipfk8fnxb5indcml49b5p7vp1fsyny0abyyrmxf"))))
    (build-system go-build-system)
    (arguments
      '(#:import-path "google.golang.org/genproto"))
    (propagated-inputs
      `(("go-honnef-co-go-tools-0.0.0-20190523083050-ea95bdfd59fc"
         ,go-honnef-co-go-tools-0.0.0-20190523083050-ea95bdfd59fc)
        ("go-google-golang-org-protobuf-1.23.1-0.20200526195155-81db48ad09cc"
         ,go-google-golang-org-protobuf-1.23.1-0.20200526195155-81db48ad09cc)
        ("go-google-golang-org-grpc-1.27.0"
         ,go-google-golang-org-grpc-1.27.0)
        ("go-golang-org-x-tools-0.0.0-20190524140312-2c0ae7006135"
         ,go-golang-org-x-tools-0.0.0-20190524140312-2c0ae7006135)
        ("go-golang-org-x-lint-0.0.0-20190313153728-d0100b6bd8b3"
         ,go-golang-org-x-lint-0.0.0-20190313153728-d0100b6bd8b3)
        ("go-github-com-golang-protobuf-1.4.1"
         ,go-github-com-golang-protobuf-1.4.1)))
    (home-page "https://google.golang.org/genproto")
    (synopsis "Go generated proto packages")
    (description
      "This repository contains the generated Go packages for common protocol buffer
types, and the generated @url{http://grpc.io,gRPC} code necessary for interacting with Google's gRPC
APIs.")
    (license license:asl2.0)))

(define-public go-google-golang-org-protobuf-1.24.0
  (package
    (name "go-google-golang-org-protobuf")
    (version "1.24.0")
    (source
      (origin
        (method git-fetch)
        (uri (git-reference
               (url "https://go.googlesource.com/protobuf")
               (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
          (base32
            "0x3qyn3rizbs671gs7f8v50rmiwf9h7kbaradpivw9718mhbg1gn"))))
    (build-system go-build-system)
    (arguments
      '(#:import-path "google.golang.org/protobuf"))
    (propagated-inputs
      `(("go-google-golang-org-genproto-0.0.0-20200526211855-cb27e3aa2013"
         ,go-google-golang-org-genproto-0.0.0-20200526211855-cb27e3aa2013)
        ("go-github-com-google-go-cmp-0.4.0"
         ,go-github-com-google-go-cmp-0.4.0)
        ("go-github-com-golang-protobuf-1.4.1"
         ,go-github-com-golang-protobuf-1.4.1)))
    (home-page "https://google.golang.org/protobuf")
    (synopsis "Go support for Protocol Buffers")
    (description
      "This project hosts the Go implementation for
@url{https://developers.google.com/protocol-buffers,protocol buffers}, which is a
language-neutral, platform-neutral, extensible mechanism for serializing
structured data.  The protocol buffer language is a language for specifying the
schema for structured data.  This schema is compiled into language specific
bindings.  This project provides both a tool to generate Go code for the
protocol buffer language, and also the runtime implementation to handle
serialization of messages in Go.  See the
@url{https://developers.google.com/protocol-buffers/docs/overview,protocol buffer developer guide}
for more information about protocol buffers themselves.")
    (license license:bsd-3)))
--8<---------------cut here---------------end--------------->8---
    
Thank you,

Maxim Cournoyer (4):
  import: utils: Refactor maybe-inputs and add maybe-propagated-inputs.
  import: go: Improve synopsis and description parsing.
  import: go: Add an option to use pinned versions.
  import: go: Append version to symbol name in the pinned version mode.

 doc/guix.texi              |  14 +-
 guix/build-system/go.scm   |  24 +-
 guix/import/go.scm         | 454 +++++++++++++++++++++++--------------
 guix/import/utils.scm      |  47 ++--
 guix/scripts/import.scm    |   3 +-
 guix/scripts/import/go.scm |  75 +++---
 tests/go.scm               | 139 ++++++------
 7 files changed, 455 insertions(+), 301 deletions(-)

-- 
2.30.1





This bug report was last modified 4 years and 45 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.