From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 2HptIR6Xx19kRAAA0tVLHw (envelope-from ) for ; Wed, 02 Dec 2020 13:31:10 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id yORYHR6Xx184IgAAB5/wlQ (envelope-from ) for ; Wed, 02 Dec 2020 13:31:10 +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 1B4FF9404CF for ; Wed, 2 Dec 2020 13:31:09 +0000 (UTC) Received: from localhost ([::1]:47824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkSDs-0000Xa-Sv for larch@yhetil.org; Wed, 02 Dec 2020 08:31:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49704) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkSCq-0000Vb-QL for guix-patches@gnu.org; Wed, 02 Dec 2020 08:30:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:51424) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kkSCo-00055z-7d for guix-patches@gnu.org; Wed, 02 Dec 2020 08:30:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kkSCo-0006JD-39 for guix-patches@gnu.org; Wed, 02 Dec 2020 08:30:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#42295] [PATCH] gnu: rust-1.44: Add rustfmt output. Resent-From: Matthew Kraai Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 02 Dec 2020 13:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42295 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: John Soo Cc: 42295@debbugs.gnu.org Received: via spool by 42295-submit@debbugs.gnu.org id=B42295.160691577424188 (code B ref 42295); Wed, 02 Dec 2020 13:30:02 +0000 Received: (at 42295) by debbugs.gnu.org; 2 Dec 2020 13:29:34 +0000 Received: from localhost ([127.0.0.1]:34737 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kkSCM-0006I3-H5 for submit@debbugs.gnu.org; Wed, 02 Dec 2020 08:29:34 -0500 Received: from mail.ftbfs.org ([52.8.68.13]:62680 helo=aws.ftbfs.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kkSCK-0006Hl-FW for 42295@debbugs.gnu.org; Wed, 02 Dec 2020 08:29:33 -0500 Received: from ip68-5-94-190.oc.oc.cox.net ([68.5.94.190] helo=[192.168.1.12]) by aws.ftbfs.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kkSCE-0005Fw-8I; Wed, 02 Dec 2020 13:29:26 +0000 References: <20200709123256.7690-1-kraai@ftbfs.org> <87blfltrxp.fsf@asu.edu> <5407eb2f-b499-2520-e0e5-48ca7171e6bd@ftbfs.org> <871rggt62e.fsf@asu.edu> From: Matthew Kraai Message-ID: <977d1171-d1af-5705-3852-1bee82047445@ftbfs.org> Date: Wed, 2 Dec 2020 05:29:25 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Icedove/78.5.0 MIME-Version: 1.0 In-Reply-To: <871rggt62e.fsf@asu.edu> Content-Type: multipart/mixed; boundary="------------9E1673ADC6805DBA52D942BE" Content-Language: en-US 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.28 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-Migadu-Queue-Id: 1B4FF9404CF X-Spam-Score: -2.28 X-Migadu-Scanner: ns3122888.ip-94-23-21.eu X-TUID: BqxnL7Db0/ZG This is a multi-part message in MIME format. --------------9E1673ADC6805DBA52D942BE Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hi John, On 11/26/20 8:51 AM, John Soo wrote: > Matthew Kraai writes: >> According to https://github.com/rust-lang/rustfmt, rustfmt was made a >> component in 1.24.0.  Would it be better to add this support to the >> rust-1.24 package instead?  I've attached the patch I'm currently testing. > Keep it on rust@1.44. Even though guix refresh --list-dependent will > report not many dependents, changing a current rust version would > trigger many rebuilds. There would be enough rebuilds to require it to > be applied to staging. > > I've also attached a work in progress patch to add rls as an output, > too. I would love if all the "extended" tools can be included. Some > tools like clippy and the rust-src component would be very helpful. > > One other thing: > >> + (outputs '("out" "doc" "cargo" "rustfmt")) > should probably be: (cons "rustfmt" (package-outputs base-rust)) > > to be more resistant to changes to older packages. Here is an updated patch.  I modified the rust-1.46 package, used your suggestion to add rustfmt to the list of outputs, did not modify the mkdir-prefix-paths phase (which doesn't seem to be necessary), and updated the delete-install-logs phase. -- Matthew Kraai --------------9E1673ADC6805DBA52D942BE Content-Type: text/x-patch; charset=UTF-8; name="0001-gnu-rust-1.46-Add-rustfmt-output.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="0001-gnu-rust-1.46-Add-rustfmt-output.patch" >From 600cc3f1f4a38847aea48edb0e1e7e365bd00d8c Mon Sep 17 00:00:00 2001 From: Matthew Kraai Date: Wed, 2 Dec 2020 05:18:35 -0800 Subject: [PATCH] gnu: rust-1.46: Add rustfmt output * gnu/packages/rust.scm (rust-1.46): Add a rustfmt output. --- gnu/packages/rust.scm | 67 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 65 insertions(+), 2 deletions(-) diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index 35a96b5754..749d1f031f 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -10,6 +10,7 @@ ;;; Copyright © 2019 Ivan Petkov ;;; Copyright © 2020 Jakub Kądziołka ;;; Copyright © 2020 Pierre Langlois +;;; Copyright © 2020 Matthew Kraai ;;; ;;; This file is part of GNU Guix. ;;; @@ -1315,8 +1316,70 @@ move around." #t))))))))) (define-public rust-1.46 - (rust-bootstrapped-package rust-1.45 "1.46.0" - "0a17jby2pd050s24cy4dfc0gzvgcl585v3vvyfilniyvjrqknsid")) + (let ((base-rust + (rust-bootstrapped-package rust-1.45 "1.46.0" + "0a17jby2pd050s24cy4dfc0gzvgcl585v3vvyfilniyvjrqknsid"))) + (package + (inherit base-rust) + (outputs (cons "rustfmt" (package-outputs base-rust))) + (arguments + (substitute-keyword-arguments (package-arguments base-rust) + ((#:phases phases) + `(modify-phases ,phases + (replace 'build + (lambda* _ + (invoke "./x.py" "build") + (invoke "./x.py" "build" "src/tools/cargo") + (invoke "./x.py" "build" "src/tools/rustfmt"))) + (replace 'check + (lambda* _ + ;; Test rustfmt. + (let ((parallel-job-spec + (string-append "-j" (number->string + (min 4 + (parallel-job-count)))))) + (invoke "./x.py" parallel-job-spec "test" "-vv") + (invoke "./x.py" parallel-job-spec "test" + "src/tools/cargo") + (invoke "./x.py" parallel-job-spec "test" + "src/tools/rustfmt")))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (invoke "./x.py" "install") + (substitute* "config.toml" + ;; replace prefix to specific output + (("prefix = \"[^\"]*\"") + (string-append "prefix = \"" (assoc-ref outputs "cargo") "\""))) + (invoke "./x.py" "install" "cargo") + (substitute* "config.toml" + ;; replace prefix to specific output + (("prefix = \"[^\"]*\"") + (string-append "prefix = \"" (assoc-ref outputs "rustfmt") "\""))) + (invoke "./x.py" "install" "rustfmt"))) + (replace 'delete-install-logs + (lambda* (#:key outputs #:allow-other-keys) + (define (delete-manifest-file out-path file) + (delete-file (string-append out-path "/lib/rustlib/" file))) + + (let ((out (assoc-ref outputs "out")) + (cargo-out (assoc-ref outputs "cargo")) + (rustfmt-out (assoc-ref outputs "rustfmt"))) + (for-each + (lambda (file) (delete-manifest-file out file)) + '("install.log" + "manifest-rust-docs" + ,(string-append "manifest-rust-std-" + (nix-system->gnu-triplet-for-rust)) + "manifest-rustc")) + (for-each + (lambda (file) (delete-manifest-file cargo-out file)) + '("install.log" + "manifest-cargo")) + (for-each + (lambda (file) (delete-manifest-file rustfmt-out file)) + '("install.log" + "manifest-rustfmt-preview")) + #t)))))))))) ;; TODO(staging): Bump this variable to the latest packaged rust. (define-public rust rust-1.45) -- 2.29.2 --------------9E1673ADC6805DBA52D942BE--