From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id lNAfCnRzpWDUZgAAgWs5BA (envelope-from ) for ; Wed, 19 May 2021 22:22:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 0DDwBHRzpWDyWAAAbx9fmQ (envelope-from ) for ; Wed, 19 May 2021 20:22:12 +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 3252AF47C for ; Wed, 19 May 2021 22:22:11 +0200 (CEST) Received: from localhost ([::1]:60042 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljRXA-0003Bn-Hs for larch@yhetil.org; Wed, 19 May 2021 15:07:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54876) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljR5y-0003tA-IS for guix-patches@gnu.org; Wed, 19 May 2021 14:39:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49172) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ljR5x-0001X6-VQ for guix-patches@gnu.org; Wed, 19 May 2021 14:39:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ljR5x-0003bh-S8 for guix-patches@gnu.org; Wed, 19 May 2021 14:39:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48525] [PATCH core-updates] gnu: rust: Add profiling support. Resent-From: Milkey Mouse Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 19 May 2021 18:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 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.162144948613793 (code B ref -1); Wed, 19 May 2021 18:39:01 +0000 Received: (at submit) by debbugs.gnu.org; 19 May 2021 18:38:06 +0000 Received: from localhost ([127.0.0.1]:60718 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ljR54-0003aP-0c for submit@debbugs.gnu.org; Wed, 19 May 2021 14:38:06 -0400 Received: from lists.gnu.org ([209.51.188.17]:57596) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ljR51-0003aE-A3 for submit@debbugs.gnu.org; Wed, 19 May 2021 14:38:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54584) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljR51-0002PC-0p for guix-patches@gnu.org; Wed, 19 May 2021 14:38:03 -0400 Received: from sender4-of-o54.zoho.com ([136.143.188.54]:21493) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljR4w-000129-TY for guix-patches@gnu.org; Wed, 19 May 2021 14:38:02 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1621449472; cv=none; d=zohomail.com; s=zohoarc; b=OP5kXsSWsUJ8bCqCKHoMjtnnNPYGsCvURM5OGZTY1x+/z518CjNVoEGiOrqSTYJYY3ctKiocQgGrxJttG+PVWokq5Afk99fGRmx+Ghc0CK4v88AS2dCAE9KkNwBQMF/zjjL19mVz5skRRAusQcX45mx1jvkfEBoEI2BeAnwvTL4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621449472; h=Content-Transfer-Encoding:Date:From:MIME-Version:Message-ID:Subject:To; bh=1A0/eX9JKqiQ77zXbRIlI5D+H2/hhXqYBBCg4pbhahk=; b=G5enFaWa4JwVLZDaNCRtMZlxwntINsIi0orO6K9IQp31zioJkOBJ72cLbLjtYg3VBAwMFsCv3T8mBKwU99XFNcf/b+EMdByIc7E40HN6TUWVJqypiSge95VYAzDWVnMoURZAckDZv9rEU7pSkNqR1VmDSgNXmglel1cbaNWLnKA= 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=1621449472; s=memelord; d=meme.institute; i=milkeymouse@meme.institute; h=From:To:Subject:Date:Message-Id:MIME-Version:Content-Transfer-Encoding; bh=1A0/eX9JKqiQ77zXbRIlI5D+H2/hhXqYBBCg4pbhahk=; b=uGKG1FLaRX6nx8a/2KJPsUUxuXVfS9up+nQ/t8DUDOtj3Tr87nvfzmMoWqRN5BjH QAe38f/m9TmyI16vPdhMDY4zPpQkvPOBtqdNffDndzHdQ6spMpB6aSKcIaNerLGS9+u kfiEgi2S4xm+L7o58NV2wKLkac6COVobW/NhwEjI= Received: from jupiter.local (50.47.115.222 [50.47.115.222]) by mx.zohomail.com with SMTPS id 1621449469852554.6908215547811; Wed, 19 May 2021 11:37:49 -0700 (PDT) From: Milkey Mouse Date: Wed, 19 May 2021 11:37:49 -0700 Message-Id: <20210519183749.32709-1-milkeymouse@meme.institute> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1621455731; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=1A0/eX9JKqiQ77zXbRIlI5D+H2/hhXqYBBCg4pbhahk=; b=ehltxm4B8KoeWDa6oPHBU1cVnCLbgQQ2A+ydEr4av0kigjPjWWESbMyntzKwwpL8iqPdMZ 33t8tlysRVsWE54u5j71u1/YaX7hB/ufHe93WJhfrmIU3X9tgD2BDV37PpOhenbKaZ2haC tKv1sZHLDkZzLtuEH7H87IX74J5/gvzb3QqK+va1vXArR7G0PXPY/Wh29edXVJcNx2/SAK pqpGGM/h9IS9rorzpL5I+2PyBAvJ8fZ2WohFBMz3XVqZrIuktmqx+jm8bRUJ8LF7Mp/fm0 ehl2wNC4LRgs+guMi4AqJIkQcz+xnKDsHcPtsN1rVOlKjwcrFWt2ukjWL5UXDg== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1621455731; a=rsa-sha256; cv=fail; b=bnD3I8EN21boO67dPi+pZPqDDDIAQYB72Iyzq5ceo3yTFrP523e77UQCFMFe89b1EH/Cup lTBrKd8zCWC9Urub8P70zPq5qjV12r/FgVBNoFfVZBlt9mZoAOAUb4xHcBfoJe81hdn3lM jm0/LZIS/jdfYtP/FEpTcw4Fsrbz9mSurUvXtfQlazSBE4UTsBPgX7fpDBMurgdXCVvHv4 BxrvVQdxlCT1LJ4ePbNRnbW+n9pcWTVY8dvB/3Epv4XKxl6aLVq7AMHzplv6DKlXBbUvFY 3U03okv4SG6O6OjIPAK/xvwfGLi5N1NfPqg24EsJd2IKQmfvkxLZWL1sqbbT3g== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=meme.institute header.s=memelord header.b=uGKG1FLa; arc=reject ("signature check failed: fail, {[1] = sig:zohomail.com:reject}"); 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-Spam-Score: 7.06 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=meme.institute header.s=memelord header.b=uGKG1FLa; arc=reject ("signature check failed: fail, {[1] = sig:zohomail.com:reject}"); 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: 3252AF47C X-Spam-Score: 7.06 X-Migadu-Scanner: scn1.migadu.com X-TUID: haNi5ew9F6/8 * gnu/packages/rust.scm (rust-1.49)[source]: Add patch. [phases]{unpack-profiler-rt, enable-profiling}: New phases. [native-inputs]{compiler-rt-source}: New input. (rust-1.50)[source]: Remove "rust-1.49-llvm-cov-no-debug.patch". * gnu/packages/patches/rust-1.49-llvm-cov-no-debug.patch: New file. * gnu/local.mk (dist_patch_DATA): Add patch. --- gnu/local.mk | 1 + .../patches/rust-1.49-llvm-cov-no-debug.patch | 27 +++++++++++++++ gnu/packages/rust.scm | 33 +++++++++++++++++-- 3 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 gnu/packages/patches/rust-1.49-llvm-cov-no-debug.patch diff --git a/gnu/local.mk b/gnu/local.mk index add01cf6d2..9dbf568d0c 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1631,6 +1631,7 @@ dist_patch_DATA = \ %D%/packages/patches/rnp-disable-ruby-rnp-tests.patch \ %D%/packages/patches/rnp-unbundle-googletest.patch \ %D%/packages/patches/ruby-sanitize-system-libxml.patch \ + %D%/packages/patches/rust-1.49-llvm-cov-no-debug.patch \ %D%/packages/patches/rust-coresimd-doctest.patch \ %D%/packages/patches/rust-ndarray-remove-blas-src-dep.patch \ %D%/packages/patches/rust-nettle-disable-vendor.patch \ diff --git a/gnu/packages/patches/rust-1.49-llvm-cov-no-debug.patch b/gnu/packages/patches/rust-1.49-llvm-cov-no-debug.patch new file mode 100644 index 0000000000..b72402a9a7 --- /dev/null +++ b/gnu/packages/patches/rust-1.49-llvm-cov-no-debug.patch @@ -0,0 +1,27 @@ +cherry-picked from commit fe56d267cae, in master as of 1.50 +diff --git a/src/test/run-make-fulldeps/coverage-reports-base/Makefile b/src/test/run-make-fulldeps/coverage-reports-base/Makefile +index b175768e199..1e2aa056e40 100644 +--- a/src/test/run-make-fulldeps/coverage-reports-base/Makefile ++++ b/src/test/run-make-fulldeps/coverage-reports-base/Makefile +@@ -13,15 +13,13 @@ + BASEDIR=../coverage-reports-base + SOURCEDIR=../coverage + +-ifeq ($(UNAME),Darwin) +-# FIXME(richkadel): It appears that --debug is not available on MacOS even when not running +-# under CI. +-NO_LLVM_ASSERTIONS=1 +-endif +- + # The `llvm-cov show` flag `--debug`, used to generate the `counters` output files, is only enabled +-# if LLVM assertions are enabled. Some CI builds disable debug assertions. +-ifndef NO_LLVM_ASSERTIONS ++# if LLVM assertions are enabled. Requires Rust config `llvm/optimize` and not ++# `llvm/release_debuginfo`. Note that some CI builds disable debug assertions (by setting ++# `NO_LLVM_ASSERTIONS=1`), so it is not OK to fail the test, but `bless`ed test results cannot be ++# generated without debug assertions. ++LLVM_COV_DEBUG := $(shell "$(LLVM_BIN_DIR)"/llvm-cov show --debug 2>&1 | grep -q "Unknown command line argument '--debug'"; echo $$?) ++ifeq ($(LLVM_COV_DEBUG), 1) + DEBUG_FLAG=--debug + endif + diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index 636420e25d..72355fa789 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -730,6 +730,10 @@ safety and thread safety guarantees.") "0yf7kll517398dgqsr7m3gldzj0iwsp3ggzxrayckpqzvylfy2mm"))) (package (inherit base-rust) + (source + (origin + (inherit (package-source base-rust)) + (patches (search-patches "rust-1.49-llvm-cov-no-debug.patch")))) (outputs (cons "doc" (package-outputs base-rust))) (arguments (substitute-keyword-arguments (package-arguments base-rust) @@ -817,11 +821,24 @@ safety and thread safety guarantees.") ((file) file)) (("fn ctrl_c_kills_everyone") "#[ignore]\nfn ctrl_c_kills_everyone")))) + (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 'configure 'enable-docs (lambda _ (substitute* "config.toml" (("docs = false") "docs = true")))) + (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"))) @@ -829,17 +846,27 @@ safety and thread safety guarantees.") (("^python =.*" all) (string-append all "gdb = \"" gdb "/bin/gdb\"\n")))))))))) - ;; Add test inputs. (native-inputs (cons* + ;; Add test inputs. ;; The tests fail when using GDB 10 (see: ;; https://github.com/rust-lang/rust/issues/79009). `("gdb" ,gdb-9.2) `("procps" ,procps) + ;; Add compiler-rt-source for libprofiler_builtins, + ;; which typically vendors compiler-rt. Needed for PGO. + `("compiler-rt-source" ,(package-source clang-runtime-11)) (package-native-inputs base-rust)))))) (define-public rust-1.50 - (rust-bootstrapped-package rust-1.49 "1.50.0" - "0pjs7j62maiyvkmhp9zrxl528g2n0fphp4rq6ap7aqdv0a6qz5wm")) + (let ((base-rust (rust-bootstrapped-package + rust-1.49 "1.50.0" + "0pjs7j62maiyvkmhp9zrxl528g2n0fphp4rq6ap7aqdv0a6qz5wm"))) + (package + (inherit base-rust) + (source + (origin + (inherit (package-source base-rust)) + (patches '())))))) (define-public rust-1.51 (rust-bootstrapped-package rust-1.50 "1.51.0" -- 2.31.1