From: Nicholas von Klitzing <nicholas@nvk.pm>
To: Maxime Devos <maximedevos@telenet.be>
Cc: "52107@debbugs.gnu.org" <52107@debbugs.gnu.org>
Subject: bug#52107: An Idea
Date: Fri, 26 Nov 2021 17:40:10 +0000 [thread overview]
Message-ID: <SgHNV6OEAv-_PlTS0kF7nq5TiVlY7V8ZmC6QvEUKW8e1BvsBuChDdmbd41fI60Xfc8fvr3ypJUOseRbqMCIORudZIhLKn0WOwBOdwG-ncVk=@nvk.pm> (raw)
In-Reply-To: <7e36114357dd0ccd37490ed3b422364c709d60a3.camel@telenet.be>
That's definitely a much better solution.
I'm having trouble finding documentation about both native-search-paths and wrap-program, so let me know if I understand your suggestions and how to apply them correctly.
The rust-1.18 package has a native-search-paths declaration:
``
(native-search-paths
(list (search-path-specification
(variable "C_INCLUDE_PATH")
(files '("include")))
(search-path-specification
(variable "CPLUS_INCLUDE_PATH")
(files '("include/c++" "include")))
(search-path-specification
(variable "LIBRARY_PATH")
(files '("lib" "lib64")))
;; Do you mean add something along the lines of
;; this to every rust-xx package?
(search-path-specification
(variable "RUST_SRC_PATH")
(files '("library"))))) ;; I'm not sure what arguments this takes
``
The directory structure of the rust repository, changes over time, so the paths would need to be adjusted depending on the version. Would I also need to add an additional build step to copy over the source and register it as an output?
And for the rust-analyzer package we then add something along the lines of?
``
(add-after
'install 'wrap-rust-analyzer
(lambda* (#:key inputs outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))
(rust-src-path (getenv "RUST_SRC_PATH")))
(wrap-program (string-append out "/bin/rust-analyzer")
`("RUST_SRC_PATH" ":" prefix (,rust-src-path))))
#t))
``
I'd appreciate your feedback, since I'm mostly clueless :)
Kind regards,
Nicholas
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Friday, November 26th, 2021 at 2:21 PM, Maxime Devos <maximedevos@telenet.be> wrote:
> Nicholas von Klitzing schreef op vr 26-11-2021 om 09:42 [+0000]:
>
> > Just to get the ball rolling, here is a possible idea.
> >
> > It might makes sense to add an additional output to the rust package
> >
> > `src` and then require this by the rust-analyzer package as
> >
> > `rust:src`.
>
> I'd use a native-search-path instead of a wrapper setting the
>
> environment variable, such that rust-analyzer can be used with any
>
> version of rust and the user can override the source code used.
>
> > In the rust-analyzer package we could then copy a thing from
> >
> > `icedove-wayland`:
> >
> > [
> >
> > ...] (call-with-output-file exe
> >
> > (lambda (port)
> >
> > (format port "#!~a
> >
> > ;; This style of overriding environment variables could be used for
> >
> > ;; RUST_SRC_PATH, although I am not sure if this is the idiomatic
> >
> > ;; way to do it.
> >
> > MOZ_ENABLE_WAYLAND=1 exec ~a $@"
>
> 'wrap-program' could be used here, instead of manually making shell
>
> scripts.
>
> Greetings,
>
> Maxime
next prev parent reply other threads:[~2021-11-26 17:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-25 14:53 bug#52107: rust-analyzer shipped broken without rust-src Nicholas von Klitzing
2021-11-26 9:42 ` bug#52107: An Idea Nicholas von Klitzing
2021-11-26 14:21 ` Maxime Devos
2021-11-26 17:40 ` Nicholas von Klitzing [this message]
2021-11-26 18:07 ` Maxime Devos
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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='SgHNV6OEAv-_PlTS0kF7nq5TiVlY7V8ZmC6QvEUKW8e1BvsBuChDdmbd41fI60Xfc8fvr3ypJUOseRbqMCIORudZIhLKn0WOwBOdwG-ncVk=@nvk.pm' \
--to=nicholas@nvk.pm \
--cc=52107@debbugs.gnu.org \
--cc=maximedevos@telenet.be \
/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 public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).