From 7e26e4c61a609e93199acdff608272e3cbc38c76 Mon Sep 17 00:00:00 2001 From: John Soo Date: Wed, 25 Nov 2020 06:30:02 -0800 Subject: [PATCH] gnu: Add rls as an output of rust@1.44. * gnu/packages/rust.scm (rust-1.44):[arguments] Build rls, [outputs] add rls. --- gnu/packages/rust.scm | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index 23837ee5bf..ae23d98b98 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -1284,16 +1284,24 @@ move around." "0ww4z2v3gxgn3zddqzwqya1gln04p91ykbrflnpdbmcd575n8bky"))) (package (inherit base-rust) - (outputs (cons "rustfmt" (package-outputs base-rust))) + (outputs (append '("rustfmt" "rls") (package-outputs base-rust))) (arguments (substitute-keyword-arguments (package-arguments base-rust) ((#:phases phases) `(modify-phases ,phases (replace 'build (lambda* _ + (substitute* "config.toml" + ;; replace prefix to specific output + (("\\[build\\]" all) + (string-append all " +extended = true +tools = [\"cargo\", \"rls\", \"clippy\", \"rustfmt\", \"analysis\", \"src\"] +"))) (invoke "./x.py" "build") (invoke "./x.py" "build" "src/tools/cargo") - (invoke "./x.py" "build" "src/tools/rustfmt"))) + (invoke "./x.py" "build" "src/tools/rustfmt") + (invoke "./x.py" "build" "src/tools/rls"))) (replace 'check (lambda* _ ;; Enable parallel execution. @@ -1305,7 +1313,12 @@ move around." (invoke "./x.py" parallel-job-spec "test" "src/tools/cargo") (invoke "./x.py" parallel-job-spec "test" - "src/tools/rustfmt")))) + "src/tools/rustfmt") + (substitute* "src/tools/rls/tests/client.rs" + (("fn client_dependency_typo_and_fix" all) + (string-append "#[ignore]\n" all))) + (invoke "./x.py" parallel-job-spec "test" + "src/tools/rls")))) (replace 'mkdir-prefix-paths (lambda* (#:key outputs #:allow-other-keys) ;; As result of https://github.com/rust-lang/rust/issues/36989 @@ -1313,6 +1326,7 @@ move around." (mkdir-p (assoc-ref outputs "out")) (mkdir-p (assoc-ref outputs "cargo")) (mkdir-p (assoc-ref outputs "rustfmt")) + (mkdir-p (assoc-ref outputs "rls")) #t)) (replace 'install (lambda* (#:key outputs #:allow-other-keys) @@ -1326,7 +1340,18 @@ move around." ;; replace prefix to specific output (("prefix = \"[^\"]*\"") (string-append "prefix = \"" (assoc-ref outputs "rustfmt") "\""))) - (invoke "./x.py" "install" "rustfmt")))))))))) + (invoke "./x.py" "install" "rustfmt") + (substitute* "config.toml" + ;; replace prefix to specific output + (("prefix = \"[^\"]*\"") + (string-append "prefix = \"" (assoc-ref outputs "rls") "\""))) + (invoke "./x.py" "install" "rls"))) + (replace 'validate-runpath + (lambda* (#:key outputs #:allow-other-keys #:rest rest) + (apply (assoc-ref %standard-phases 'validate-runpath) + ;; rls has references to "out" + #:outputs (alist-delete "rls" outputs) + rest)))))))))) (define-public rust-1.45 (let ((base-rust -- 2.29.2