GNU bug report logs - #43872
[PATCH] Add package go-ethereum

Previous Next

Package: guix-patches;

Reported by: Helio Machado <0x2b3bfa0 <at> gmail.com>

Date: Thu, 8 Oct 2020 22:45:02 UTC

Severity: normal

Tags: patch

Done: Helio Machado <0x2b3bfa0 <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 43872 in the body.
You can then email your comments to 43872 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#43872; Package guix-patches. (Thu, 08 Oct 2020 22:45:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Helio Machado <0x2b3bfa0 <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 08 Oct 2020 22:45:02 GMT) Full text and rfc822 format available.

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

From: Helio Machado <0x2b3bfa0 <at> gmail.com>
To: guix-patches <at> gnu.org
Subject: [PATCH] Add package go-ethereum
Date: Thu, 8 Oct 2020 23:59:23 +0200
[Message part 1 (text/plain, inline)]
# Add package `go-ethereum`

These patches add the [go-ethereum][5] package and a small workaround that
allows experimental module support.

## [Checklist][1]

1. Code authentication: all the code is being pulled from Git repositories
and Go packages, so there isn't any specific code signature we can verify.

2. Synopsis and description: built from the official documentation and
around the style guidelines.

3. Results for `guix lint`: everything seems to be fine, and it seems to
have scheduled a [Software Heritage][2] archival (?).

4. Native build check: the package builds correctly on my platform
(x86-64), using `guix build` package.

5. Cross-build check: package was not tested on any other supported
platform because `go-build-system` [doesn't seem to support
cross-compilation][3].

6. Package deduplication: dependencies are being pulled from their
respective module repositories at build time; there isn't practically any
overlap between the package code and the Guix repositories.

7. Package size: as per `guix size`, this package requires a total of 418.7
MiB, with a package (self) size of 282.4 MiB.

8. Dependent packages: this is a freshly added package with no dependent
items.

9. Deterministic build: this package is fully deterministic and has fixed
hashes for both the initial download and the build derivation.

10. Inclusive language: documentation was written with neutrality in mind
and there isn't any obvious bias, though it might need proofreading.

11. Patch atomicity: this patch contains only one set of related changes,
though modifications affect two files.

12. Code formatting: added lines were formatted by using `indent-code.el`.

13. Source consistency: all the involved downloads are being pulled along
with a Git tag or commit, so results should be consistent enough.

14. Guix build: these changes don't affect Guix builds nor introduce any
warning.

15. Guix consistency: these changes do not break Guix in any obvious way.

## Desiderata

It would be great to have easier ways to replace Go module management
system with Guix in a seamless and painless way. Rust build system for Guix
has a cleaner implementation, majorly due to the existence of a
[centralized package registry][4].

[1]: https://guix.gnu.org/manual/en/html_node/Submitting-Patches.html
[2]: https://www.softwareheritage.org/
[3]:
https://git.savannah.gnu.org/cgit/guix.git/tree/guix/build-system/go.scm#n60
[4]: https://crates.io
[5]: https://github.com/ethereum/go-ethereum
[6]: https://gist.github.com/0x2b3bfa0/1805037bf5efa2655fa71d32e69fdd14
[Message part 2 (text/html, inline)]
[0001-build-system-go-Allow-packages-to-create-fixed-outpu.patch (application/octet-stream, attachment)]
[0002-gnu-Add-go-github-com-ethereum-go-ethereum.patch (application/octet-stream, attachment)]

Reply sent to Helio Machado <0x2b3bfa0 <at> gmail.com>:
You have taken responsibility. (Fri, 09 Oct 2020 14:27:02 GMT) Full text and rfc822 format available.

Notification sent to Helio Machado <0x2b3bfa0 <at> gmail.com>:
bug acknowledged by developer. (Fri, 09 Oct 2020 14:27:02 GMT) Full text and rfc822 format available.

Message #10 received at 43872-done <at> debbugs.gnu.org (full text, mbox):

From: Helio Machado <0x2b3bfa0 <at> gmail.com>
To: 43872-done <at> debbugs.gnu.org
Subject: Closing due to consistency issues
Date: Fri, 9 Oct 2020 14:11:38 +0200
[Message part 1 (text/plain, inline)]
This patch was a big hack and breaks on every architecture but x86-64
because the derivation hash changes when producing different binaries. I'm
leaving this for reference as it might be useful for a casual install, but
the proper solution probably involves a complete refactoring of the Guix Go
Build System.
[Message part 2 (text/html, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#43872; Package guix-patches. (Fri, 09 Oct 2020 18:36:01 GMT) Full text and rfc822 format available.

Message #13 received at 43872-done <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <marius <at> gnu.org>
To: Helio Machado <0x2b3bfa0 <at> gmail.com>, 43872-done <at> debbugs.gnu.org
Subject: Re: bug#43872: Closing due to consistency issues
Date: Fri, 09 Oct 2020 20:34:59 +0200
[Message part 1 (text/plain, inline)]
Hi!

Helio Machado <0x2b3bfa0 <at> gmail.com> writes:

> This patch was a big hack and breaks on every architecture but x86-64
> because the derivation hash changes when producing different binaries. I'm
> leaving this for reference as it might be useful for a casual install, but
> the proper solution probably involves a complete refactoring of the Guix Go
> Build System.

That is a very clever hack.  :-)

The reason it works is because network access is allowed for
fixed-output derivations.  So the Go build system is able to go online
and download everything it needs, instead of relying on declared
inputs.  That is why different architectures produce different
derivation hashes: those are the build outputs.

The problem with this approach is that it is not deterministic.  The
next time someone runs the same build, one of the Go dependencies may
have changed (i.e. a git tag has been overwritten, or a package declares
a dependency on a branch instead of a tag, etc).

Guix will detect if the output hash changes, but is unable reproduce the
earlier state because it does not know what has changed.

To properly package go-ethereum, you will need to declare each
dependency as separate packages.  See e.g. 'syncthing' for an example.
Unfortunately there is no importer for Go yet, making it a rather
tedious task.

Since you don't seem to be afraid of hacking on Guix :-) consider
writing an "importer" for Go so you could simply:

  guix import go -r github.com/ethereum/go-ethereum

...to create the necessary boilerplate.

Thanks!
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#43872; Package guix-patches. (Sat, 10 Oct 2020 18:25:02 GMT) Full text and rfc822 format available.

Message #16 received at 43872-done <at> debbugs.gnu.org (full text, mbox):

From: Helio Machado <0x2b3bfa0 <at> gmail.com>
To: Marius Bakke <marius <at> gnu.org>, 43872-done <at> debbugs.gnu.org
Subject: Re: bug#43872: Closing due to consistency issues
Date: Sat, 10 Oct 2020 20:07:22 +0200
[Message part 1 (text/plain, inline)]
Hi!
I started yesterday to improve the Go build system and create a solid
recursive importer. It implies some structural change for every package,
but it's probably worth it and I'll submit a new patch once it's ready.
I'm attaching some internal documentation for my hack for historical
purposes.
Thank you very much for your advice!
[Message part 2 (text/html, inline)]
[Guix-go-modules.md (text/markdown, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#43872; Package guix-patches. (Sat, 10 Oct 2020 20:37:01 GMT) Full text and rfc822 format available.

Message #19 received at 43872-done <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <marius <at> gnu.org>
To: Helio Machado <0x2b3bfa0 <at> gmail.com>, 43872-done <at> debbugs.gnu.org
Subject: Re: bug#43872: Closing due to consistency issues
Date: Sat, 10 Oct 2020 22:35:35 +0200
[Message part 1 (text/plain, inline)]
Helio Machado <0x2b3bfa0 <at> gmail.com> writes:

> Hi!
> I started yesterday to improve the Go build system and create a solid
> recursive importer. It implies some structural change for every package,
> but it's probably worth it and I'll submit a new patch once it's ready.

Exciting, good luck on the journey.  Importers are decoupled from
build systems, so I'm curious what structural changes are imposed.

Feel free to drop by the #guix IRC channel on Freenode for
up-to-the-minute feedback.  :-)

Thanks a lot for diving into this!

[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 08 Nov 2020 12:24:08 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Attila Lendvai <attila <at> lendvai.name> to control <at> debbugs.gnu.org. (Sun, 29 Aug 2021 15:55:01 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#43872; Package guix-patches. (Sun, 29 Aug 2021 15:57:01 GMT) Full text and rfc822 format available.

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

From: Attila Lendvai <attila <at> lendvai.name>
To: "43872 <at> debbugs.gnu.org" <43872 <at> debbugs.gnu.org>
Subject: (No Subject)
Date: Sun, 29 Aug 2021 15:56:23 +0000
[Message part 1 (text/plain, inline)]
dear fellow hackers,

i'm wondering what happened to the go-ethereum package.

i'm new to guix. i came over from nixos to package the bee client of swarm (https://www.ethswarm.org/). i made a package/service for it on nixos, but the module/service handling there is not flexible enough, and i got discouraged by the seemingly pointless struggle with it.

go-ethereum is a dependency of bee, or more specifically, the clef binary of the go-ethereum project.

this issue is marked CLOSED, but i don't see go-ethereum anywhere in the repo, even though the go importer seems to have been merged.

is there something i can do to help? shall i test this package on guix HEAD? or shall i just wait patiently?

any guidance is appreciated,

- attila
PGP: 5D5F 45C7 DFCD 0A39
[Message part 2 (text/html, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#43872; Package guix-patches. (Mon, 30 Aug 2021 08:02:01 GMT) Full text and rfc822 format available.

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

From: zimoun <zimon.toutoune <at> gmail.com>
To: Attila Lendvai <attila <at> lendvai.name>
Cc: "43872 <at> debbugs.gnu.org" <43872 <at> debbugs.gnu.org>
Subject: Re: [bug#43872] (No Subject)
Date: Mon, 30 Aug 2021 10:01:02 +0200
Hi,

Thanks for your interest.

On Sun, 29 Aug 2021 at 18:43, Attila Lendvai <attila <at> lendvai.name> wrote:

> i'm wondering what happened to the go-ethereum package.

As Marius wrote when closing the patch submission:

--8<---------------cut here---------------start------------->8---
To properly package go-ethereum, you will need to declare each
dependency as separate packages.  See e.g. 'syncthing' for an example.
Unfortunately there is no importer for Go yet, making it a rather
tedious task.
--8<---------------cut here---------------end--------------->8---

<http://issues.guix.gnu.org/43872#2>

> this issue is marked CLOSED, but i don't see go-ethereum anywhere in the repo, even though the go importer seems to have been merged.

The issue is marked closed because it was an incorrect way to package
it.  The Go importer is indeed merged.  Maybe, you could give a try
via this way.

> is there something i can do to help? shall i test this package on guix HEAD? or shall i just wait patiently?

From my opinion, you would get more answers asking on the mailing
guix-devel or on the IRC channel #guix than by unarchiving this "old"
submission. :-)

All the best,
simon




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 27 Sep 2021 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 184 days ago.

Previous Next


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