From patchwork Mon Sep 28 19:56:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 24366 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 5A24527BBE9; Mon, 28 Sep 2020 20:58:13 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 020BF27BBE8 for ; Mon, 28 Sep 2020 20:58:13 +0100 (BST) Received: from localhost ([::1]:51100 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMzHo-0003fj-0h for patchwork@mira.cbaines.net; Mon, 28 Sep 2020 15:58:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34274) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMzHe-0003eS-KL for guix-patches@gnu.org; Mon, 28 Sep 2020 15:58:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42551) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kMzHe-0005iy-9G for guix-patches@gnu.org; Mon, 28 Sep 2020 15:58:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kMzHe-0002yk-8R for guix-patches@gnu.org; Mon, 28 Sep 2020 15:58:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43679] [PATCH 1/5] gnu: gcc-toolchain: Add 'GUIX_LOCPATH' to the search paths. References: <20200928195305.30096-1-ludo@gnu.org> In-Reply-To: <20200928195305.30096-1-ludo@gnu.org> Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 28 Sep 2020 19:58: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: 43679@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 43679-submit@debbugs.gnu.org id=B43679.160132302311295 (code B ref 43679); Mon, 28 Sep 2020 19:58:02 +0000 Received: (at 43679) by debbugs.gnu.org; 28 Sep 2020 19:57:03 +0000 Received: from localhost ([127.0.0.1]:54072 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMzGh-0002w6-9V for submit@debbugs.gnu.org; Mon, 28 Sep 2020 15:57:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55274) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMzGe-0002vL-Jw for 43679@debbugs.gnu.org; Mon, 28 Sep 2020 15:57:01 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51183) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMzGZ-0005aC-8v; Mon, 28 Sep 2020 15:56:55 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=43782 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kMzGX-0003Ee-SE; Mon, 28 Sep 2020 15:56:54 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 28 Sep 2020 21:56:44 +0200 Message-Id: <20200928195648.30256-1-ludo@gnu.org> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches This allows 'gcc-toolchain' to be used as a drop-in replacement for the default tool chain through '--with-toolchain=gcc-toolchain'. * gnu/packages/commencement.scm (make-gcc-toolchain)[native-search-paths] [search-paths]: Append LIBC's search paths. --- gnu/packages/commencement.scm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index 4041d5bb89..0938bc3d46 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -3856,8 +3856,12 @@ COREUTILS-FINAL vs. COREUTILS, etc." "libc-static"))) #t)))) - (native-search-paths (package-native-search-paths gcc)) - (search-paths (package-search-paths gcc)) + (native-search-paths + (append (package-native-search-paths gcc) + (package-native-search-paths libc))) ;GUIX_LOCPATH + (search-paths + (append (package-search-paths gcc) + (package-search-paths libc))) (license (package-license gcc)) (synopsis "Complete GCC tool chain for C/C++ development") From patchwork Mon Sep 28 19:56:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 24369 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 582CF27BBE9; Mon, 28 Sep 2020 20:59:04 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 07F4627BBE8 for ; Mon, 28 Sep 2020 20:59:04 +0100 (BST) Received: from localhost ([::1]:52314 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMzId-0004FQ-6s for patchwork@mira.cbaines.net; Mon, 28 Sep 2020 15:59:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34276) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMzHe-0003eZ-UN for guix-patches@gnu.org; Mon, 28 Sep 2020 15:58:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42552) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kMzHe-0005j3-KR for guix-patches@gnu.org; Mon, 28 Sep 2020 15:58:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kMzHe-0002ys-L1 for guix-patches@gnu.org; Mon, 28 Sep 2020 15:58:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43679] [PATCH 2/5] gnu: clang-toolchain: Add 'GUIX_LOCPATH' to the search paths. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 28 Sep 2020 19:58: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: 43679@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 43679-submit@debbugs.gnu.org id=B43679.160132302711321 (code B ref 43679); Mon, 28 Sep 2020 19:58:02 +0000 Received: (at 43679) by debbugs.gnu.org; 28 Sep 2020 19:57:07 +0000 Received: from localhost ([127.0.0.1]:54077 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMzGl-0002wW-KO for submit@debbugs.gnu.org; Mon, 28 Sep 2020 15:57:07 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55294) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMzGi-0002vY-Pk for 43679@debbugs.gnu.org; Mon, 28 Sep 2020 15:57:05 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51184) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMzGd-0005bO-2q; Mon, 28 Sep 2020 15:56:59 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=43782 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kMzGZ-0003Ee-Ju; Mon, 28 Sep 2020 15:56:58 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 28 Sep 2020 21:56:45 +0200 Message-Id: <20200928195648.30256-2-ludo@gnu.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200928195648.30256-1-ludo@gnu.org> References: <20200928195648.30256-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches From: Ludovic Courtès * gnu/packages/llvm.scm (make-clang-toolchain)[native-search-paths]: Add 'GUIX_LOCPATH'. --- gnu/packages/llvm.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 15078a1168..4b42c4921a 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -484,7 +484,11 @@ code analysis tools.") "libc-static"))) #t)))) - (native-search-paths (package-native-search-paths clang)) + (native-search-paths + (append (package-native-search-paths clang) + (list (search-path-specification ;copied from glibc + (variable "GUIX_LOCPATH") + (files '("lib/locale")))))) (search-paths (package-search-paths clang)) (license (package-license clang)) From patchwork Mon Sep 28 19:56:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 24367 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id CAF3127BBE8; Mon, 28 Sep 2020 20:58:46 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 658AF27BBE9 for ; Mon, 28 Sep 2020 20:58:46 +0100 (BST) Received: from localhost ([::1]:51706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMzIL-0003wa-JX for patchwork@mira.cbaines.net; Mon, 28 Sep 2020 15:58:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34278) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMzHf-0003en-Bf for guix-patches@gnu.org; Mon, 28 Sep 2020 15:58:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42553) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kMzHf-0005j7-17 for guix-patches@gnu.org; Mon, 28 Sep 2020 15:58:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kMzHf-0002yz-1P for guix-patches@gnu.org; Mon, 28 Sep 2020 15:58:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43679] [PATCH 3/5] gnu: clang-toolchain: Create 'cc' and 'c++' symlinks. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 28 Sep 2020 19:58: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: 43679@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 43679-submit@debbugs.gnu.org id=B43679.160132302811328 (code B ref 43679); Mon, 28 Sep 2020 19:58:02 +0000 Received: (at 43679) by debbugs.gnu.org; 28 Sep 2020 19:57:08 +0000 Received: from localhost ([127.0.0.1]:54079 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMzGl-0002wY-RR for submit@debbugs.gnu.org; Mon, 28 Sep 2020 15:57:08 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55308) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMzGj-0002vd-RB for 43679@debbugs.gnu.org; Mon, 28 Sep 2020 15:57:06 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51186) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMzGe-0005bo-Gd; Mon, 28 Sep 2020 15:57:00 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=43782 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kMzGd-0003Ee-9n; Mon, 28 Sep 2020 15:56:59 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 28 Sep 2020 21:56:46 +0200 Message-Id: <20200928195648.30256-3-ludo@gnu.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200928195648.30256-1-ludo@gnu.org> References: <20200928195648.30256-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches From: Ludovic Courtès * gnu/packages/llvm.scm (make-clang-toolchain)[arguments]: Create 'cc' and 'c++' symlinks. --- gnu/packages/llvm.scm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 4b42c4921a..361b39710b 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -476,6 +476,12 @@ code analysis tools.") (((names . directories) ...) (union-build out directories))) + ;; Create 'cc' and 'c++' so that one can use it as a + ;; drop-in replacement for the default tool chain and + ;; have configure scripts find the compiler. + (symlink "clang" (string-append out "/bin/cc")) + (symlink "clang++" (string-append out "/bin/c++")) + (union-build (assoc-ref %outputs "debug") (list (assoc-ref %build-inputs "libc-debug"))) From patchwork Mon Sep 28 19:56:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 24368 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id A8E1627BBE9; Mon, 28 Sep 2020 20:58:51 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id E7A8827BBE8 for ; Mon, 28 Sep 2020 20:58:50 +0100 (BST) Received: from localhost ([::1]:51788 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMzIQ-0003yc-3A for patchwork@mira.cbaines.net; Mon, 28 Sep 2020 15:58:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34280) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMzHf-0003er-NO for guix-patches@gnu.org; Mon, 28 Sep 2020 15:58:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42554) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kMzHf-0005jD-Do for guix-patches@gnu.org; Mon, 28 Sep 2020 15:58:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kMzHf-0002z6-E1 for guix-patches@gnu.org; Mon, 28 Sep 2020 15:58:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43679] [PATCH 4/5] packages: Add 'package-with-toolchain'. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 28 Sep 2020 19:58:03 +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: 43679@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 43679-submit@debbugs.gnu.org id=B43679.160132303411349 (code B ref 43679); Mon, 28 Sep 2020 19:58:03 +0000 Received: (at 43679) by debbugs.gnu.org; 28 Sep 2020 19:57:14 +0000 Received: from localhost ([127.0.0.1]:54082 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMzGs-0002wy-4P for submit@debbugs.gnu.org; Mon, 28 Sep 2020 15:57:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55326) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMzGk-0002w3-Vh for 43679@debbugs.gnu.org; Mon, 28 Sep 2020 15:57:07 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51189) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMzGf-0005by-L3; Mon, 28 Sep 2020 15:57:01 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=43782 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kMzGe-0003Ee-SD; Mon, 28 Sep 2020 15:57:01 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 28 Sep 2020 21:56:47 +0200 Message-Id: <20200928195648.30256-4-ludo@gnu.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200928195648.30256-1-ludo@gnu.org> References: <20200928195648.30256-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * guix/build-system.scm (build-system-with-toolchain): New procedure. * guix/packages.scm (package-with-toolchain): New procedure. * tests/packages.scm ("package-with-toolchain"): New test. * doc/guix.texi (package Reference): Document 'package-with-toolchain'. (Build Systems): Mention it. --- doc/guix.texi | 32 ++++++++++++++++++++++++++++++++ guix/build-system.scm | 35 +++++++++++++++++++++++++++++++++-- guix/packages.scm | 9 +++++++++ tests/packages.scm | 20 ++++++++++++++++++++ 4 files changed, 94 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index c600d577ac..03836bbf7b 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -6506,6 +6506,35 @@ cross-compiling: It is an error to refer to @code{this-package} outside a package definition. @end deffn +Because packages are regular Scheme objects that capture a complete +dependency graph and associated build procedures, it is often useful to +write procedures that take a package and return a modified version +thereof according to some parameters. Below are a few examples. + +@cindex tool chain, choosing a package's tool chain +@deffn {Scheme Procedure} package-with-toolchain @var{package} @var{toolchain} +Return a variant of @var{package} that uses @var{toolchain} instead of +the default GNU toolchain. @var{toolchain} must be a list of inputs +(label/package tuples) providing equivalent functionality, such as the +@code{gcc-toolchain} package. + +The example below returns a variant of the @code{hello} package built +with GCC@tie{}10.x and the rest of the GNU tool chain (Binutils and the +GNU C Library) instead of the default tool chain: + +@lisp +(let ((toolchain (specification->package "gcc-toolchain@@10"))) + (package-with-toolchain hello `(("toolchain" ,toolchain)))) +@end lisp + +The build tool chain is part of the @dfn{implicit inputs} of +packages---it's usually not listed as part of the various ``inputs'' +fields and is instead pulled in by the build system. Consequently, this +procedure works by changing the build system of @var{package} so that it +pulls in @var{toolchain} instead of the defaults. @ref{Build Systems}, +for more on build systems. +@end deffn + @node origin Reference @subsection @code{origin} Reference @@ -6642,6 +6671,9 @@ ornamentation---in other words, a bag is a lower-level representation of a package, which includes all the inputs of that package, including some that were implicitly added by the build system. This intermediate representation is then compiled to a derivation (@pxref{Derivations}). +The @code{package-with-toolchain} is an example of a way to change the +implicit inputs that a package's build system pulls in (@pxref{package +Reference, @code{package-with-toolchain}}). Build systems accept an optional list of @dfn{arguments}. In package definitions, these are passed @i{via} the @code{arguments} field diff --git a/guix/build-system.scm b/guix/build-system.scm index 4174972b98..0b33b91aa0 100644 --- a/guix/build-system.scm +++ b/guix/build-system.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2020 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -18,6 +18,7 @@ (define-module (guix build-system) #:use-module (guix records) + #:use-module (srfi srfi-1) #:use-module (ice-9 match) #:export (build-system build-system? @@ -37,7 +38,9 @@ bag-arguments bag-build - make-bag)) + make-bag + + build-system-with-toolchain)) (define-record-type* build-system make-build-system build-system? @@ -98,3 +101,31 @@ intermediate representation just above derivations." #:outputs outputs #:target target arguments)))) + +(define (build-system-with-toolchain bs toolchain) + "Return a variant of BS, a build system, that uses TOOLCHAIN instead of the +default GNU toolchain. TOOLCHAIN must be a list of inputs (label/package +tuples) providing equivalent functionality, such as the 'gcc-toolchain' +package." + (define lower + (build-system-lower bs)) + + (define toolchain-packages + ;; These are the GNU toolchain packages pulled in by GNU-BUILD-SYSTEM and + ;; all the build systems that inherit from it. Keep the list in sync 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))))) + + (build-system + (inherit bs) + (lower lower*))) diff --git a/guix/packages.scm b/guix/packages.scm index 4f2bb432be..4764461949 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -124,6 +124,7 @@ package-patched-vulnerabilities package-with-patches package-with-extra-patches + package-with-toolchain package/inherit transitive-input-references @@ -790,6 +791,14 @@ specifies modules in scope when evaluating SNIPPET." (append (origin-patches (package-source original)) patches))) +(define (package-with-toolchain package toolchain) + "Return a variant of PACKAGE that uses TOOLCHAIN instead of the default GNU +toolchain. TOOLCHAIN must be a list of inputs (label/package tuples) +providing equivalent functionality, such as the 'gcc-toolchain' package." + (let ((bs (package-build-system package))) + (package/inherit package + (build-system (build-system-with-toolchain bs toolchain))))) + (define (transitive-inputs inputs) "Return the closure of INPUTS when considering the 'propagated-inputs' edges. Omit duplicate inputs, except for those already present in INPUTS diff --git a/tests/packages.scm b/tests/packages.scm index af8941c2e2..0d032005f5 100644 --- a/tests/packages.scm +++ b/tests/packages.scm @@ -1407,6 +1407,26 @@ (derivation-file-name (package-derivation %store coreutils)))))))) +(test-assert "package-with-toolchain" + (let* ((dep (dummy-package "chbouib" + (build-system gnu-build-system) + (native-inputs `(("x" ,grep))))) + (p0 (dummy-package "thingie" + (build-system gnu-build-system) + (inputs `(("foo" ,grep) + ("bar" ,dep))))) + (tc (dummy-package "my-toolchain")) + (p1 (package-with-toolchain p0 `(("toolchain" ,tc))))) + (define toolchain-packages + '("gcc" "binutils" "glibc" "ld-wrapper")) + + (match (bag-build-inputs (package->bag p1)) + ((("foo" foo) ("bar" bar) (_ (= package-name packages) . _) ...) + (and (not (any (cut member <> packages) toolchain-packages)) + (member "my-toolchain" packages) + (eq? foo grep) + (eq? bar dep)))))) + (test-equal "package-patched-vulnerabilities" '(("CVE-2015-1234") ("CVE-2016-1234" "CVE-2018-4567") From patchwork Mon Sep 28 19:56:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 24370 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 6D50527BBE9; Mon, 28 Sep 2020 20:59:16 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 4309527BBEA for ; Mon, 28 Sep 2020 20:59:13 +0100 (BST) Received: from localhost ([::1]:52766 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMzIm-0004Rp-Cb for patchwork@mira.cbaines.net; Mon, 28 Sep 2020 15:59:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34282) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMzHg-0003f6-3l for guix-patches@gnu.org; Mon, 28 Sep 2020 15:58:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42555) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kMzHf-0005jJ-Q9 for guix-patches@gnu.org; Mon, 28 Sep 2020 15:58:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kMzHf-0002zE-Qn for guix-patches@gnu.org; Mon, 28 Sep 2020 15:58:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43679] [PATCH 5/5] guix build: Add '--with-toolchain'. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 28 Sep 2020 19:58:03 +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: 43679@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 43679-submit@debbugs.gnu.org id=B43679.160132303511356 (code B ref 43679); Mon, 28 Sep 2020 19:58:03 +0000 Received: (at 43679) by debbugs.gnu.org; 28 Sep 2020 19:57:15 +0000 Received: from localhost ([127.0.0.1]:54084 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMzGs-0002x0-I0 for submit@debbugs.gnu.org; Mon, 28 Sep 2020 15:57:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55338) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMzGm-0002w5-3w for 43679@debbugs.gnu.org; Mon, 28 Sep 2020 15:57:08 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51206) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMzGg-0005cA-Pg; Mon, 28 Sep 2020 15:57:02 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=43782 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kMzGg-0003Ee-0K; Mon, 28 Sep 2020 15:57:02 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 28 Sep 2020 21:56:48 +0200 Message-Id: <20200928195648.30256-5-ludo@gnu.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200928195648.30256-1-ludo@gnu.org> References: <20200928195648.30256-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches From: Ludovic Courtès * guix/scripts/build.scm (transform-package-toolchain): New procedure. (%transformations): Add it. (%transformation-options, show-transformation-options-help): Add '--with-toolchain'. * tests/scripts-build.scm ("options->transformation, with-toolchain"): New test. * doc/guix.texi (Package Transformation Options): Document it. --- doc/guix.texi | 29 +++++++++++++++++++++++++++++ guix/scripts/build.scm | 40 ++++++++++++++++++++++++++++++++++++++++ tests/scripts-build.scm | 30 ++++++++++++++++++++++++++++++ 3 files changed, 99 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 03836bbf7b..049958b55f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -9310,6 +9310,35 @@ must be compatible. If @var{replacement} is somehow incompatible with @var{package}, then the resulting package may be unusable. Use with care! +@cindex tool chain, changing the build tool chain of a package +@item --with-toolchain=@var{package}=@var{toolchain} +This option changes @var{package} so that it gets built with +@var{toolchain} instead of the default GNU tool chain for C/C++. + +Consider this example: + +@example +guix build octave-cli \ + --with-toolchain=fftw=gcc-toolchain@@10 \ + --with-toolchain=fftwf=gcc-toolchain@@10 +@end example + +The command above builds a variant of the @code{fftw} and @code{fftwf} +packages using version 10 of @code{gcc-toolchain} instead of the default +tool chain, and then builds a variant of the GNU@tie{}Octave +command-line interface using them. GNU@tie{}Octave itself is built +using the default tool chain. + +This other example builds the Hardware Locality (@code{hwloc}) library +with the Clang C compiler, and then builds its dependents up to +@code{intel-mpi-benchmarks} using the default tool chain, but linking +them against the Clang-built @code{hwloc}: + +@example +guix build --with-toolchain=hwloc=clang-toolchain \ + intel-mpi-benchmarks +@end example + @item --with-git-url=@var{package}=@var{url} @cindex Git, using the latest commit @cindex latest commit, building diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm index f238e9b876..290046a808 100644 --- a/guix/scripts/build.scm +++ b/guix/scripts/build.scm @@ -393,6 +393,40 @@ a checkout of the Git repository at the given URL." (rewrite obj) obj))) +(define (transform-package-toolchain replacement-specs) + "Return a procedure that, when passed a package, changes its toolchain or +that of its dependencies according to REPLACEMENT-SPECS. REPLACEMENT-SPECS is +a list of strings like \"fftw=gcc-toolchain@10\" meaning that the package to +the left of the equal sign must be built with the toolchain to the right of +the equal sign." + (define split-on-commas + (cute string-tokenize <> (char-set-complement (char-set #\,)))) + + (define (specification->input spec) + (let ((package (specification->package spec))) + (list (package-name package) package))) + + (define replacements + (map (lambda (spec) + (match (string-tokenize spec %not-equal) + ((spec (= split-on-commas toolchain)) + (cons spec + (lambda (old) + (let ((toolchain (map specification->input toolchain))) + (package-with-toolchain old toolchain))))) + (_ + (leave (G_ "~a: invalid toolchain replacement specification~%") + spec)))) + replacement-specs)) + + (define rewrite + (package-input-rewriting/spec replacements)) + + (lambda (store obj) + (if (package? obj) + (rewrite obj) + obj))) + (define (transform-package-tests specs) "Return a procedure that, when passed a package, sets #:tests? #f in its 'arguments' field." @@ -423,6 +457,7 @@ a checkout of the Git repository at the given URL." (with-branch . ,transform-package-source-branch) (with-commit . ,transform-package-source-commit) (with-git-url . ,transform-package-source-git-url) + (with-toolchain . ,transform-package-toolchain) (without-tests . ,transform-package-tests))) (define %transformation-options @@ -444,6 +479,8 @@ a checkout of the Git repository at the given URL." (parser 'with-commit)) (option '("with-git-url") #t #f (parser 'with-git-url)) + (option '("with-toolchain") #t #f + (parser 'with-toolchain)) (option '("without-tests") #t #f (parser 'without-tests))))) @@ -466,6 +503,9 @@ a checkout of the Git repository at the given URL." (display (G_ " --with-git-url=PACKAGE=URL build PACKAGE from the repository at URL")) + (display (G_ " + --with-toolchain=PACKAGE=TOOLCHAIN + build package with TOOLCHAIN")) (display (G_ " --without-tests=PACKAGE build PACKAGE without running its tests"))) diff --git a/tests/scripts-build.scm b/tests/scripts-build.scm index 5f91360953..2dd1315722 100644 --- a/tests/scripts-build.scm +++ b/tests/scripts-build.scm @@ -22,6 +22,8 @@ #:use-module (guix derivations) #:use-module (guix packages) #:use-module (guix git-download) + #:use-module (guix build-system) + #:use-module (guix build-system gnu) #:use-module (guix scripts build) #:use-module (guix ui) #:use-module (guix utils) @@ -30,6 +32,8 @@ #:use-module (gnu packages base) #:use-module (gnu packages busybox) #:use-module (ice-9 match) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) #:use-module (srfi srfi-64)) @@ -270,6 +274,32 @@ ((("x" dep3)) (map package-source (list dep1 dep3)))))))))))) +(test-equal "options->transformation, with-toolchain" + '("gcc-toolchain") + (let* ((p (dummy-package "thingie" + (build-system gnu-build-system) + (inputs `(("foo" ,grep) + ("bar" ,(dummy-package "chbouib" + (build-system gnu-build-system) + (native-inputs `(("x" ,grep))))))))) + (t (options->transformation '((with-toolchain + . "chbouib=gcc-toolchain"))))) + (define toolchain-packages + '("gcc" "binutils" "glibc" "ld-wrapper")) + + (with-store store + (let ((new (t store p))) + (match (bag-build-inputs (package->bag new)) + ((("foo" _) ("bar" dep) (_ (= package-name packages) . _) ...) + (and (every (cut member <> packages) + toolchain-packages) + (match (bag-build-inputs (package->bag dep)) + ((("x" dep0) (_ (= package-name packages) . _) ...) + (and (eq? dep0 grep) ;this one is unchanged + (not (any (cut member <> packages) + toolchain-packages)) + (member "gcc-toolchain" packages))))))))))) + (test-assert "options->transformation, without-tests" (let* ((dep (dummy-package "dep")) (p (dummy-package "foo"