From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 19 09:53:24 2020 Received: (at submit) by debbugs.gnu.org; 19 Mar 2020 13:53:25 +0000 Received: from localhost ([127.0.0.1]:41932 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jEvbw-0006tH-JN for submit@debbugs.gnu.org; Thu, 19 Mar 2020 09:53:24 -0400 Received: from lists.gnu.org ([209.51.188.17]:44850) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jEvbv-0006tA-Gk for submit@debbugs.gnu.org; Thu, 19 Mar 2020 09:53:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41833) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jEvbu-0002ik-5b for guix-patches@gnu.org; Thu, 19 Mar 2020 09:53:23 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_NONE autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jEvbs-0003zD-V0 for guix-patches@gnu.org; Thu, 19 Mar 2020 09:53:22 -0400 Received: from pat.zlotemysli.pl ([37.59.186.212]:50260) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jEvbs-0003xX-MU for guix-patches@gnu.org; Thu, 19 Mar 2020 09:53:20 -0400 Received: (qmail 21481 invoked by uid 1009); 19 Mar 2020 14:53:18 +0100 Received: from 188.123.215.55 (kuba@kadziolka.net@188.123.215.55) by pat (envelope-from , uid 1002) with qmail-scanner-2.08st (clamdscan: 0.98.6/25755. spamassassin: 3.4.0. perlscan: 2.08st. Clear:RC:1(188.123.215.55):. Processed in 0.011591 secs); 19 Mar 2020 13:53:18 -0000 Received: from unknown (HELO localhost.localdomain) (kuba@kadziolka.net@188.123.215.55) by pat.zlotemysli.pl with AES256-SHA encrypted SMTP; 19 Mar 2020 14:53:18 +0100 From: =?UTF-8?q?Jakub=20K=C4=85dzio=C5=82ka?= To: guix-patches@gnu.org Subject: [PATCH staging] cargo-build-system: Accept a #:features argument Date: Thu, 19 Mar 2020 14:53:15 +0100 Message-Id: <20200319135315.17573-1-kuba@kadziolka.net> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Qmailux-2.08st: added fake Content-Type header Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 37.59.186.212 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: submit 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 (-) * guix/build/cargo-build-system.scm (build, install): Pass the features to cargo. (check): Remove indirection layer for consistency with build and install. * guix/build-system/cargo.scm (cargo-build): New argument; pass it into the builder. * gnu/packages/rust-apps.scm (ripgrep): Use the new argument instead of a custom phase. --- gnu/packages/rust-apps.scm | 14 ++------------ guix/build-system/cargo.scm | 2 ++ guix/build/cargo-build-system.scm | 12 ++++++++---- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm index af51c0fcfc..2c718a14f5 100644 --- a/gnu/packages/rust-apps.scm +++ b/gnu/packages/rust-apps.scm @@ -244,18 +244,8 @@ provides defaults for 80% of the use cases.") (install-file manpage (string-append (assoc-ref outputs "out") "/share/man/man1")))) - #t)) - (replace 'install - ;; Adapted from (guix build cargo-build-system). The flags need to - ;; be passed to `cargo install' too, as otherwise it will build - ;; another binary, without the features. - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (mkdir-p out) - (setenv "CARGO_TARGET_DIR" "./target") - (invoke "cargo" "install" "--path" "." "--root" out - "--features" "pcre2"))))) - #:cargo-build-flags '("--release" "--features" "pcre2"))) + #t))) + #:features '("pcre2"))) (native-inputs `(("asciidoc" ,asciidoc) ("pcre2" ,pcre2) diff --git a/guix/build-system/cargo.scm b/guix/build-system/cargo.scm index 1e8b3a578e..2b5f301dc2 100644 --- a/guix/build-system/cargo.scm +++ b/guix/build-system/cargo.scm @@ -76,6 +76,7 @@ to NAME and VERSION." (vendor-dir "guix-vendor") (cargo-build-flags ''("--release")) (cargo-test-flags ''("--release")) + (features ''()) (skip-build? #f) (phases '(@ (guix build cargo-build-system) %standard-phases)) @@ -104,6 +105,7 @@ to NAME and VERSION." #:vendor-dir ,vendor-dir #:cargo-build-flags ,cargo-build-flags #:cargo-test-flags ,cargo-test-flags + #:features ,features #:skip-build? ,skip-build? #:tests? ,(and tests? (not skip-build?)) #:phases ,phases diff --git a/guix/build/cargo-build-system.scm b/guix/build/cargo-build-system.scm index 0721989589..0e2faee3c1 100644 --- a/guix/build/cargo-build-system.scm +++ b/guix/build/cargo-build-system.scm @@ -140,11 +140,14 @@ directory = '" port) (define* (build #:key skip-build? + features (cargo-build-flags '("--release")) #:allow-other-keys) "Build a given Cargo package." (or skip-build? - (apply invoke `("cargo" "build" ,@cargo-build-flags)))) + (apply invoke "cargo" "build" + "--features" (string-join features) + cargo-build-flags))) (define* (check #:key tests? @@ -152,10 +155,10 @@ directory = '" port) #:allow-other-keys) "Run tests for a given Cargo package." (if tests? - (apply invoke `("cargo" "test" ,@cargo-test-flags)) + (apply invoke "cargo" "test" cargo-test-flags) #t)) -(define* (install #:key inputs outputs skip-build? #:allow-other-keys) +(define* (install #:key inputs outputs skip-build? features #:allow-other-keys) "Install a given Cargo package." (let* ((out (assoc-ref outputs "out"))) (mkdir-p out) @@ -168,7 +171,8 @@ directory = '" port) ;; otherwise cargo will raise an error. (or skip-build? (not (has-executable-target?)) - (invoke "cargo" "install" "--path" "." "--root" out)))) + (invoke "cargo" "install" "--path" "." "--root" out + "--features" (string-join features))))) (define %standard-phases (modify-phases gnu:%standard-phases -- 2.25.1 From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 19 10:57:35 2020 Received: (at 40131-done) by debbugs.gnu.org; 19 Mar 2020 14:57:35 +0000 Received: from localhost ([127.0.0.1]:43479 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jEwc2-0000Zh-Pp for submit@debbugs.gnu.org; Thu, 19 Mar 2020 10:57:35 -0400 Received: from pat.zlotemysli.pl ([37.59.186.212]:56252) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jEwc0-0000ZS-Im for 40131-done@debbugs.gnu.org; Thu, 19 Mar 2020 10:57:33 -0400 Received: (qmail 8809 invoked by uid 1009); 19 Mar 2020 15:57:30 +0100 Received: from 188.123.215.55 (kuba@kadziolka.net@188.123.215.55) by pat (envelope-from , uid 1002) with qmail-scanner-2.08st (clamdscan: 0.98.6/25755. spamassassin: 3.4.0. perlscan: 2.08st. Clear:RC:1(188.123.215.55):. Processed in 0.021168 secs); 19 Mar 2020 14:57:30 -0000 Received: from unknown (HELO gravity) (kuba@kadziolka.net@188.123.215.55) by pat.zlotemysli.pl with SMTP; 19 Mar 2020 15:57:30 +0100 Date: Thu, 19 Mar 2020 15:57:29 +0100 From: Jakub =?utf-8?B?S8SFZHppb8WCa2E=?= To: 40131-done@debbugs.gnu.org Subject: Whoops Message-ID: <20200319145729.xvfvylrpkmmm2dxh@gravity> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="uf7f2oplpk2ck4ap" Content-Disposition: inline X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 40131-done 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.0 (-) --uf7f2oplpk2ck4ap Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I totally forgot that I have already sent this patch, see #39959. It's been a long two weeks... --uf7f2oplpk2ck4ap Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE5Xa/ss9usT31cTO54xWnWEYTFWQFAl5ziFkACgkQ4xWnWEYT FWSx8BAAnB8q4zIsbSM5CqiBvEisqA1RXaLUKYj9vtvyW/MS41lkNTLnTwknC4SK yTOJkzEoDv6gwVrTHnHOF5SpjlpBZgJVlTrhQWP1BLdDFJ+ncdkr0bPyyGK7qtmT 8fBnoDqkC9H5ZIJzOyjPqpq1YfJ4FXYVyIF0dW0g0CVZtmYMeL4r0l1XoMamfsEs zn3axpfJD46d4DezURtPHWfDIWlVR/r59oMkURw9oPs/FL1X8j6x6unC73yWU7CK if86WOVpJ4dVYIM847hbx2Jkx6Rin0QlXBuDIAiXSqWG/hFkB077GVXYCbes7v4U 0uNoW1GpKMvSodqemVZNabxXp42xc3QNchsT42OdHnaS9ZLhZnscLn/jRu5vjHQw GqLQGczbgDRXBQMPsHuveiXrllgHBWUL5ogWxgfWLLOxk+Z9hqBi2tmiBkEB2Mx7 ZdzJhRSZjwdGM2YvpPwq1nQKk8kDy/mybm81Tcajh+B5K9Zj7nKtTlc+gatC0VfJ 19D5t/PMbF8tKbDgNLh+mGhcoB2UFaOkgjBZ9uubSiQ/G9YtsvOa9qeLKdC+R1Xm TqbBP1TJdzyapxEMiEW98SyQyzz6v6Z4cBibAcESMIAJSg66TkhCV3kT6vT//czA eDCJo/npFWThH+/sQ8XtNLQr9rZwfDqSM94GJJxr8ILXP5NwNhc= =r7zp -----END PGP SIGNATURE----- --uf7f2oplpk2ck4ap-- From unknown Thu Aug 21 12:11:41 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 17 Apr 2020 11:24:05 +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