From patchwork Fri Nov 15 21:11:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=C3=B8rgen_Kvalsvik?= X-Patchwork-Id: 2998 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 725AF27BBE2; Fri, 15 Nov 2024 21:12:33 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 2A8F027BBE2 for ; Fri, 15 Nov 2024 21:12:31 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tC3bo-0002Dv-L7; Fri, 15 Nov 2024 16:12:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tC3bm-0002DS-Jb for guix-patches@gnu.org; Fri, 15 Nov 2024 16:12:02 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tC3bm-00069F-Ak for guix-patches@gnu.org; Fri, 15 Nov 2024 16:12:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=rVFtKXXdhSpqxJhEqDbaGWWcdpUrR3QtFWgh1hz7dnY=; b=DxFpcm79eHKgtkW3NrpVAwyBsYt1Kd6vQ+9+j6TUFXCtZxjsnTiwOcHNGfSKrKJw68HN7LbGrZuKeJ0K7E8nT6dO1hIfH/9Z/LMdgcyR2eaj/dG6d873tbDT+1CIQaJiZePgxB9Vgfgb1Zu3SL5vDAzgeut9xgRMeZfOtT6faEasxhyoHBF/EhQ4Jhr0mCg8B+6uOsr7+kUjqgg/u1AlgMzqu7J45uGZ0vwyhshqCd5Ee8tyo2yuqPqYcskUG8anDq8DiBHcWfVufVWZKTg72LjA5ADMfs+rP8tcQkX6zpORGOxB9A6XPEruLSjZJ5ys7YYzMXQFQl2Z5fA6TwiZJg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tC3bm-0000Fo-5L for guix-patches@gnu.org; Fri, 15 Nov 2024 16:12:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74370] [PATCH 0/4] Module aware go build system, downloader Resent-From: =?utf-8?q?J=C3=B8rgen?= Kvalsvik Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 15 Nov 2024 21:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74370 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74370@debbugs.gnu.org Cc: =?utf-8?q?J=C3=B8rgen?= Kvalsvik X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.1731705102897 (code B ref -1); Fri, 15 Nov 2024 21:12:02 +0000 Received: (at submit) by debbugs.gnu.org; 15 Nov 2024 21:11:42 +0000 Received: from localhost ([127.0.0.1]:51072 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tC3bS-0000EN-9P for submit@debbugs.gnu.org; Fri, 15 Nov 2024 16:11:42 -0500 Received: from lists.gnu.org ([209.51.188.17]:48700) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tC3bP-0000Dx-UG for submit@debbugs.gnu.org; Fri, 15 Nov 2024 16:11:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tC3bN-0002Bs-UW for guix-patches@gnu.org; Fri, 15 Nov 2024 16:11:37 -0500 Received: from mx.kolabnow.com ([212.103.80.155]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tC3bE-00066B-0v for guix-patches@gnu.org; Fri, 15 Nov 2024 16:11:31 -0500 Received: from localhost (unknown [127.0.0.1]) by mx.kolabnow.com (Postfix) with ESMTP id 7604C20B3659 for ; Fri, 15 Nov 2024 22:11:17 +0100 (CET) Authentication-Results: ext-mx-out011.mykolab.com (amavis); dkim=pass (2048-bit key) reason="pass (just generated, assumed good)" header.d=kolabnow.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-transfer-encoding:content-type:content-type:mime-version :message-id:date:date:subject:subject:from:from:received :received:received; s=dkim20240523; t=1731705074; x=1733519475; bh=rVFtKXXdhSpqxJhEqDbaGWWcdpUrR3QtFWgh1hz7dnY=; b=dc5k+fTjFbFO oybpKtDUl3tKSG3Tzv6DdjohCdd9l4K6DhV7ApCICSoZ/h/pBTltfrPzZBw+0jrx HujleLySa4K4MIbPfYj7cEAJkN+LR/ppIEMw1asQfP+VRn2Y76dc4tTLCzZ01n5L CAen+qrAncD0hdcQeelCVKtig2YDYZkskdKfYA7/+B4pWiiz90Sk3yFOIi1mvl35 c1Wg2ukVCIhrVxAdxciyZyY2kOzhS2Z2MRvrCKPhto/dVTDY3xBb1F3SN3/ENp9Z YoEOWZhZT8lSb/1CBI+3JDddnQMyEICeUNnlNGMeWLFBBZvyriqPRjyOFxK947fq 3Ar8llfS0Q== X-Virus-Scanned: amavis at mykolab.com Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out011.mykolab.com [127.0.0.1]) (amavis, port 10024) with ESMTP id Z0E3chYs8Gev for ; Fri, 15 Nov 2024 22:11:14 +0100 (CET) Received: from int-mx009.mykolab.com (unknown [10.9.13.9]) by mx.kolabnow.com (Postfix) with ESMTPS id 056B620B3656 for ; Fri, 15 Nov 2024 22:11:12 +0100 (CET) Received: from ext-subm010.mykolab.com (unknown [10.9.6.10]) by int-mx009.mykolab.com (Postfix) with ESMTPS id AAACA2097183 for ; Fri, 15 Nov 2024 22:11:12 +0100 (CET) From: =?utf-8?q?J=C3=B8rgen?= Kvalsvik Date: Fri, 15 Nov 2024 22:11:02 +0100 Message-Id: <20241115211106.2759121-1-j@lambda.is> MIME-Version: 1.0 Received-SPF: pass client-ip=212.103.80.155; envelope-from=j@lambda.is; helo=mx.kolabnow.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches 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