all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Marius Bakke <marius@gnu.org>
To: 50227@debbugs.gnu.org
Subject: [bug#50227] [PATCH 0/3] go-build-system and GOPATH improvements
Date: Fri, 27 Aug 2021 17:10:52 +0200	[thread overview]
Message-ID: <20210827151052.12611-1-marius@gnu.org> (raw)

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(-)

-- 
2.31.1





             reply	other threads:[~2021-08-27 15:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-27 15:10 Marius Bakke [this message]
2021-08-27 15:13 ` [bug#50227] [PATCH 1/3] build-system/go: Use a native-search-path for GOPATH Marius Bakke
2021-08-27 15:13   ` [bug#50227] [PATCH 2/3] gnu: hyperledger-fabric: Do not assume GOPATH contains a single entry Marius Bakke
2021-08-27 15:13   ` [bug#50227] [PATCH 3/3] gnu: go-gotest-tools-assert: Provide internal inputs with the source Marius Bakke
2021-08-27 16:44 ` [bug#50227] [PATCH] build-system/go: Trim store references using the native compiler option Marius Bakke
2021-08-27 17:47   ` Marius Bakke
2021-08-27 19:38     ` Marius Bakke
2021-08-28  2:16 ` [bug#50227] [PATCH 0/3] go-build-system and GOPATH improvements Sarah Morgensen
2021-08-28 14:52   ` Marius Bakke
2022-01-14  3:13     ` Maxim Cournoyer
2021-08-29  6:17 ` [bug#50227] [PATCH 3/3] gnu: go-gotest-tools-assert: Provide internal inputs with the source Sarah Morgensen
2021-09-03 22:55 ` [bug#50227] [PATCH 0/3] go-build-system and GOPATH improvements Sarah Morgensen

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

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

  git send-email \
    --in-reply-to=20210827151052.12611-1-marius@gnu.org \
    --to=marius@gnu.org \
    --cc=50227@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.