From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id YBUwMtHr+19eUAAA0tVLHw (envelope-from ) for ; Mon, 11 Jan 2021 06:10:25 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id kBAJLtHr+19dfAAA1q6Kng (envelope-from ) for ; Mon, 11 Jan 2021 06:10:25 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E25A29402B1 for ; Mon, 11 Jan 2021 06:10:24 +0000 (UTC) Received: from localhost ([::1]:54504 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kyqPH-0002A2-Tm for larch@yhetil.org; Mon, 11 Jan 2021 01:10:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40176) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kyqOy-00028c-4c for help-guix@gnu.org; Mon, 11 Jan 2021 01:10:04 -0500 Received: from smtp-out-3.mxes.net ([198.205.123.68]:35938) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kyqOv-0001nF-NO for help-guix@gnu.org; Mon, 11 Jan 2021 01:10:03 -0500 Received: from Customer-MUA (mua.mxes.net [10.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id 9E7E175981; Mon, 11 Jan 2021 01:09:53 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mxes.net; s=mta; t=1610345395; bh=g1VGCNAA2yVhuOVk6x6ipsaTC79wj4xeh1FlfmuRI/s=; h=From:To:Subject:In-Reply-To:References:Date:From; b=y2PhxsmAdY1pfr7VTLopZ1M39bjsIXDqNw6X/dxefNyCeX02jqFhbFDLBVLw1iyH0 riqaWYXVkiTReRjzMjT+oMLjcVmUZat7wjdKaOC8gxKRZdctVU5OC458XFnz2fBHYU vx/CtQtSe1afflyMA1fRwbosQ5klCIQoX4k5SXik= From: Timmy Douglas To: Leo Famulari , help-guix@gnu.org, Katherine Cox-Buday , Helio Machado <0x2b3bfa0@gmail.com> Subject: Re: packaging a golang package In-Reply-To: <87a6thtyvm.fsf@timmydouglas.com> References: <87h7nrud2a.fsf@timmydouglas.com> <4bdbc469-ad45-4739-b001-739ad3a60adc@www.fastmail.com> <87a6thtyvm.fsf@timmydouglas.com> Date: Sun, 10 Jan 2021 22:09:52 -0800 Message-ID: <87bldw0ztb.fsf@timmydouglas.com> MIME-Version: 1.0 Content-Type: text/plain X-Sent-To: Received-SPF: none client-ip=198.205.123.68; envelope-from=mail+GO=3fb9f824@timmydouglas.com; helo=smtp-out-3.mxes.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: 0.45 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=mxes.net header.s=mta header.b=y2PhxsmA; dmarc=none; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Queue-Id: E25A29402B1 X-Spam-Score: 0.45 X-Migadu-Scanner: scn1.migadu.com X-TUID: Lc93ZO6l1tNd I also tried Helio's branch, rebased on the latest, with the following changes: diff --git a/guix/import/go-modules.scm b/guix/import/go-modules.scm index 20fc5c9642..811c9f60ae 100644 --- a/guix/import/go-modules.scm +++ b/guix/import/go-modules.scm @@ -290,7 +290,7 @@ VERSION, MODULE-INPUTS, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE." (() "") (_ home-page))) (synopsis ,synopsis) - (description ,(beautify-description description)) + (description ,(beautify-description (or description ""))) (license ,(match license (() #f) ((license) license) @@ -327,12 +327,11 @@ specified, attempt to fetch that version. Otherwise, fetch the latest version." (define* (go-module-recursive-import name #:optional version) "Given a module NAME and, optionally its VERSION, produce package definitions for itself and every dependency, recursively." - (recursive-import (if version (string-append name "@" version) name) #f + (recursive-import (if version (string-append name "@" version) name) #:repo->guix-package - (lambda (name repo) + (lambda* (name #:key repo version) (let-values (((name version) (package-name->name+version name))) - (go-module->guix-package name version)) - ) + (go-module->guix-package name version))) #:guix-name go-module-name+version->package-name+version)) I liked how Helio's version uses the go proxy to simplify the parsing of the package lists, but I ran this: ./pre-inst-env guix import go-modules -r github.com/coredns/coredns and it took what felt like thirty minutes before failing with: error: failed to retrieve package information from "https://proxy.golang.org/replace/@v/(.info": 410 ("Gone") Backtrace: In ice-9/boot-9.scm: 1736:10 18 (with-exception-handler _ _ #:unwind? _ # _) In unknown file: 17 (apply-smob/0 #) In ice-9/boot-9.scm: 718:2 16 (call-with-prompt _ _ #) In ice-9/eval.scm: 619:8 15 (_ #(#(#))) In guix/ui.scm: 2154:12 14 (run-guix-command _ . _) In guix/scripts/import.scm: 121:11 13 (guix-import . _) In ice-9/eval.scm: 159:9 12 (_ _) In guix/import/utils.scm: 464:27 11 (recursive-import _ #:repo->guix-package _ #:guix-name _ ?) In srfi/srfi-1.scm: 586:29 10 (map1 (("github.com/davecgh/go-spew@v1.1.1" #f) (# #) ?)) 586:29 9 (map1 (("github.com/google/go-cmp@v0.4.0" #f) ("g?" ?) ?)) 586:29 8 (map1 (("github.com/google/gofuzz@v1.1.0" #f) ("g?" ?) ?)) 586:29 7 (map1 (("github.com/kr/pretty@v0.2.0" #f) ("githu?" ?) ?)) 586:29 6 (map1 (("github.com/spf13/pflag@v1.0.5" #f) ("gol?" ?) ?)) 586:29 5 (map1 (("golang.org/x/tools@v0.0.0-20200505023115?" ?) ?)) 586:29 4 (map1 (("gopkg.in/check.v1@v1.0.0-20190902080502-?" ?) ?)) 586:29 3 (map1 (("k8s.io/klog/v2@v2.2.0" #f) ("sigs.k8s.io?" ?) ?)) 586:29 2 (map1 (("sigs.k8s.io/yaml@v1.2.0" #f) ("replace@(" #f))) 586:17 1 (map1 (("replace@(" #f))) In guix/import/utils.scm: 453:33 0 (lookup-node "replace@(" #f) guix/import/utils.scm:453:33: In procedure lookup-node: Wrong number of values returned to continuation (expected 2) Looks like it ran into the replace syntax and didn't parse it correctly? https://golang.org/ref/mod#go-mod-file I sort of wonder if the `git-fetch` portion of go packages should be something like `git-fetch-and-restore-go-modules` Maybe something like `go mod vendor` could be used an the hash would be calculated on that? I'm not familiar enough with the internals of go modules, but I'm not really seeing the value in generating a bunch of package metadata on all the module dependencies.