From unknown Tue Aug 19 10:01:25 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#30287 <30287@debbugs.gnu.org> To: bug#30287 <30287@debbugs.gnu.org> Subject: Status: Go compiler tries writing to the store Reply-To: bug#30287 <30287@debbugs.gnu.org> Date: Tue, 19 Aug 2025 17:01:25 +0000 retitle 30287 Go compiler tries writing to the store reassign 30287 guix submitter 30287 Leo Famulari severity 30287 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 29 16:39:20 2018 Received: (at submit) by debbugs.gnu.org; 29 Jan 2018 21:39:20 +0000 Received: from localhost ([127.0.0.1]:48270 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egH96-000809-CP for submit@debbugs.gnu.org; Mon, 29 Jan 2018 16:39:20 -0500 Received: from eggs.gnu.org ([208.118.235.92]:33865) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egH94-0007zv-B3 for submit@debbugs.gnu.org; Mon, 29 Jan 2018 16:39:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1egH8y-0002nf-0L for submit@debbugs.gnu.org; Mon, 29 Jan 2018 16:39:12 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:44839) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1egH8x-0002nW-Sg for submit@debbugs.gnu.org; Mon, 29 Jan 2018 16:39:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53067) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egH8w-0001RJ-M5 for bug-guix@gnu.org; Mon, 29 Jan 2018 16:39:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1egH8t-0002mX-Hb for bug-guix@gnu.org; Mon, 29 Jan 2018 16:39:10 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:41169) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1egH8t-0002mP-CU for bug-guix@gnu.org; Mon, 29 Jan 2018 16:39:07 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id C6E892111D; Mon, 29 Jan 2018 16:39:06 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Mon, 29 Jan 2018 16:39:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=famulari.name; h=cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= mesmtp; bh=xAhey1Z2cAVhLScXJxnlUistCiZuUoImPEpU5aTgi5g=; b=qAHvI mxO3QJ2huFLogB6F1OhuPvZG3xg/kTL+yu0HGWDk7CpFuo9G93OMFybo7j6KE7YJ C7XIv3FF2KalOSmMGR3Rouw3JdVpVmHyLb5SuqEv1KHgoEi58I4ekzSllF4UoSbi KbvQSKoLMup+ZiTUiywMuHYBrkSmq4o+NEWBk0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=xAhey1Z2cAVhLScXJxnlUistCiZuU oImPEpU5aTgi5g=; b=MhgawiRp7GL4JrrYXGl0BbxnDqusPwhKG5t3XiioaDGmp Mze2xeNjnRsG/IUedmcqlV1gecK2tcTofRDvnK561BM2NL9TgTuT32btOygwu3ch JW4S2mROXA7B2TAq45KMDvJAzFNbgGccDzEpnG75eRMYLs3Cpv9UcGfGaLvA9uSh UIR4mkyVsFyEVJiHmK12u1po68Hqcqrhz6lW6HVoi+bdjao5f+M9hGTgQ3Zn/xqD vqG3Lf4eHQsksdnFwtG2TDMy/JM42Q0vikXLSp/ikz5S4Y5djUQChSa3x4CuBthp S/fl2cgWT7iwnth1DIScTwWnIjo/iF98gxqrIbGOA== X-ME-Sender: Received: from localhost (c-76-124-202-137.hsd1.pa.comcast.net [76.124.202.137]) by mail.messagingengine.com (Postfix) with ESMTPA id 7B7F7240B6; Mon, 29 Jan 2018 16:39:06 -0500 (EST) Date: Mon, 29 Jan 2018 16:39:05 -0500 From: Leo Famulari To: Peter Mikkelsen Subject: Go compiler tries writing to the store Message-ID: <20180129213905.GB8542@jasmine.lan> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="gatW/ieO32f1wygP" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit Cc: bug-guix@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) --gatW/ieO32f1wygP Content-Type: text/plain; charset=us-ascii Content-Disposition: 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/ --gatW/ieO32f1wygP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEsFFZSPHn08G5gDigJkb6MLrKfwgFAlpvlHkACgkQJkb6MLrK fwgZ0w/+JAo3Hfy3D+VKjXYcg896DSk5suh0Tezp7hznMdTq64yeMlDiY2B9W4kR ooBa4R5AOB08f80+zsXT2755IaSgRnPhVhlMQk3XECUGN4Gq93QHd6mDnfVQDP38 xV3hk1AEi7wblWwvvB4z5vPMPFH2MVPG5RCs8Y4Jl1myB1Mz7IHV6V5JEk4pEmaP 43hXUgUlLwiK6HNRbPw33TCjM9RLenE6hEeDxwJ49zwTHFI5pjPjCo/EI1af8iiz 2ZwVmLjPYgUm3rk4B4lywEDQAXoVkuElZ0TmY9LEnKqEaVSBJ/LCnj5ztYYmu0Ja QeJMe6hqlADHcLXxVPVJfOIvMpdeeIBw8vYa1vlxvLYyLE1nzk2UubjLXU6QO6U7 HY4lNLblluVnJrsAm9P3nuK4K0myc6VkWQk5YAOoi/0cpt+Fp4nLWn9dDSwaLAv3 1fvsW6oDEknFGiupQn9w2wj9DOTNuj4Dhkuit5qKWfYH8JYq6MpwmsjBImEPERIG pdNRCKz0HJAncs12eju2oz/ihIM3NAXdLdvRR5ELHbQk4OHOZwUgTWtc+DN1pVDC /MJWfFZVr706tqdfJGXYT1npmOEd6g4Bo6XA21mOa2KszDW49A8vL/BK5ngyoHQJ vytjUn7dPD8Mh67f/W+baXJx4MjkyqT/V8gGrMC1ebj219/EbWc= =ZVLo -----END PGP SIGNATURE----- --gatW/ieO32f1wygP-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 03 18:35:46 2021 Received: (at 30287) by debbugs.gnu.org; 3 Jul 2021 22:35:46 +0000 Received: from localhost ([127.0.0.1]:40045 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzoEk-0000R2-9a for submit@debbugs.gnu.org; Sat, 03 Jul 2021 18:35:46 -0400 Received: from out0.migadu.com ([94.23.1.103]:51232) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzoEi-0000Qs-6g for 30287@debbugs.gnu.org; Sat, 03 Jul 2021 18:35:45 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1; t=1625351742; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=7ffEahWy8whjc2zCfLIQuJOwo9lrnSWBxBYYKcqx7AA=; b=WqKcnh20xGmk+FrTlDBlccpMEU3UgVeKzZkC28obOSr+UNHomtQHwVbFZHJ110RvXTFqS3 EzqywximmRVlxIv30vWG4FoZ77CY34E1EEsCn9i3p2T+B5eZBuiLicCkesGGVvHYank0iU wzIoWYPzWxoTI8WHqI/vQ6xbG5sKCbQ= From: Sarah Morgensen To: Leo Famulari Subject: Re: bug#30287: Go compiler tries writing to the store In-Reply-To: <20180129213905.GB8542@jasmine.lan> (Leo Famulari's message of "Mon, 29 Jan 2018 16:39:05 -0500") References: <20180129213905.GB8542@jasmine.lan> Date: Sat, 03 Jul 2021 15:35:38 -0700 Message-ID: <86mtr3koud.fsf@mgsn.dev> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: iskarian@mgsn.dev X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 30287 Cc: 30287@debbugs.gnu.org, Peter Mikkelsen X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello, Looking through old Go bugs I found this. Is this still an issue for anyone? I just tested with go@1.14 and go@1.16 and I got expected behavior (binary was installed in ~/go/bin, since ~/go is the default GOPATH). Leo Famulari 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 From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 24 20:17:47 2021 Received: (at 30287-done) by debbugs.gnu.org; 25 Jul 2021 00:17:47 +0000 Received: from localhost ([127.0.0.1]:47221 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m7Rpy-0002q7-V2 for submit@debbugs.gnu.org; Sat, 24 Jul 2021 20:17:47 -0400 Received: from out0.migadu.com ([94.23.1.103]:33515) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m7Rpv-0002pw-Ae for 30287-done@debbugs.gnu.org; Sat, 24 Jul 2021 20:17:45 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1; t=1627172261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=oZX2a8WXGqg+54O3JiIJForZNr4CZy7hbxO3At0W2gQ=; b=hb9sUHkYVXprUKfxJxKi4Pzuj/oAQheD2tR2PQ8pVzxSfMlH+Q3oBQKfVIknyvbDjNk8wJ tjgT6jllDKlA9TintfnukQl+0aGVTFWsE9E4kFR1Rt3vN277lE8Sxai02bIFruEM/yoa6B gTlMGwQPZqOYglmJDfzZzb1RxiQbKR8= From: Sarah Morgensen To: Leo Famulari Subject: Re: bug#30287: Go compiler tries writing to the store References: <20180129213905.GB8542@jasmine.lan> <86mtr3koud.fsf@mgsn.dev> Date: Sat, 24 Jul 2021 17:17:38 -0700 In-Reply-To: <86mtr3koud.fsf@mgsn.dev> (Sarah Morgensen's message of "Sat, 03 Jul 2021 15:35:38 -0700") Message-ID: <86mtqbp7q5.fsf@mgsn.dev> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: iskarian@mgsn.dev X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 30287-done Cc: 30287-done@debbugs.gnu.org, Peter Mikkelsen X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Closing this as it seems this is no longer an issue with the go versions currently packaged. Sarah Morgensen writes: > Hello, > > Looking through old Go bugs I found this. Is this still an issue for > anyone? I just tested with go@1.14 and go@1.16 and I got expected > behavior (binary was installed in ~/go/bin, since ~/go is the default > GOPATH). > > Leo Famulari 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 From unknown Tue Aug 19 10:01:25 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 22 Aug 2021 11:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator