From patchwork Fri Jun 11 13:23:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Z572 <873216071@qq.com> X-Patchwork-Id: 30173 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id E52CB27BC81; Fri, 11 Jun 2021 14:25:26 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED,URIBL_SBL,URIBL_SBL_A autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 406BD27BC78 for ; Fri, 11 Jun 2021 14:25:23 +0100 (BST) Received: from localhost ([::1]:49070 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrhA2-00029h-Bp for patchwork@mira.cbaines.net; Fri, 11 Jun 2021 09:25:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46072) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrh9k-0001Te-99 for guix-patches@gnu.org; Fri, 11 Jun 2021 09:25:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55279) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lrh9k-0005zF-2D for guix-patches@gnu.org; Fri, 11 Jun 2021 09:25:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lrh9j-00048m-Vw for guix-patches@gnu.org; Fri, 11 Jun 2021 09:25:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48956] [PATCH 58/58] gnu: Add rust-analyzer. Resent-From: Zheng Junjie <873216071@qq.com> Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 11 Jun 2021 13:25:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48956 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48956@debbugs.gnu.org Cc: Zheng junjie <873216071@qq.com> Received: via spool by 48956-submit@debbugs.gnu.org id=B48956.162341786515819 (code B ref 48956); Fri, 11 Jun 2021 13:25:03 +0000 Received: (at 48956) by debbugs.gnu.org; 11 Jun 2021 13:24:25 +0000 Received: from localhost ([127.0.0.1]:38587 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lrh96-000470-RH for submit@debbugs.gnu.org; Fri, 11 Jun 2021 09:24:25 -0400 Received: from out203-205-221-155.mail.qq.com ([203.205.221.155]:44296) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <873216071@qq.com>) id 1lrh90-00046K-Fr for 48956@debbugs.gnu.org; Fri, 11 Jun 2021 09:24:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1623417849; bh=Xjji0pbiPEEwVlbcB803t/6cKb+NLf/QLkFU+U7OhXI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=O7aRSCPPoFpaJNYZk/eszx3ETw+iMhrsjArto/Do4UHL7HXl18lTF9ODO16H4JaVK NT1rC7Yyp5V+6LdyvdYeHJDk3SoFlcXT+9878gzfeTD+gizI+9/dNHlstw83C83yxY FPWIppLvEYEXumWnC0dyUKfLwsBkRMgSYhlhKY/I= Received: from localhost.localdomain ([2409:8928:1204:1e6e:6319:fd60:2291:6721]) by newxmesmtplogicsvrsza7.qq.com (NewEsmtp) with SMTP id 60587295; Fri, 11 Jun 2021 21:24:05 +0800 X-QQ-mid: xmsmtpt1623417847t8z54q99x Message-ID: X-QQ-XMAILINFO: OE2SNMSfMbmO6+p7HGqVg87y+0vJvQ+4vd/a0odW9jNf/V7t5pq4xGWsZrTJXe IHpDeHZTLfhmhqFEd+4Qyj8C3I5NaLMKqnWCKtV9A0uic+oRiWk1d2xqJw5HKeQhpL9NmsbvWONF h7x73NG2OMsNawbsDLNs+HIXjwoA3Zop2kVRD6U9XYskcm/scnAkUUTKujH5iMm694KRrK959lBT Ub3+3tPxwJUEkEf2kemX0sFivra+x6l82BS2OqUbT+lQoa64mMSL8HHkqMg+BDNkrybjN1QCxsk1 u5KX/qqYwbvyZKIODS4K3EcsVzOSB14Zn1YzLW6TY7iBnGz6Q5cgY/ZmGVUXvi1DH7HerAH3Y1h5 3g79IcMfvO2dycJW7WjkbVCMzP9iGSIHKfjJbbQ56lycc/tHQ+NsKAShP7TPJ3p9lqnLvGiOGzEz 9E3EviJEv9r+75tOuNj6EcJ4qikUtWQVgWt4T/87hIvyfCxmaASjay63Qb0jRzLV/Qqw3fFpKMC8 rMNDhz+UynALgjC8LC7OTg9OyyeIYwYhFWr0ziUTjTLl8N0FN9qR1YYhwGx2DwEXoSblRQ+K0xp6 c6hEN8fNkm7DMbgTLBrGHdoQwTZNx/WrcOQWc08p52Lydu3RIE4XnlsN+b38DzKV9pAUGmrdAxEh PqOmAzeVQOk1bG/D6gjXbMV8OIeDj4SfwJzLG/Mo+jlOuUVhE4NP2dUQfayNRtMelrTm2w6ukv8b BU9e2gmMDiooiv2wfVbj1R7uLNoxMRofoysV9ltukGtJsW9bt9TXr9bR66rmY0nEc9awrZobbkYj gFhiA/ygbegVXqpx33ySEotO8wMMaK6W7ngWPDu+0D79gX6K1tg5mmYP/buCtgo0mIbEzUQ8UJaA 59u1Y9ArYA5xhft1iu1yJnHvCP0SAyqQ== From: Zheng Junjie <873216071@qq.com> Date: Fri, 11 Jun 2021 21:23:45 +0800 X-OQ-MSGID: <20210611132345.12382-6-873216071@qq.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210611132345.12382-1-873216071@qq.com> References: <20210611132345.12382-1-873216071@qq.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches From: Zheng junjie <873216071@qq.com> * gnu/packages/rust-apps.scm (rust-analyzer): New variable. --- gnu/packages/rust-apps.scm | 131 +++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm index 0eecd92cf7..720223469a 100644 --- a/gnu/packages/rust-apps.scm +++ b/gnu/packages/rust-apps.scm @@ -32,6 +32,7 @@ #:use-module ((guix licenses) #:prefix license:) #:use-module (guix build-system cargo) #:use-module (guix download) + #:use-module (guix git-download) #:use-module (guix packages) #:use-module (gnu packages compression) #:use-module (gnu packages crates-io) @@ -758,6 +759,136 @@ blanks grouped by language.") runs a command whenever it detects modifications.") (license license:asl2.0))) +(define-public rust-analyzer + (package + (name "rust-analyzer") + (version "2021-06-07") + (source + (origin + ;; The crate at "crates.io" is empty. + (method git-fetch) + (uri (git-reference + (url "https://github.com/rust-analyzer/rust-analyzer") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "06bc3s5kjwpyr2cq79p0306a9bqp3xp928d750ybby9npq2dvj3z")))) + (build-system cargo-build-system) + (arguments + `(#:rust ,rust-1.52 + #:install-source? #f ; virtual manifest + #:cargo-test-flags + '("--release" "--" + "--skip=tests::test_version_check" ;; It need rustc's version + ;; FIXME: Guix's rust not install source in %out/lib/rustlib/src/rust + ;; so "can't load standard library from sysroot" + "--skip=tests::test_loading_rust_analyzer" + "--skip=tidy::cargo_files_are_tidy" ;; Not need + "--skip=tidy::check_licenses" ;; It run cargo metadata. + "--skip=tidy::check_merge_commits" ;; It run git rev-list. + "--skip=tidy::check_code_formatting" ;; Need rustfmt as cargo fmt + "--skip=tidy::generate_grammar" ;; Same + "--skip=tidy::generate_assists_tests") ;; Same + #:cargo-inputs + (("rust-always-assert" ,rust-always-assert-0.1) + ("rust-anyhow" ,rust-anyhow-1) + ("rust-anymap" ,rust-anymap-0.12) + ("rust-arrayvec" ,rust-arrayvec-0.7) + ("rust-backtrace" ,rust-backtrace-0.3) + ("rust-cargo-metadata" ,rust-cargo-metadata-0.13) + ("rust-cfg-if" ,rust-cfg-if-1) + ("rust-chalk-ir" ,rust-chalk-ir-0.68) + ("rust-chalk-recursive" ,rust-chalk-recursive-0.68) + ("rust-chalk-solve" ,rust-chalk-solve-0.68) + ("rust-countme" ,rust-countme-2) + ("rust-cov-mark" ,rust-cov-mark-1) + ("rust-crossbeam-channel" ,rust-crossbeam-channel-0.5) + ("rust-dashmap" ,rust-dashmap-4) + ("rust-dissimilar" ,rust-dissimilar-1) + ("rust-dot" ,rust-dot-0.1) + ("rust-drop-bomb" ,rust-drop-bomb-0.1) + ("rust-either" ,rust-either-1) + ("rust-ena" ,rust-ena-0.14) + ("rust-env-logger" ,rust-env-logger-0.8) + ("rust-expect-test" ,rust-expect-test-1) + ("rust-flate2" ,rust-flate2-1) + ("rust-fst" ,rust-fst-0.4) + ("rust-home" ,rust-home-0.5) + ("rust-indexmap" ,rust-indexmap-1) + ("rust-itertools" ,rust-itertools-0.10) + ("rust-jod-thread" ,rust-jod-thread-0.1) + ("rust-libc" ,rust-libc-0.2) + ("rust-libloading" ,rust-libloading-0.7) + ("rust-log" ,rust-log-0.4) + ("rust-lsp-server" ,rust-lsp-server-0.5) + ("rust-lsp-types" ,rust-lsp-types-0.89) + ("rust-memmap2" ,rust-memmap2-0.2) + ("rust-mimalloc" ,rust-mimalloc-0.1) + ("rust-miow" ,rust-miow-0.3) + ("rust-notify" ,rust-notify-5) + ("rust-object" ,rust-object-0.24) + ("rust-once-cell" ,rust-once-cell-1) + ("rust-oorandom" ,rust-oorandom-11.1) + ("rust-parking-lot" ,rust-parking-lot-0.11) + ("rust-perf-event" ,rust-perf-event-0.4) + ("rust-proc-macro2" ,rust-proc-macro2-1) + ("rust-pulldown-cmark" ,rust-pulldown-cmark-0.8) + ("rust-pulldown-cmark-to-cmark" ,rust-pulldown-cmark-to-cmark-6) + ("rust-quote" ,rust-quote-1) + ("rust-rayon" ,rust-rayon-1) + ("rust-rowan" ,rust-rowan-0.13) + ("rust-rustc-ap-rustc-lexer" ,rust-rustc-ap-rustc-lexer-721) + ("rust-rustc-hash" ,rust-rustc-hash-1) + ("rust-salsa" ,rust-salsa-0.17) + ("rust-scoped-tls" ,rust-scoped-tls-1) + ("rust-serde" ,rust-serde-1) + ("rust-serde-json" ,rust-serde-json-1) + ("rust-serde-path-to-error" ,rust-serde-path-to-error-0.1) + ("rust-smallvec" ,rust-smallvec-1) + ("rust-smol-str" ,rust-smol-str-0.1) + ("rust-snap" ,rust-snap-1) + ("rust-text-size" ,rust-text-size-1) + ("rust-threadpool" ,rust-threadpool-1) + ("rust-tikv-jemalloc-ctl" ,rust-tikv-jemalloc-ctl-0.4) + ("rust-tikv-jemallocator" ,rust-tikv-jemallocator-0.4) + ("rust-tracing" ,rust-tracing-0.1) + ("rust-tracing-subscriber" ,rust-tracing-subscriber-0.2) + ("rust-tracing-tree" ,rust-tracing-tree-0.1) + ("rust-ungrammar" ,rust-ungrammar-1) + ("rust-url" ,rust-url-2) + ("rust-walkdir" ,rust-walkdir-2) + ("rust-winapi" ,rust-winapi-0.3) + ("rust-write-json" ,rust-write-json-0.1) + ("rust-xflags" ,rust-xflags-0.2) + ("rust-xshell" ,rust-xshell-0.1)) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-build-failures + (lambda _ + (chmod ".cargo/config" 420) + #t)) + (add-before 'check 'fix-tests + (lambda* (#:key inputs #:allow-other-keys) + (let ((bash (string-append "#!" (which "bash")))) + (with-directory-excursion "crates/syntax/test_data/lexer/ok" + (substitute* "0010_single_line_comments.txt" + (("SHEBANG 19") + (string-append "SHEBANG " + (number->string (string-length bash)))) + (("#!/usr/bin/env bash") bash)))))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (install-file "target/release/rust-analyzer" + (string-append (assoc-ref outputs "out") + "/bin"))))))) + (home-page "https://rust-analyzer.github.io/") + (synopsis "Experimental Rust compiler front-end for IDEs") + (description "Rust-analyzer is a modular compiler frontend for the Rust +language. It is a part of a larger rls-2.0 effort to create excellent IDE +support for Rust.") + (license (list license:expat license:asl2.0)))) + (define-public rust-cargo-c (package (name "rust-cargo-c")