From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id wL56JNtwDmBlTQAA0tVLHw (envelope-from ) for ; Mon, 25 Jan 2021 07:18:51 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id SOdQINtwDmCJSgAAB5/wlQ (envelope-from ) for ; Mon, 25 Jan 2021 07:18:51 +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 9AF0194043A for ; Mon, 25 Jan 2021 07:18:50 +0000 (UTC) Received: from localhost ([::1]:43070 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3w9A-0002hy-B8 for larch@yhetil.org; Mon, 25 Jan 2021 02:18:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45376) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3w8i-0002gZ-3Y for help-guix@gnu.org; Mon, 25 Jan 2021 02:18:20 -0500 Received: from smtp-out-3.mxes.net ([2605:d100:2f:10::314]:19053) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3w8f-0002oj-UU for help-guix@gnu.org; Mon, 25 Jan 2021 02:18:19 -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 AD8737596A; Mon, 25 Jan 2021 02:18:05 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mxes.net; s=mta; t=1611559087; bh=sPFyRjmfKVl6/wTqkjeXX7m8ohHLp0jS6+m+IP8knBo=; h=From:To:Subject:In-Reply-To:References:Date:From; b=dp6/nKI1EfB1nx/3oEwQriHPDXhKyE6BqRIscyhpDEHY24YV5E+/SW1g2S8uOzzRD EhKgKwrTKxNXylBqS/65ncbL5owRgBrCFYWXfC1+Y262ADZ24znShhw3wtJUFi/H6g iyHPj4Sc5Dyvr2YV342XYUPuxKbCoEq/h4oC0uiY= From: Timmy Douglas To: Helio Machado <0x2b3bfa0@gmail.com>, Leo Famulari , help-guix@gnu.org, Katherine Cox-Buday , Helio Machado <0x2b3bfa0@gmail.com> Subject: Re: packaging a golang package In-Reply-To: References: <87h7nrud2a.fsf@timmydouglas.com> <4bdbc469-ad45-4739-b001-739ad3a60adc@www.fastmail.com> <87a6thtyvm.fsf@timmydouglas.com> <87bldw0ztb.fsf@timmydouglas.com> Date: Sun, 24 Jan 2021 23:18:02 -0800 Message-ID: <87wnw14h91.fsf@timmydouglas.com> MIME-Version: 1.0 Content-Type: text/plain X-Sent-To: Received-SPF: none client-ip=2605:d100:2f:10::314; envelope-from=mail+G4=c985322b@timmydouglas.com; helo=smtp-out-3.mxes.net 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, 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: -1.05 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=mxes.net header.s=mta header.b="dp6/nKI1"; 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: 9AF0194043A X-Spam-Score: -1.05 X-Migadu-Scanner: scn1.migadu.com X-TUID: McGO/ummLj4z Helio Machado <0x2b3bfa0@gmail.com> writes: > So it seems. I'll debug it as soon as I can; the import process is > unbearably long. let me know what you find out--i can give it another try when you're ready. >> 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. > > Guix seems to have a strong opinion about dependency vendoring, but it's > technically viable as long as you don't produce architecture-specific > artifacts when packaging. See https://issues.guix.info/43872 for more > information about the pitfalls I encountered while packaging go-ethereum > the fast way. I tried the go mod vendor approach on a fork I made and it was fairly straightforward: 1. Update module name in go.mod 2. Run `go mod vendor` 3. Fix .gitignore to make git adding vendor/ easier the downside is that the package is tied to my personal git. I think merging updates wouldn't be too hard and I like how it doesn't pollute the package repo with a bunch of dependencies (cat vendor/modules.txt|wc -l --> 697), but I'm not sure it'd pass the bar to be accepted into guix. But it's probably good enough for me to use personally. $ cat ~/.config/guix-packages/coredns.scm (define-module (coredns) #:use-module (guix packages) #:use-module (guix git-download) #:use-module (guix build-system go) #:use-module ((guix licenses) #:prefix license:)) (define-public coredns (let ((commit "78de01a9cddf140c04ec3c4095195177d21cacff") (revision "0")) (package (name "coredns") (version (git-version "1.8.1" revision commit)) (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/timmydo/coredns") (commit commit))) (file-name (git-file-name name version)) (sha256 (base32 "02gdj866mz17p1f0fgfjpbb9cah2ykziacahpkw0viq1vj231hai")))) (build-system go-build-system) (arguments '(#:import-path "github.com/timmydo/coredns")) (synopsis "DNS server/forwarder, written in Go, that chains plugins") (description "CoreDNS is a fast and flexible DNS server. The key word here is flexible: with CoreDNS you are able to do what you want with your DNS data by utilizing plugins. If some functionality is not provided out of the box you can add it by writing a plugin.") (home-page "https://github.com/coredns/coredns") (license license:asl2.0)))) coredns