From patchwork Tue May 25 23:03:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milkey Mouse X-Patchwork-Id: 29597 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 417DB27BC81; Wed, 26 May 2021 00:05: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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,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 A971927BC78 for ; Wed, 26 May 2021 00:05:12 +0100 (BST) Received: from localhost ([::1]:49456 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llg6p-0000tN-Eh for patchwork@mira.cbaines.net; Tue, 25 May 2021 19:05:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54178) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llg6g-0000mI-Ne for guix-patches@gnu.org; Tue, 25 May 2021 19:05:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:35751) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llg6g-0000Cu-F0 for guix-patches@gnu.org; Tue, 25 May 2021 19:05:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1llg6g-0005Xk-9g for guix-patches@gnu.org; Tue, 25 May 2021 19:05:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48525] [PATCH core-updates 2/2] gnu: rust: Add profiling support. Resent-From: Milkey Mouse Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 25 May 2021 23:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48525 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48525@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.162198386221251 (code B ref -1); Tue, 25 May 2021 23:05:02 +0000 Received: (at submit) by debbugs.gnu.org; 25 May 2021 23:04:22 +0000 Received: from localhost ([127.0.0.1]:47296 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1llg62-0005Wh-Cf for submit@debbugs.gnu.org; Tue, 25 May 2021 19:04:22 -0400 Received: from lists.gnu.org ([209.51.188.17]:33994) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1llg5o-0005W9-Dp for submit@debbugs.gnu.org; Tue, 25 May 2021 19:04:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54026) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llg5o-0007Kf-6l for guix-patches@gnu.org; Tue, 25 May 2021 19:04:08 -0400 Received: from sender4-of-o54.zoho.com ([136.143.188.54]:21491) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llg5m-000837-5l for guix-patches@gnu.org; Tue, 25 May 2021 19:04:07 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1621983840; cv=none; d=zohomail.com; s=zohoarc; b=ctdUuiK5izUKmg/sc0finYVZI+yygbhwqXMvZUNs7i+DDjkRA0xAeGL6ORKH2rYp8XwI9j98xRWVloT/MGXZNJgxh1ec8JnVKJqD2kF704VyHlmrBBzUqRUOB+Mwq+1eWQJbLHU/rMX9/x7/OgpQJzVzoG3H+MDaANHYnCsSH4I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621983840; h=Content-Transfer-Encoding:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=4mECu+jCSTRYWXjkJ9CmW6RjxRfjSuqrg8tl/R5D1JQ=; b=btZhJCiI3v72pFPFZCB+AkqtE0rheoQtDvSGJ5ya9NHwKJPBX0xr4LFfxW79mUXzT7tTNnFpDbrpKi53ChJK/0petoPjb3YU046zZUuT72pL2SCtZTdwvcaMBg6T5kbw05fg4FDmIb05MYFCRH2HAUFLV5a3L8OE18xasuXikQg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=meme.institute; spf=pass smtp.mailfrom=milkeymouse@meme.institute; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1621983840; s=memelord; d=meme.institute; i=milkeymouse@meme.institute; h=From:To:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=4mECu+jCSTRYWXjkJ9CmW6RjxRfjSuqrg8tl/R5D1JQ=; b=D9oBW9fvvoZPN57OZ1gKS+vlQVDLBLTTHJZjdcOvO1xIDDpshHgxxfZPMeEpebgy /c/NPmLuUGTw/ldE3TinyTildbDiAAylJEgOyXXoEBPFVQksOymxyUGBjnFQZup5uCj q9WnCHg8I73AVmQEgVtayXQo0Zs6lEPwDL1zrwHw= Received: from jupiter.local (50.47.115.222 [50.47.115.222]) by mx.zohomail.com with SMTPS id 1621983837795549.2808469770839; Tue, 25 May 2021 16:03:57 -0700 (PDT) From: Milkey Mouse Date: Tue, 25 May 2021 16:03:50 -0700 Message-Id: <20210525230350.542603-2-milkeymouse@meme.institute> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210525230350.542603-1-milkeymouse@meme.institute> References: <20210519183749.32709-1-milkeymouse@meme.institute> <20210525230350.542603-1-milkeymouse@meme.institute> MIME-Version: 1.0 X-ZohoMailClient: External Received-SPF: pass client-ip=136.143.188.54; envelope-from=milkeymouse@meme.institute; helo=sender4-of-o54.zoho.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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 * gnu/packages/rust.scm (rust-1.52) [phases]{unpack-profiler-rt, enable-profiling}: New phases. [native-inputs]{compiler-rt-source}: New input. --- gnu/packages/rust.scm | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index 6b769bfab2..7b77d791d1 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -853,7 +853,29 @@ safety and thread safety guarantees.") (inherit base-rust) (inputs (alist-replace "llvm" (list llvm-12) - (package-inputs base-rust)))))) + (package-inputs base-rust))) + ;; Add compiler-rt-source for libprofiler_builtins (needed for profiling + ;; support), which normally vendors its own copy of compiler-rt. + (native-inputs (cons* + `("compiler-rt-source" ,(package-source clang-runtime-12)) + (package-native-inputs base-rust))) + (arguments + (substitute-keyword-arguments (package-arguments base-rust) + ((#:phases phases) + `(modify-phases ,phases + (add-after 'unpack 'unpack-profiler-rt + ;; Copy compiler-rt sources to where libprofiler_builtins + ;; looks for its vendored copy. + (lambda* (#:key inputs #:allow-other-keys) + (mkdir-p "src/llvm-project/compiler-rt") + (invoke "tar" "-xf" (assoc-ref inputs "compiler-rt-source") + "-C" "src/llvm-project/compiler-rt" "--strip-components=1") + #t)) + (add-after 'enable-codegen-tests 'enable-profiling + (lambda _ + (substitute* "config.toml" + (("^profiler =.*$") "") + (("[[]build[]]") "\n[build]\nprofiler = true\n"))))))))))) ;;; Note: Only the latest versions of Rust are supported and tested. The ;;; intermediate rusts are built for bootstrapping purposes and should not