GNU bug report logs -
#53208
[PATCH]: gnu: rust-analyzer: Update to 2020-01-10.
Previous Next
Reported by: Z572 <873216071 <at> qq.com>
Date: Wed, 12 Jan 2022 15:25:01 UTC
Severity: normal
Tags: patch
Done: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hello,
Z572 via Guix-patches via <guix-patches <at> gnu.org> writes:
> +(define-public rust-src
> + (hidden-package
> + (package
> + (inherit rust-1.57)
> + (name "rust-src")
> + (build-system copy-build-system)
> + (native-inputs '())
> + (inputs '())
> + (native-search-paths '())
> + (outputs '("out"))
> + (arguments
> + `(#:install-plan
> + '(("library" "lib/rustlib/src/rust/library")
> + ("src" "lib/rustlib/src/rust/src"))))
> + (synopsis "Source code for the Rust standard library")
> + (description "This package provide source code for the Rust standard
> +library, only use by rust-analyzer, make rust-analyzer out of
> box."))))
This cannot work, because, AFAIK, you can only inherit packages from the
same module. So rust-src should be moved to rust.scm and made visible.
> + (add-after 'install 'wrap-program
> + (lambda* (#:key inputs outputs #:allow-other-keys)
> + (let* ((out (assoc-ref outputs "out"))
> + (bin (string-append out "/bin"))
> + (rust-src-path (search-input-directory
> + inputs "/lib/rustlib/src/rust/library")))
> + ;; if not get environment variable RUST_SRC_PATH, set it,
> + ;; make rust-analyzer out of box.
> + (with-directory-excursion bin
> + (let* ((prog "rust-analyzer")
> + (wrapped-file (string-append (dirname prog)
> + "/." (basename prog) "-real"))
> + (prog-tmp (string-append wrapped-file "-tmp")))
> + (link prog wrapped-file)
> + (call-with-output-file prog-tmp
> + (lambda (port)
> + (format port "#!~a
> +if test -z \"${RUST_SRC_PATH}\";then export RUST_SRC_PATH=~S;fi;
> +exec -a \"$0\" \"~a\" \"$@\""
> + (which "bash")
> + rust-src-path
> + (canonicalize-path wrapped-file))))
> + (chmod prog-tmp #o755)
> + (rename-file prog-tmp prog))))))
I tried to move the rust-src in rust.scm, as explained above, but when
I do, installation of rust-analyzer fails during the `wrap-program'
phases.
> (replace 'install-license-files
> (lambda* (#:key outputs #:allow-other-keys)
> (let* ((out (assoc-ref outputs "out"))
> @@ -1298,6 +1341,7 @@ (define-public rust-analyzer
> (chdir "../..")
> (install-file "LICENSE-MIT" doc)
> (install-file "LICENSE-APACHE" doc)))))))
> + (inputs (list rust-src))
Shouldn't it be a native-input?
Could you have a look at those issues? Thanks!
Regards,
--
Nicolas Goaziou
This bug report was last modified 3 years and 118 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.