GNU bug report logs - #30287
Go compiler tries writing to the store

Previous Next

Package: guix;

Reported by: Leo Famulari <leo <at> famulari.name>

Date: Mon, 29 Jan 2018 21:40:02 UTC

Severity: normal

Done: Sarah Morgensen <iskarian <at> mgsn.dev>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 30287 in the body.
You can then email your comments to 30287 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#30287; Package guix. (Mon, 29 Jan 2018 21:40:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Leo Famulari <leo <at> famulari.name>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Mon, 29 Jan 2018 21:40:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: Peter Mikkelsen <petermikkelsen10 <at> gmail.com>
Cc: bug-guix <at> gnu.org
Subject: Go compiler tries writing to the store
Date: Mon, 29 Jan 2018 16:39:05 -0500
[Message part 1 (text/plain, inline)]
On Mon, Jan 29, 2018 at 10:50:10AM +0100, Peter Mikkelsen wrote:
> Hi guix,

Hi, thanks for this report! I saw your brief conversation on #guix with
civodul. Unfortunately I've only been paying attention to packaging Go
software with Guix, so I didn't notice this issue.

> 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.

This is definitely a problem that we need to fix. However, I'm not sure
where to start...

I'll try debugging by checking if this works on Nix, and seeing what
they do differently.

> 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.

The compiler should never try to write to the store; something is wrong
with how we build it.

Changing the subject slightly, yes, `go build` always recompiles some
things:

In general, for Go libraries (they call them "packages"), `go build`
always discards the compiled objects. You have to use `go install` to
retain them and achieve a caching speedup.

For Go executable programs (called "commands"), `go build` does keep the
compiled executable.

To quote the docs [0]:

"Build compiles the packages named by the import paths, along with their
dependencies, but it does not install the results. [...] When compiling
multiple packages or a single non-main package, build compiles the
packages but discards the resulting object, serving only as a check that
the packages can be built."

https://golang.org/cmd/go/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#30287; Package guix. (Sat, 03 Jul 2021 22:36:03 GMT) Full text and rfc822 format available.

Message #8 received at 30287 <at> debbugs.gnu.org (full text, mbox):

From: Sarah Morgensen <iskarian <at> mgsn.dev>
To: Leo Famulari <leo <at> famulari.name>
Cc: 30287 <at> debbugs.gnu.org, Peter Mikkelsen <petermikkelsen10 <at> gmail.com>
Subject: Re: bug#30287: Go compiler tries writing to the store
Date: Sat, 03 Jul 2021 15:35:38 -0700
Hello,

Looking through old Go bugs I found this. Is this still an issue for
anyone? I just tested with go <at> 1.14 and go <at> 1.16 and I got expected
behavior (binary was installed in ~/go/bin, since ~/go is the default
GOPATH).

Leo Famulari <leo <at> famulari.name> writes:

> On Mon, Jan 29, 2018 at 10:50:10AM +0100, Peter Mikkelsen wrote:
>> Hi guix,
>
> Hi, thanks for this report! I saw your brief conversation on #guix with
> civodul. Unfortunately I've only been paying attention to packaging Go
> software with Guix, so I didn't notice this issue.
>
>> 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.

--
Sarah




Reply sent to Sarah Morgensen <iskarian <at> mgsn.dev>:
You have taken responsibility. (Sun, 25 Jul 2021 00:18:02 GMT) Full text and rfc822 format available.

Notification sent to Leo Famulari <leo <at> famulari.name>:
bug acknowledged by developer. (Sun, 25 Jul 2021 00:18:02 GMT) Full text and rfc822 format available.

Message #13 received at 30287-done <at> debbugs.gnu.org (full text, mbox):

From: Sarah Morgensen <iskarian <at> mgsn.dev>
To: Leo Famulari <leo <at> famulari.name>
Cc: 30287-done <at> debbugs.gnu.org, Peter Mikkelsen <petermikkelsen10 <at> gmail.com>
Subject: Re: bug#30287: Go compiler tries writing to the store
Date: Sat, 24 Jul 2021 17:17:38 -0700
Closing this as it seems this is no longer an issue with the go versions
currently packaged.

Sarah Morgensen <iskarian <at> mgsn.dev> writes:

> Hello,
>
> Looking through old Go bugs I found this. Is this still an issue for
> anyone? I just tested with go <at> 1.14 and go <at> 1.16 and I got expected
> behavior (binary was installed in ~/go/bin, since ~/go is the default
> GOPATH).
>
> Leo Famulari <leo <at> famulari.name> writes:
>
>> On Mon, Jan 29, 2018 at 10:50:10AM +0100, Peter Mikkelsen wrote:
>>> Hi guix,
>>
>> Hi, thanks for this report! I saw your brief conversation on #guix with
>> civodul. Unfortunately I've only been paying attention to packaging Go
>> software with Guix, so I didn't notice this issue.
>>
>>> 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.
>
> --
> Sarah




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 22 Aug 2021 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 326 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.