From patchwork Fri Aug 27 15:10:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marius Bakke X-Patchwork-Id: 286 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 4043327BBE3; Fri, 27 Aug 2021 16:14:16 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 041FD27BBE1 for ; Fri, 27 Aug 2021 16:14:16 +0100 (BST) Received: from localhost ([::1]:38104 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJdYc-0006ga-Uy for patchwork@mira.cbaines.net; Fri, 27 Aug 2021 11:14:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54838) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJdWU-0005FP-EL for guix-patches@gnu.org; Fri, 27 Aug 2021 11:12:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:41148) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJdWT-0006hh-TS for guix-patches@gnu.org; Fri, 27 Aug 2021 11:12:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mJdWT-000709-N7 for guix-patches@gnu.org; Fri, 27 Aug 2021 11:12:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50227] [PATCH 0/3] go-build-system and GOPATH improvements Resent-From: Marius Bakke Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 27 Aug 2021 15:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50227 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50227@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.163007706226828 (code B ref -1); Fri, 27 Aug 2021 15:12:01 +0000 Received: (at submit) by debbugs.gnu.org; 27 Aug 2021 15:11:02 +0000 Received: from localhost ([127.0.0.1]:52694 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJdVW-0006yZ-5O for submit@debbugs.gnu.org; Fri, 27 Aug 2021 11:11:02 -0400 Received: from lists.gnu.org ([209.51.188.17]:38654) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJdVS-0006yL-8m for submit@debbugs.gnu.org; Fri, 27 Aug 2021 11:11:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54732) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJdVS-0004af-2i for guix-patches@gnu.org; Fri, 27 Aug 2021 11:10:58 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50652) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJdVR-00065I-DU for guix-patches@gnu.org; Fri, 27 Aug 2021 11:10:57 -0400 Received: from host-37-191-231-185.lynet.no ([37.191.231.185]:38000 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJdVO-0001fb-Tn for guix-patches@gnu.org; Fri, 27 Aug 2021 11:10:57 -0400 From: Marius Bakke Date: Fri, 27 Aug 2021 17:10:52 +0200 Message-Id: <20210827151052.12611-1-marius@gnu.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 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" X-getmail-retrieved-from-mailbox: Patches These patches adjust the Go build system to use Guix's regular native-search-paths mechanism instead of ad-hoc GOPATH trickery. The context is that I needed to hack on a Go package, and was somewhat surprised that my usual workflow of "guix environment PKG" did not work. It still does not work "out of the box", but these patches bring it a step further. Now "all" that is needed is to: $ cd ~/src/go-foo $ guix environment go-example-com-foo $ MYGOPATH="$HOME/tmp/go" $ NAMESPACE="$MYGOPATH/src/example.com/foo" $ mkdir -p $(dirname $NAMESPACE) $ ln -s $PWD $NAMESPACE # or git worktree add $NAMESPACE $ export GOPATH="$MYGOPATH:$GOPATH" $ go build # no 'go get' necessary! I don't know how feasible it is to avoid making a local directory and symlinking the project to the expected namespace. Still a complete Go newbie, but this approach feels more natural and idiomatic Guix-wise. Marius Bakke (3): build-system/go: Use a native-search-path for GOPATH. gnu: hyperledger-fabric: Do not assume GOPATH contains a single entry. gnu: go-gotest-tools-assert: Provide internal inputs with the source. gnu/packages/golang.scm | 49 +++++++++++++++++++++++----------- gnu/packages/hyperledger.scm | 6 ++++- guix/build/go-build-system.scm | 37 +++---------------------- 3 files changed, 43 insertions(+), 49 deletions(-)