From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id LUP0CBZGdF9zWgAA0tVLHw (envelope-from ) for ; Wed, 30 Sep 2020 08:47:18 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id UBFZBBZGdF9WZgAA1q6Kng (envelope-from ) for ; Wed, 30 Sep 2020 08:47:18 +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 91C99940394 for ; Wed, 30 Sep 2020 08:47:17 +0000 (UTC) Received: from localhost ([::1]:36070 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kNXlc-0005kB-Jz for larch@yhetil.org; Wed, 30 Sep 2020 04:47:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53442) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kNXlP-0005jD-4t for guix-patches@gnu.org; Wed, 30 Sep 2020 04:47:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46550) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kNXlO-0008Kb-Ia for guix-patches@gnu.org; Wed, 30 Sep 2020 04:47:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kNXlO-0005Ie-Hf for guix-patches@gnu.org; Wed, 30 Sep 2020 04:47:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43679] [PATCH 0/5] Add '--with-toolchain' package transformation option Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 30 Sep 2020 08:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43679 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: zimoun Cc: 43679@debbugs.gnu.org Received: via spool by 43679-submit@debbugs.gnu.org id=B43679.160145560120345 (code B ref 43679); Wed, 30 Sep 2020 08:47:02 +0000 Received: (at 43679) by debbugs.gnu.org; 30 Sep 2020 08:46:41 +0000 Received: from localhost ([127.0.0.1]:58096 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNXl3-0005I5-4k for submit@debbugs.gnu.org; Wed, 30 Sep 2020 04:46:41 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:48304) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNXl0-0005Hq-UI for 43679@debbugs.gnu.org; Wed, 30 Sep 2020 04:46:39 -0400 X-IronPort-AV: E=Sophos;i="5.77,321,1596492000"; d="scan'208";a="470204157" Received: from 91-160-117-201.subs.proxad.net (HELO ribbon) ([91.160.117.201]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Sep 2020 10:46:30 +0200 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20200928195305.30096-1-ludo@gnu.org> <865z7wuajc.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 9 =?UTF-8?Q?Vend=C3=A9miaire?= an 229 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Wed, 30 Sep 2020 10:46:29 +0200 In-Reply-To: <865z7wuajc.fsf@gmail.com> (zimoun's message of "Tue, 29 Sep 2020 12:44:55 +0200") Message-ID: <871rij4pp6.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -6.0 (------) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: -1.01 X-TUID: /ZD4HRIFqIcB Hi, zimoun skribis: > On Mon, 28 Sep 2020 at 21:53, Ludovic Court=C3=A8s wrote: >> From: Ludovic Court=C3=A8s > >> One thing I wasn=E2=80=99t entirely sure about: =E2=80=98--with-toolchai= n=E2=80=99 changes >> the toolchain of the specified package, not that of its dependents. >> This assumes that the toolchains all follow the same ABI. This is >> the case for C, apparently, maybe not for C++. Should it instead >> change to toolchain of the package=E2=80=99s dependents as well? >> >> Something like: >> >> guix build guile --with-toolchain=3Dguile@3.0.4=3Dclang-toolchain=20 >> >> generates working code. [...] > However, =E2=80=99=E2=80=93with-toolchain=E2=80=99 can be misleading sinc= e it is > =E2=80=99gnu-build-system=E2=80=99 and C/C++ software specific. I mean, = the patch #4 > adding =E2=80=99build-system-with-toolchain=E2=80=99 contains: > > + (define toolchain-packages > + ;; These are the GNU toolchain packages pulled in by GNU-BUILD-SYSTE= M and > + ;; all the build systems that inherit from it. Keep the list in syn= c with > + ;; 'standard-packages' in (guix build-system gnu). > + '("gcc" "binutils" "libc" "libc:static" "ld-wrapper")) > + > + (define (lower* . args) > + (let ((lowered (apply lower args))) > + (bag > + (inherit lowered) > + (build-inputs > + (append (fold alist-delete > + (bag-build-inputs lowered) > + toolchain-packages) > + toolchain))))) Yeah this option is meant for C/C++ as I wrote above and (I think) in the documentation. > Another example a bit out-of-scope is to rebuild all the Emacs stack > using the package =E2=80=99emacs-next=E2=80=99 instead of =E2=80=99emacs= =E2=80=99. The > =E2=80=99emacs-build-system=E2=80=99 depends on =E2=80=99emacs-minimal=E2= =80=99 but some packages (see > =E2=80=99emacs-magit=E2=80=99) rewrite that using instead =E2=80=99emacs-= no-x=E2=80=99. It could be > nice to be able to write: > > guix build -m manifest.m --with-toolchain=3Demacs-next-toolchain Here you=E2=80=99d use =E2=80=98--with-input=E2=80=99, though package trans= formation options have no effect when using a manifest. > In summary, does it make sense, either: > > - change the =E2=80=99=E2=80=93with-toolchain=E2=80=99 to =E2=80=99=E2= =80=93with-gcc-toolchain=E2=80=99 =E2=80=98--with-gcc-toolchain=3Dclang-toolchain=E2=80=99 would look strange= . :-) > - tweak =E2=80=99build-system-with-toolchain=E2=80=99 to pass =E2=80=99= toolchain-packages=E2=80=99 as > parameter somehow and be able to run: >=20=20=20 > guix build coq --with-toolchain=3Dcoq=3Docaml-toolchain4.07 Can=E2=80=99t you use =E2=80=98--with-input=3DocamlX.Y=3DocamlA.B=E2=80=99 = in this case? If not, we could devise a separate option rather than overload this one. >> Another issue is that since we use =E2=80=98package-input-rewriting/spec= =E2=80=99, >> we can=E2=80=99t change the toolchain of core packages like Guile or Perl >> without rebuilding the world. For example, if we omit =E2=80=9C@3.0.4= =E2=80=9D >> in the example above, we rebuild a =E2=80=9Cguile=E2=80=9D package deep = down and >> everything that follows (aka. =E2=80=9Cthe world=E2=80=9D). > > Yeah but that=E2=80=99s maybe what people want: rebuild the world with an= other > toolchain, probably optimized for some specific machine (HPC cluster). Yes, though it doesn=E2=80=99t necessarily make sense. :-) But yeah, perhaps rebuilding everything above the given package would be more in line with what people expect. >> Another option I considered was to graft the package that >> =E2=80=98--with-toolchain=E2=80=99 targets instead of rebuilding its dep= endents. >> Again that=E2=80=99d only work if the resulting binaries are ABI-compati= ble, >> but maybe that=E2=80=99s a reasonable assumption. It would definitely s= ave >> build time. Should it be grafted, or should there be a separate >> option to do that? Thoughts? > > From my perspective, it should be another option. For example, I > imagine people want to rebuild all the stack with Name-It=C2=A9 compiler.= Or > the Name-It=C2=A9 compiler could be not-ABI compatible. I=E2=80=99m not interested in proprietary compilers if that=E2=80=99s what = you have in mind. Besides, the SysV ABI is defined for C, so normally all C compilers produce ABI-compatible code. There are exceptions such as OpenMP (Clang is moving to their own libomp, I think, whereas GCC has libgomp.) Thanks for your feedback! Ludo=E2=80=99.