GNU bug report logs - #74370
[PATCH 0/4] Module aware go build system, downloader

Previous Next

Package: guix-patches;

Reported by: Jørgen Kvalsvik <j <at> lambda.is>

Date: Fri, 15 Nov 2024 21:12:02 UTC

Severity: normal

Tags: patch

Merged with 74371, 74372, 74373

Done: Steve George <steve <at> futurile.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Jørgen Kvalsvik <j <at> lambda.is>
To: 74370 <at> debbugs.gnu.org
Cc: Jørgen Kvalsvik <j <at> lambda.is>
Subject: [bug#74370] [PATCH 0/4] Module aware go build system, downloader
Date: Fri, 15 Nov 2024 22:11:02 +0100
Hi all,

I wrote a downloader+build system for go that is module aware.  It
builds on a few slightly different assumptions than the go build system,
but if you have worked on that most should feel familiar. I am posting
these patches to get some feedback and to check with you if this
approach is even viable, or if I should abandon it altogether. My real
goal has been to build hugo, a popular website generator, which has a
large list of dependencies, most of them in go.

Go itself has pretty strong ideas on how to compose systems. In
particular, it wants to statically link everything, pin every dependency
and transitive dependency (combining build system with packaging and
distribution), and strongly prefer full-source builds. This causes some
friction.

These patches chooses to just roll with it, and uses go mod
downloaditself to fetch sources and create a large image of all the
dependencies a project needs to build. This effectively makes it
pointless to package libraries, as the programs using the libraries
would get them from source anyway, but fixing that is future work.

There are a few things I would like to try to do (re-using built
libraries and storing each module in a separate derivation in
particular), but I don't want to tackle that problem unless there is
real interest for this approach.

Thoughts?

Jørgen Kvalsvik (4):
  guix: Add go module fetcher
  guix: add go module aware build system
  guix: Add module aware 'guix import go'
  gnu: Add go-buf.

 Makefile.am                        |   2 +
 gnu/packages/golang-xyz.scm        |  63 +++++++++---
 guix/build-system/go.scm           | 120 ++++++++++++++++++++++
 guix/build/go-mod-build-system.scm | 154 +++++++++++++++++++++++++++++
 guix/go-mod-download.scm           | 146 +++++++++++++++++++++++++++
 guix/import/go.scm                 |  88 ++++++++++-------
 guix/scripts/import/go.scm         |   6 ++
 7 files changed, 532 insertions(+), 47 deletions(-)
 create mode 100644 guix/build/go-mod-build-system.scm
 create mode 100644 guix/go-mod-download.scm


base-commit: 33665c52c4670bc3b4d337c89ac9cc6c4c69b26f
-- 
2.39.5





This bug report was last modified 43 days ago.

Previous Next


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