all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#50227] [PATCH 0/3] go-build-system and GOPATH improvements
@ 2021-08-27 15:10 Marius Bakke
  2021-08-27 15:13 ` [bug#50227] [PATCH 1/3] build-system/go: Use a native-search-path for GOPATH Marius Bakke
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Marius Bakke @ 2021-08-27 15:10 UTC (permalink / raw)
  To: 50227

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





^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-01-14  3:14 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-27 15:10 [bug#50227] [PATCH 0/3] go-build-system and GOPATH improvements Marius Bakke
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

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.