unofficial mirror of 
 help / color / mirror / Atom feed
* Help exposing RLS output for rust.
@ 2020-10-13 19:00 Noah Evans
  0 siblings, 0 replies; only message in thread
From: Noah Evans @ 2020-10-13 19:00 UTC (permalink / raw)
  To: help-guix

Hi, I'm trying to expose the RLS as an output of rust. Here's what I have so far:
(outputs `("out" "cargo" "doc" "rls"))
(substitute-keyword-arguments (package-arguments base-rust)
((#:phases phases)
`(modify-phases ,phases
(add-after 'patch-tests 'patch-rls-tests
(lambda _
(substitute* "src/tools/rls/tests/"
(("fn client_dependency_typo_and_fix") "#[ignore]\nfn client_dependency_typo_and_fix"))))
(add-before 'build 'enable-extended
(lambda _
(substitute* "config.toml"
(("[[]install[]]") "extended = true\nconfigure-args = ['--enable-extended']\ntools = ['cargo', 'rls']\n[install]"))))
(add-after 'check 'check-rls
(lambda _
(invoke "./" "test" "src/tools/rls")))
(add-after 'mkdir-prefix-paths 'mkdir-rls-prefix-path
(lambda* (#:key outputs #:allow-other-keys)
(mkdir-p (assoc-ref outputs "rls"))))
(replace 'install
(lambda* (#:key outputs #:allow-other-keys)
(invoke "./" "install")
(substitute* "config.toml"
;; replace prefix to specific output
(("prefix = \"[^\"]*\"")
(string-append "prefix = \"" (assoc-ref outputs "cargo") "\"")))
(invoke "./" "install" "cargo")
(substitute* "config.toml"
;; replace prefix to specific output
(("prefix = \"[^\"]*\"")
(string-append "prefix = \"" (assoc-ref outputs "rls") "\"")))
(invoke "./" "install" "rls")))))))

RLS successfully builds, but then I get this error:
/gnu/store/0pc5460zxsmfh6cdbxy1l0sfnsrm7cci-rust-1.46.0-rls/bin/.rls-real: error: depends on '', which cannot be found in RUNPATH....
/gnu/store/0pc5460zxsmfh6cdbxy1l0sfnsrm7cci-rust-1.46.0-rls/bin/.rls-real: error: depends on '', which cannot be found in RUNPATH....

I know this means that it needs the rust/lib folder in it's RUNPATH, because that's where those libraries are. The problem is since RLS and rust (OUT) are both outputs of the same package, I don't really understand how to make RLS see those files. I'd think that rust would need to be an input to RLS, but I don't see how I could do that.

I tried this as a quick hack, but unsurprisingly it didn't work:
(add-after 'wrap-rustc 'wrap-rls
(lambda* (#:key inputs outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "rls"))
(rust (assoc-ref outputs "out"))
(ld-wrapper (assoc-ref inputs "ld-wrapper")))
(wrap-program (string-append out "/bin/rls")
`("PATH" ":" prefix (,(string-append ld-wrapper "/bin")))
`("LIBRARY_PATH" ":" suffix (,(string-append rust "/lib"))))

I'm pretty stumped, I'd appreciate any advice, Thanks!

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-10-13 19:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-13 19:00 Help exposing RLS output for rust Noah Evans

unofficial mirror of 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror guix-user/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 guix-user guix-user/ \
	public-inbox-index guix-user

Example config snippet for mirrors.
Newsgroups are available over NNTP:

AGPL code for this site: git clone