[PATCH 1/2] gnu: Replace go-github-com-golang-protobuf-proto with go-github-com-golang-protobuf

  • Done
  • quality assurance status badge
Details
3 participants
  • Dion Mendel
  • Leo Famulari
  • Sharlatan Hellseher
Owner
unassigned
Submitted by
Dion Mendel
Severity
normal
D
D
Dion Mendel wrote on 6 May 2021 18:35
(address . guix-patches@gnu.org)
20210506163511.GB27260@dm9.info
Hi guix,

The github.com/golang/protobuf module contains several packages.
Only proto is currently packaged. This change updates the module from
1.3.1 to 1.5.2 and packages the entire module.

This is needed as I am preparing to package lxd (github.com/lxc/lxd),
which depends on the unpackaged packages from golang/protobuf.

This change replaces go-github-com-golang-protobuf-proto with
go-github-com-golang-protobuf.

There are currently two packages that depend on
go-github-com-golang-protobuf-proto. I have tested this changeset by
building both of these packages.

go-github-com-lucas-clemente-quic-go: this is a source only package that
no other package uses.

syncthing: depends on go-github-com-golang-protobuf-proto via several
intermediary packages. After building, I've run some of the syncthing
executables and they appear to work.
From 47de2a85a1ae1f0502a89d0097d3b36da7d20649 Mon Sep 17 00:00:00 2001
From: Dion Mendel <guix@dm9.info>
Date: Thu, 6 May 2021 23:25:22 +0800
Subject: [PATCH 1/2] gnu: Add go-golang-org-protobuf.

* gnu/packages/golang.scm (go-golang-org-protobuf): New variable.
---
gnu/packages/golang.scm | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)

Toggle diff (50 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 8c3c81ceda..f0fa0e1d36 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -25,6 +25,7 @@
;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
;;; Copyright © 2021 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
+;;; Copyright © 2021 Dion Mendel <guix@dm9.info>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -4832,6 +4833,35 @@ data serialization format.")
(home-page "https://github.com/golang/protobuf")
(license license:bsd-3)))
+(define-public go-golang-org-protobuf
+ (package
+ (name "go-golang-org-protobuf")
+ (version "1.26.0")
+ (home-page "https://github.com/protocolbuffers/protobuf-go")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url home-page)
+ (commit (string-append "v" version))))
+ (sha256
+ (base32
+ "0xq6phaps6d0vcv13ga59gzj4306l0ki9kikhmb52h6pq0iwfqlz"))))
+ (build-system go-build-system)
+ (arguments
+ `(#:import-path "google.golang.org/protobuf"
+ ; Source-only package
+ #:tests? #f
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'build))))
+ (propagated-inputs
+ `(("go-github-com-google-go-cmp-cmp" ,go-github-com-google-go-cmp-cmp)))
+ (synopsis "Go support for Protocol Buffers")
+ (description "This project hosts the Go implementation for protocol buffers, which is a
+language-neutral, platform-neutral, extensible mechanism for serializing
+structured data.")
+ (license license:bsd-3)))
+
(define-public go-github-com-mattn-go-zglob
(package
(name "go-github-com-mattn-go-zglob")
--
2.31.1
L
L
Leo Famulari wrote on 8 May 2021 17:50
(name . Dion Mendel)(address . guix@dm9.info)(address . 48259@debbugs.gnu.org)
YJazUoBEFdnU1OwY@jasmine.lan
On Fri, May 07, 2021 at 12:35:11AM +0800, Dion Mendel wrote:
Toggle quote (4 lines)
> syncthing: depends on go-github-com-golang-protobuf-proto via several
> intermediary packages. After building, I've run some of the syncthing
> executables and they appear to work.

Just to clarify, since commit ed3ef756f521a0df8596a88b66f65b7a1ad99252,
Syncthing does not depend on any Go packages, but instead uses its
bundled copies of all its dependencies.

D
D
Dion Mendel wrote on 9 May 2021 14:37
(address . 48259@debbugs.gnu.org)
20210509123700.GA5323@dm9.info
On Sat, May 08, 2021 at 11:50:42AM -0400, Leo Famulari wrote:
Toggle quote (5 lines)
>
>Just to clarify, since commit ed3ef756f521a0df8596a88b66f65b7a1ad99252,
>Syncthing does not depend on any Go packages, but instead uses its
>bundled copies of all its dependencies.

Is it acceptable to use bundled copies of dependencies? The manual
(section 16.6, checklist #6) says otherwise.

If it's okay, this would make packaging lxd much simpler. I've had to
package around 90 Go libraries so far.

If using lxd's bundled copies of dependencies would be accepted, then I
withdraw this patch request.
L
L
Leo Famulari wrote on 9 May 2021 17:17
(name . Dion Mendel)(address . guix@dm9.info)(address . 48259@debbugs.gnu.org)
YJf9B8AwFmJME2SJ@jasmine.lan
On Sun, May 09, 2021 at 08:37:00PM +0800, Dion Mendel wrote:
Toggle quote (3 lines)
> Is it acceptable to use bundled copies of dependencies? The manual (section
> 16.6, checklist #6) says otherwise.

This item, from the manual section Submitting Patches, says:

"Make sure the package does not use bundled copies of software already
available as separate packages."

So, already, there is some wiggle room based on whether or not things
are "already available as separate packages."

Using bundled dependnencies is strongly discouraged and you are expected
to try to avoid it.

With Syncthing, there were unfixed security vulnerabilities in our
package, and our go-build-system could not build later versions of
Syncthing. So, until our go-build-system is overhauled [0], we'll use
Syncthing's bundled dependencies. They are all free software anyways.

With Go, the old distro model of "no bundling" is not idiomatic, so the
future of Go in Guix may look different from how it is now. Go software
typically has no concept of "versions" and every program pins its
dependencies at specific Git commits. So, to unbundle everything would
leave us with hundreds or thousands of versions of popular libraries.
We'll have to be creative in how we deal with that.

But for now, we try to unbundle.

Toggle quote (6 lines)
> If it's okay, this would make packaging lxd much simpler. I've had to
> package around 90 Go libraries so far.
>
> If using lxd's bundled copies of dependencies would be accepted, then I
> withdraw this patch request.

Please, either try packaging them "by hand" or with the Go module
importer [1]. Code reviewers will ask you to explain why you are using the
bundled dependencies.

[0] The work to overhaul go-build-system is progressing.

I guess it would be a command like:
`guix import go github.com/lcx/lxd --recursive -pin-versions`
But, it depends on LXD using the standard Go module mechanisms. If it
doesn't, maybe each top-level dependency can be imported along with its
dependency graph.
D
D
Dion Mendel wrote on 10 May 2021 04:58
(address . 48259@debbugs.gnu.org)
20210510025838.GA7449@dm9.info
On Sun, May 09, 2021 at 11:17:27AM -0400, Leo Famulari wrote:
Toggle quote (2 lines)
>But for now, we try to unbundle.

Okay, thank you for clarification.

When this changeset passes review and is applied, I'll continue with
packaging lxd and its dependencies.

(Thanks for pointing me towards guix import).
S
S
Sharlatan Hellseher wrote on 23 Jun 21:16 +0200
[PATCH 1/2] gnu: Replace go-github-com-golang-protobuf-proto with go-github-com-golang-protobuf
(address . 48259-done@debbugs.gnu.org)
87h6dj79mt.fsf@gmail.com
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEmEeB3micIcJkGAhndtcnv/Ys0rUFAmZ4dHoACgkQdtcnv/Ys
0rXOOhAA0GT2tVjPdztx56W32WiXW+CPbiwgxj6zGHZ4Q5YfcKehAILjPQc9ytfJ
ksIagMoHj3p9uvT/mbDSw6JJOHKe1GFKI51W68Y9VmXGg23r3oPFxKbIgWsoeu8v
KJM2p0Z7EneufoFLGPXpKmqrj+gu0vdhlDIuPT0sBlHacQCppiTEESYzyBY/KVi/
jKsnIcBZ/J0356neJUEZDy13ydQd9wX8eJFErxb6avTXcbsZNiDUUz0D9oDkIygm
HN7Yvz1pQx/mNgEaVBKK4dhezozQDk2Ta3UwTTHBPsnYuoQKGtWvAde1aRlK0xgL
I+GtLx383NzILJ2FQGxRml/+AxtLzp44Iw8ERcHBAtKgpMDb5Y8IOvPLo+9JDavo
okSu6dZGCKSoM2ecZR9b921R861fDjIcxDVYB8ryj20hVejB0OmV0AsvcNdVbseb
nhlQBKSf7yen+J09+tH9XNb7pldoCeGsN9bNz3UEApp0xD5dp0CYEj840DsGM1/H
xYQZ7K4160Dvg5aEzNKQvQ6GxEJ6CnX4O+SccaXSEtL1L9VuKwuehJPp6Gn9AP+C
o4fekkekR/KdC6IdLQjUbsj3QHAsn/gnbke7GSWykKz+dj7CU1K0g6hsZML3T1nK
63jlNecI3Nao07BuhE6GvxKT6Fyozr4NPz1Z4Q/cozzlIs/97J8=
=7IR/
-----END PGP SIGNATURE-----

Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 48259@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 48259
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch