all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Peter Mikkelsen <petermikkelsen10@gmail.com>
To: help-guix <help-guix@gnu.org>
Subject: Developing golang programs on guix
Date: Mon, 29 Jan 2018 10:50:10 +0100	[thread overview]
Message-ID: <CADh9keUd2=WuQoY55rYKUFtkbpymMP2YxRFDaJ=oifdZCOQcrw@mail.gmail.com> (raw)

Hi guix,

Lately I have been playing around with go after a long time with no
use, but last time I was on fedora I think.
Now that I am on guixSD, I have found that the standard go way of
doing things is not working as expected.

For example, after setting the environment variable GOPATH to
/home/peter/go, and creating a small hello world program in there, I
would normally be able to run 'go install' in that folder, and the
hello world binary would end up in my gopath. But on guixSD this is
not the case, since it seems like 'go install' is trying to compile
every single library provided by to go package itself, and that means
writing to the store, which is not possible.

For example, the output of 'go install -x' in my hello world project
gives me this output:

WORK=/tmp/go-build858282353
mkdir -p $WORK/runtime/internal/sys/_obj/
mkdir -p $WORK/runtime/internal/
cd /gnu/store/fgwh2q36s5rqyxdbs2sl6ybpyxbv5y14-go-1.9.3/src/runtime/internal/sys
/gnu/store/fgwh2q36s5rqyxdbs2sl6ybpyxbv5y14-go-1.9.3/pkg/tool/linux_amd64/compile
-o $WORK/runtime/internal/sys.a -trimpath $WORK -goversion go1.9.3 -p
runtime/internal/sys -std -+ -complete -buildid
817fb51b0d31bc187077c53e22d9b0fe9df62e9d -D
_/gnu/store/fgwh2q36s5rqyxdbs2sl6ybpyxbv5y14-go-1.9.3/src/runtime/internal/sys
-I $WORK -pack ./arch.go ./arch_amd64.go ./intrinsics.go ./stubs.go
./sys.go ./zgoarch_amd64.go ./zgoos_linux.go ./zversion.go
mkdir -p /gnu/store/fgwh2q36s5rqyxdbs2sl6ybpyxbv5y14-go-1.9.3/pkg/linux_amd64/runtime/internal/
cp $WORK/runtime/internal/sys.a
/gnu/store/fgwh2q36s5rqyxdbs2sl6ybpyxbv5y14-go-1.9.3/pkg/linux_amd64/runtime/internal/sys.a
go install runtime/internal/sys: open
/gnu/store/fgwh2q36s5rqyxdbs2sl6ybpyxbv5y14-go-1.9.3/pkg/linux_amd64/runtime/internal/sys.a:
read-only file system

so to me it looks like it wants to compile stuff in the store, but why
is that? shouldn't it be compiled by default?

So my question is: Is there a way to prevent 'go install' compiling
things in the store, maybe by pre-compiling during installation of the
go package? Or is there another preferred way to develop go
applications on guix, since what i do now is 'go build', but that gets
really slow with larger projects, at it recompiles everything
everytime if i understand it right.

Cheers,
Peter Mikkelsen

             reply	other threads:[~2018-01-29  9:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-29  9:50 Peter Mikkelsen [this message]
2018-01-29 21:39 ` bug#30287: Go compiler tries writing to the store Leo Famulari
2021-07-03 22:35   ` Sarah Morgensen via Bug reports for GNU Guix
2021-07-25  0:17     ` 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='CADh9keUd2=WuQoY55rYKUFtkbpymMP2YxRFDaJ=oifdZCOQcrw@mail.gmail.com' \
    --to=petermikkelsen10@gmail.com \
    --cc=help-guix@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.