From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: Milkey Mouse <milkeymouse@meme.institute>
Cc: Marius Bakke <mbakke@fastmail.com>, 48525-done@debbugs.gnu.org
Subject: bug#48525: [PATCH core-updates] gnu: rust: Add profiling support.
Date: Sat, 20 Jan 2024 17:42:51 -0500 [thread overview]
Message-ID: <871qabd3tg.fsf_-_@gmail.com> (raw)
In-Reply-To: <20210525230350.542603-2-milkeymouse@meme.institute> (Milkey Mouse's message of "Tue, 25 May 2021 16:03:50 -0700")
Hi,
Milkey Mouse <milkeymouse@meme.institute> writes:
> * 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
I've ported this change to our current rust (using clang-runtime-15 to
match the llvm version used) and added it to the queued changes I'll
push shortly.
--
Thanks,
Maxim
prev parent reply other threads:[~2024-01-20 22:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-19 18:37 [bug#48525] [PATCH core-updates] gnu: rust: Add profiling support Milkey Mouse
2021-05-23 14:20 ` Marius Bakke
2021-05-25 1:13 ` Milkey Mouse
2021-05-25 20:35 ` Marius Bakke
2021-05-25 23:03 ` [bug#48525] [PATCH core-updates 1/2] gnu: rust: Update to 1.52 Milkey Mouse
2021-05-25 23:03 ` [bug#48525] [PATCH core-updates 2/2] gnu: rust: Add profiling support Milkey Mouse
2024-01-20 22:42 ` Maxim Cournoyer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871qabd3tg.fsf_-_@gmail.com \
--to=maxim.cournoyer@gmail.com \
--cc=48525-done@debbugs.gnu.org \
--cc=mbakke@fastmail.com \
--cc=milkeymouse@meme.institute \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.