unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Jørgen Kvalsvik" <j@lambda.is>
To: 74370@debbugs.gnu.org
Cc: "Jørgen Kvalsvik" <j@lambda.is>
Subject: [bug#74370] [PATCH 0/4] Module aware go build system, downloader
Date: Fri, 15 Nov 2024 22:11:02 +0100	[thread overview]
Message-ID: <20241115211106.2759121-1-j@lambda.is> (raw)

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





             reply	other threads:[~2024-11-15 21:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-15 21:11 Jørgen Kvalsvik [this message]
2024-11-15 21:11 ` [bug#74372] [PATCH 1/4] guix: Add go module fetcher Jørgen Kvalsvik
2024-11-15 21:11 ` [bug#74374] [PATCH 2/4] guix: add go module aware build system Jørgen Kvalsvik
2024-11-15 21:11 ` [bug#74371] [PATCH 3/4] guix: Add module aware 'guix import go' Jørgen Kvalsvik
2024-11-15 21:11 ` [bug#74373] [PATCH 4/4] gnu: Add go-buf Jørgen Kvalsvik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241115211106.2759121-1-j@lambda.is \
    --to=j@lambda.is \
    --cc=74370@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).