From patchwork Sat Aug 10 07:11:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Baines X-Patchwork-Id: 66908 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 7BF4927BBEA; Sat, 10 Aug 2024 08:12:44 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id CE9F027BBE2 for ; Sat, 10 Aug 2024 08:12:43 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1scgHE-0003zB-1L; Sat, 10 Aug 2024 03:12:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1scgHC-0003yB-1Q for guix-patches@gnu.org; Sat, 10 Aug 2024 03:12:34 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1scgHB-0005zs-Od for guix-patches@gnu.org; Sat, 10 Aug 2024 03:12:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:In-Reply-To:References:Subject; bh=9SfZiqaqQ2QnyyJEfYAtcIFgsyP0eqou2VYqzqbtqGs=; b=vStG2OGlPCQ+oLkR7SzUQCPA8zzMDwNS1+FxiNxvDKNND0Pe59aYSEve3qAqNAE4VS2QaC7buWM8ksnOKtnqTDcIYWxg4Da3YcLTJCTJJYS0+N4R/9OmohU7Y1Y2d6YrqNZbDs0+19hzWiw7rmElQdSHiAZJwU78MDrZNt2i8CjwLntJ3dGbeIdw6vsZj+xldoDnAyxUc5zNTzKP03Pub+Na/Hd2at2r3IDanCGtejns1Lp2LBvSPssKeO5Ky8ZUwIp9Rr+yMZF/TFt+hef7EsrgxQ7gkNR4Z+HRKlSNsuKqbjJO0rtY3hF4gj+Xbft3x8vb10xF5Ywci532jkwCPg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1scgHe-0004w0-Ec; Sat, 10 Aug 2024 03:13:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#72553] [PATCH 1/4] gnu: rust: Add profiling support. References: <871q2w26ru.fsf@cbaines.net> In-Reply-To: <871q2w26ru.fsf@cbaines.net> Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: efraim@flashner.co.il, guix-patches@gnu.org Resent-Date: Sat, 10 Aug 2024 07:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72553 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 72553@debbugs.gnu.org Cc: Efraim Flashner X-Debbugs-Original-Xcc: Efraim Flashner Received: via spool by 72553-submit@debbugs.gnu.org id=B72553.172327397518928 (code B ref 72553); Sat, 10 Aug 2024 07:13:02 +0000 Received: (at 72553) by debbugs.gnu.org; 10 Aug 2024 07:12:55 +0000 Received: from localhost ([127.0.0.1]:38955 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1scgHW-0004v7-Mu for submit@debbugs.gnu.org; Sat, 10 Aug 2024 03:12:55 -0400 Received: from mira.cbaines.net ([212.71.252.8]:43984) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1scgHS-0004uf-Rm for 72553@debbugs.gnu.org; Sat, 10 Aug 2024 03:12:52 -0400 Received: from localhost (136.249.6.51.dyn.plus.net [51.6.249.136]) by mira.cbaines.net (Postfix) with ESMTPSA id 011F227BBE2 for <72553@debbugs.gnu.org>; Sat, 10 Aug 2024 08:11:50 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id ba281b2b for <72553@debbugs.gnu.org>; Sat, 10 Aug 2024 07:11:50 +0000 (UTC) From: Christopher Baines Date: Sat, 10 Aug 2024 08:11:44 +0100 Message-ID: <0917fd5934be09855e7baec9901fa090d98a524b.1723273907.git.mail@cbaines.net> X-Mailer: git-send-email 2.45.2 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From: Milkey Mouse * gnu/packages/rust.scm (rust-1.52) [phases] : New phases. Change-Id: Iecb4aef518e52f71ff7f539778bf0341288a3458 --- gnu/packages/rust.scm | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) base-commit: ce055b806eaff8fec329c30ae0deb82c50a86240 diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index 12529d2420..4a3ad99e88 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -1216,11 +1216,24 @@ (define-public rust (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) (substitute* "src/bootstrap/src/core/builder.rs" - ((" = rpath.*" all) - (string-append all - " " - "rustflags.arg(\"-Clink-args=-Wl,-rpath=" - out "/lib\");\n")))))) + ((" = rpath.*" all) + (string-append all + " " + "rustflags.arg(\"-Clink-args=-Wl,-rpath=" + out "/lib\");\n")))))) + (add-after 'unpack 'unpack-profiler-rt + ;; Copy compiler-rt sources to where libprofiler_builtins looks + ;; for its vendored copy. Keep the clang-runtime version in + ;; sync with the LLVM version used to build Rust. + (lambda* (#:key inputs #:allow-other-keys) + (mkdir-p "src/llvm-project/compiler-rt") + (invoke "tar" "-xf" #$(package-source clang-runtime-15) + "-C" "src/llvm-project/compiler-rt" "--strip-components=1"))) + (add-after 'enable-codegen-tests 'enable-profiling + (lambda _ + (substitute* "config.toml" + (("^profiler =.*$") "") + (("\\[build\\]") "\n[build]\nprofiler = true\n")))) (add-after 'configure 'add-gdb-to-config (lambda* (#:key inputs #:allow-other-keys) (let ((gdb (assoc-ref inputs "gdb"))) @@ -1236,7 +1249,7 @@ (define-public rust (number->string (parallel-job-count)) "1")))) (invoke "./x.py" job-spec "build" - "library/std" ;rustc + "library/std" ;rustc "src/tools/cargo" "src/tools/clippy" "src/tools/rust-analyzer"