From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 4FRMFd5H4WCrZgAAgWs5BA (envelope-from ) for ; Sun, 04 Jul 2021 07:32:14 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 2Gz/EN5H4WAAVgAA1q6Kng (envelope-from ) for ; Sun, 04 Jul 2021 05:32:14 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 83A6223A63 for ; Sun, 4 Jul 2021 07:32:13 +0200 (CEST) Received: from localhost ([::1]:44860 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lzujk-0001aW-Ax for larch@yhetil.org; Sun, 04 Jul 2021 01:32:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44388) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lzuja-0001aN-VT for bug-guix@gnu.org; Sun, 04 Jul 2021 01:32:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56999) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lzuja-0005RD-Jx for bug-guix@gnu.org; Sun, 04 Jul 2021 01:32:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lzuja-0004KG-Fd for bug-guix@gnu.org; Sun, 04 Jul 2021 01:32:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#39400: Go retains a reference to GCC In-Reply-To: <87v9oo391q.fsf@gnu.org> Resent-From: Sarah Morgensen Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 04 Jul 2021 05:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39400 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Tobias Geerinckx-Rice , 39400@debbugs.gnu.org Received: via spool by 39400-submit@debbugs.gnu.org id=B39400.162537666816555 (code B ref 39400); Sun, 04 Jul 2021 05:32:02 +0000 Received: (at 39400) by debbugs.gnu.org; 4 Jul 2021 05:31:08 +0000 Received: from localhost ([127.0.0.1]:40312 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzuih-0004Iw-TK for submit@debbugs.gnu.org; Sun, 04 Jul 2021 01:31:08 -0400 Received: from out2.migadu.com ([188.165.223.204]:11194) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzuic-0004IS-EZ for 39400@debbugs.gnu.org; Sun, 04 Jul 2021 01:31:06 -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=1625376660; 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: content-transfer-encoding:content-transfer-encoding: references:references; bh=zoAuErC406/brLZNmd1bb38h/rCNcuXWqDzO0kMd+1w=; b=OuFA2qpJo7l33cgIWOCNvnVNxZcDHvSnFGdKvnCZL06GlU5bEWPcQMyG6MhPyScX4Dkgah UyWAWYRUvRUAMlMiyL9KZBnFDaSFAROze7LgI2vYg/elEHbjX+9uXjTFfrxTnL/L+liiym PzjF6XFk2kg06ydmTGOaWaSa+G4phNY= References: <87v9oo391q.fsf@gnu.org> Date: Sat, 03 Jul 2021 22:30:57 -0700 Message-ID: <86k0m6abn2.fsf@mgsn.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Auth-User: iskarian@mgsn.dev X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" Reply-to: Sarah Morgensen From: Sarah Morgensen via Bug reports for GNU Guix X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1625376733; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=zoAuErC406/brLZNmd1bb38h/rCNcuXWqDzO0kMd+1w=; b=na1oP+6qqZYHkYDzPBXpTpMtbxJBkzUx0r/Hqbxf5yO/Nbse77hcXQFnZmYdimwT1pnyGU 4ztQi+N9WzF6BqyOOSQezxv/z4dGOZhY0wM3CI805wG+BzID70Bp87xeA8nufrASwLbSjG cC5Bw3cuZht5kGHohSAjdLhSdYA76WgOQbqYyh8iH94J3rniGIjZTGYmaipwNnt60uztjF 3AMc8V6bYokbDf/EcIlfXf51jyXEPhldSkHhYUSDgCH4kiWBZapyH4C8XLlCENicqsbM7M zoyhe03ba3gn/yVaqjf5JGXcjgx6ICkyuCohK8A4W9j3gecRzCpdyeaC0srGVA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1625376733; a=rsa-sha256; cv=none; b=CD3KlBLuVO7/It2sfW9xvC/5nEBUvlcnigvc2a7vtiV7uXaFPW9WXtdHxxF5Xecft+oaBn lgqLEd52/ZTdAwy54OCeups23hihrZwIZwOeQSpXZqCRbY0wzmquwVQMSnQ+Lc8zDKSTw2 2iPQN7Pst4Ml794I4IIdBw751IvUPe2OB/BF9MxbxEERs6cE51FFqLbGfEQfTHFx0G1Q1N DLwmGTewRt/EeJ3JIRv0THtoYpRZHaw36asyLIrvX8wsiBhayjJzNGl8ouv3IDhCca5CaF i7QrBrQZLpK/L72ocQwqE8T6dChcCmyF1wZegO4Gc4euvzsBF9Dz5MtOKJd31A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mgsn.dev header.s=key1 header.b=OuFA2qpJ; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: -2.92 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mgsn.dev header.s=key1 header.b=OuFA2qpJ; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 83A6223A63 X-Spam-Score: -2.92 X-Migadu-Scanner: scn0.migadu.com X-TUID: 9PIEgBtoKhc2 Hello all, (I have CC'd Tobias since we briefly discussed this on #guix recently.) Ludovic Court=C3=A8s writes: > Hello! > > It seems that Go unduly retains a reference to GCC: > > $ guix size go > store item total = self > /gnu/store/g4rrz9rnr8ssbnj3gx3dmsxv4glll8nf-go-1.12.15 646.3 = 355.9 55.1% > /gnu/store/x3jx25cd3q363mr7nbgzrhrv1vza6cf7-gcc-7.4.0 177.4 = 107.2 16.6% > [...] This is still the case: $ guix size go store item total s= elf /gnu/store/vvly7zgn981brb37v8y8a7f9psx7c6ay-go-1.16.5 570.0 = 371.5 65.2% /gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0 178.5 = 107.3 18.8% /gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31 38.4 = 36.7 6.4% /gnu/store/01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib 71.0 = 32.6 5.7% /gnu/store/57xj5gcy1jbl9ai2lnrqnpr0dald9i65-coreutils-8.32 88.0 = 17.0 3.0% /gnu/store/kl68v5mclwp511xgpsl2h1s9gmsdxpzh-tzdata-2021a 1.9 = 1.9 0.3% /gnu/store/mmhimfwmmidf09jw1plw3aw1g1zn2nkh-bash-static-5.0.16 1.6 = 1.6 0.3% /gnu/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.16 39.4 = 1.0 0.2% /gnu/store/g2s5jfkfd4k973wb58476b1bbv9zpm6m-zlib-1.2.11 38.6 = 0.2 0.0% /gnu/store/zfbbn61ij7w0bl4wbrwi87x5ghqx968c-net-base-5.3 0.0 = 0.0 0.0% total: 570.0 MiB But... is the "baking-in" of (a particular version of) GCC a bad thing? I am not sure either way. Go invokes gcc when compiling with cgo, and cgo (or at least the usage of standard libraries which use cgo) is getting fairly common. If we do not provide a default gcc with Go, a plain "go build" will produce an error if it encounters something which uses cgo and it can't find gcc: $ go build # runtime/cgo cgo: exec gcc: exec: "gcc": executable file not found in $PATH The user would then have to either install a gcc-toolchain, or figure out that they must set CGO_ENABLED=3D0. From this perspective, it is more convenient to have GCC baked-in for the average user, who likely has no reason to want a different CC anyway. On the other hand, currently GCC is baked-in to Go in two ways: * CC is set to /gnu/store/...-gcc-7.5.0/bin/gcc * Go is patched so that it adds /gnu/store/...-gcc-7.5.0-lib/lib as a runpath when linking with cgo files This means that even if the user provides a different CC, the gcc-7.5.0-lib dir will also be in the runpath. I do not know if, or how much, this would conflict with other gcc-lib runpaths. I have experimented with a couple ways of removing the gcc-7.5.0 reference: 1. Simply set CC=3Dgcc. This works to remove gcc-7.5.0 from references, but we still get a gcc-7.5.0-lib runpath. We can't remove this runpath completely, as anything using cgo-enabled parts of the standard library require it, and Go does not save the library location anywhere. 2. Make Go require external linking for anything using cgo, which would remove the need to patch internal linking at all. Some platforms do not support internally linking cgo at all, so Go should have no trouble handling this. It does break some tests which expect to be able to internally link, but I have not yet found any actual packages it breaks. My instinct says that removing the reference, and doing so via #2, is the way to go, but I am just a newcomer to Guix. WDYT? -- Sarah