From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 2P1mIqh9QmW3ngAA9RJhRA:P1 (envelope-from ) for ; Wed, 01 Nov 2023 17:32:40 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 2P1mIqh9QmW3ngAA9RJhRA (envelope-from ) for ; Wed, 01 Nov 2023 17:32:40 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D5B81114B0 for ; Wed, 1 Nov 2023 17:32:39 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=qq.com header.s=s201512 header.b=dIBb7EC9; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1698856360; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=Mc8eVE75Dw5/xTKFOhVKoCR0Gx5hVHTKdu+IoCngge8=; b=uqqtGY9oBPShw5EcUtGVpuJ7TeGELXSF1uW18MlIozPDJlJE9IsM1BUKj3pY/kBs7I2Afa Vxga9yZktiYbhX+kQGXrKsDM7nFIB+X9wnsvjs3m5TjCRklblf5qMBbruJEPDHnba2w+8M k1LnfHJZ+kuabGaADU9jFZ185WksMLU6qNj1bXbk3ADgJqEcBiMRMuSb0vJTz4OrAYZdTx +KdX7u2RQ7SLvGyDqgRSxsimvGZATiz9Q3VpaJpwY1DmmDdbwUxKt+9+cfDfpPpuwC/UXt D/g+ulvgAO0x4BjC2n+rt9774oWoydUcVHmXmNnkmF7CYnAMRkixD5JIiC0K+Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=qq.com header.s=s201512 header.b=dIBb7EC9; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1698856360; a=rsa-sha256; cv=none; b=XElBuEWblUOQmCYHDeZtn7/zQvHNl2h6IJwr/EMKZCOI95AiHb1QVlRmvI35WM4NwS6wqs zQKzJEG4A871MUmPlTRgHXOxiZB3/uM/oZ2ijTAYc5hdPuFJ9Xg91nd9bb3M2ueCQAINcP woHboUiwY5ew6EeXqO9Ul1K8t5JkkAdVeICMGvcbmWdLNz4gxsLXvnl+dvpzwlOd2QVvdU G7e/e322bDAYAH7gDxfznOs4K0Bw/+HFqhvzgy5vOHF67KEKawXp7oT94Byc3JGXdKhwud SO1onOc+X2bFh711PA+IjDc2ydIGff2kOFaQpPJAn/ioXYmpl+g5mZ6Q5C//jg== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qyE8r-0001Gk-4B; Wed, 01 Nov 2023 12:32:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qyE8p-0001F0-IV for guix-patches@gnu.org; Wed, 01 Nov 2023 12:32:27 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyE8p-0006BH-Ak for guix-patches@gnu.org; Wed, 01 Nov 2023 12:32:27 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qyE9N-0000BA-Ng for guix-patches@gnu.org; Wed, 01 Nov 2023 12:33:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#66728] [PATCH] gnu: rust-analyzer: Replace with version from rust. Resent-From: Z572 <873216071@qq.com> Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 01 Nov 2023 16:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66728 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Efraim Flashner Cc: 66728@debbugs.gnu.org Received: via spool by 66728-submit@debbugs.gnu.org id=B66728.1698856374670 (code B ref 66728); Wed, 01 Nov 2023 16:33:01 +0000 Received: (at 66728) by debbugs.gnu.org; 1 Nov 2023 16:32:54 +0000 Received: from localhost ([127.0.0.1]:52262 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyE9C-0000Ae-2m for submit@debbugs.gnu.org; Wed, 01 Nov 2023 12:32:53 -0400 Received: from out203-205-221-149.mail.qq.com ([203.205.221.149]:35689) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <873216071@qq.com>) id 1qyE96-0000AC-Hk for 66728@debbugs.gnu.org; Wed, 01 Nov 2023 12:32:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1698856312; bh=Mc8eVE75Dw5/xTKFOhVKoCR0Gx5hVHTKdu+IoCngge8=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=dIBb7EC9fDtWvRmkSKURKLZVTqF2M2Hvuw04DwqUeYNu5BghSs5UjRqGzGOu/aL86 MOcCV1sY638MNl+QDKjCFWi2uZ1V+rVK8mqE6vkjMB/gg9cf4lOFdsWLJfflQAyWTx UsJIE4KmXJbxyF6f9eF/CvH918arcViXmZ839bMQ= Received: from m ([111.0.51.175]) by newxmesmtplogicsvrsza12-0.qq.com (NewEsmtp) with SMTP id 7F1AFA30; Thu, 02 Nov 2023 00:31:49 +0800 X-QQ-mid: xmsmtpt1698856309t6gjoj7ki Message-ID: X-QQ-XMAILINFO: MmpliBmRb3iChfNP+TprG7pzf8W28Nzy1qM8u2IbmkGQX2ucN+ThtxF5TRU+0k bvTfMdjyjeoPHHypBlFw25qVG8VOTvZT5QEmOPYr5OrEO7HPgAdilsXeQ8rBFBYym5eF/Jqml9nw OiGYKLeBOV0O1sXEI09OdLF8ExH7MZDv5cWCeI5v3feKDIJbGq1kzmo8+V0PqeWkwaSX2P5Xy8eg eEflEL+shyHMou9kVw3eCX7Sbb5pdtMuCRyWNgtterdLl/pKhtibf1x4rjoHugcoGSN2NG+KeeN4 cS/a9hjZC/o6M1K+DvICvo4G+BftYvXZWIOYddAJC1I1+922B8HMdpsSK18rXcsm0ex9aPrLiNkL Ne2Ef7TISU4FHWBWp07IN3I2jUwwOgQK5wZlQ51+i5/covgfBXm1bdmEv9CP/sg+fNelatWUtx15 uwjY0H9Y18lZcGDz4TQCW0Jl1nB1bI7nZNFpDIbfpB/LwCRIMte7/jZlux2U9jd7ZwvWMRbQQY76 256izPH/auUdaSkRaRY+OUeoijc7OOYJrEJf0mWAYpVrlD4dp4fzF9tWZjBke2yJIXNG+MBDAnYj +Xk2jkRM861IDDxuc8VER/59eQl7CwnhKJ/8Q8375SuxhvHaXjbd/cOCVOUBz5CWQ8PY1v1YcKSi +v1PtUFmboiIUOOeWOXm6304+AzLjJNJOdldLGMIKQ1mBhITP69dBhv845wNS6xAUjl1SRAKRLDS BdnOsr5DE/cOPCSM9zhTBc7O1kosKR4IxbhJZTsaQT0M2f97WlwMDgYU54Wou48DQKeUF8Z2TJa8 hSUROjYlKHVr4WJyfglFoDak1rvCChGUN9iEC4eI38PyZ37HaSn0c9WhIKjbWSFpXK8jw8WCFB5M DEyviTgD/t/xZ7S0re36DjVtH03gCwCFBd5bTmSKBOhkv4R+tlPsGFWEJGYqX1rQDk6F7pjG7c X-QQ-XMRINFO: Mp0Kj//9VHAxr69bL5MkOOs= In-Reply-To: (Efraim Flashner's message of "Tue, 24 Oct 2023 17:07:13 +0300") References: Date: Thu, 02 Nov 2023 00:31:50 +0800 X-OQ-MSGID: <87sf5p305l.fsf@qq.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain 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: , Reply-to: Z572 <873216071@qq.com> X-ACL-Warn: , Z572 via Guix-patches From: Z572 via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -5.11 X-Spam-Score: -5.11 X-Migadu-Queue-Id: D5B81114B0 X-Migadu-Scanner: mx10.migadu.com X-TUID: CEiMjdKKLZyF Efraim Flashner writes: > * gnu/packages/rust-apps.scm (rust-analyzer): Rewrite package to contain > the rust-analyzer from the rust package. > > Change-Id: I36a15e444fda76f044323f97ebce08f562063d4b > --- > > There is a version of rust-analyzer which comes with rust itself, now > installed in the "tools" output of rust. I would like to replace the > separate rust-analyzer package with the one built from the rust sources > and wanted your opinions since you're the ones who have contributed to > the package and are most likely to have to have used it. > > gnu/packages/rust-apps.scm | 184 ++++--------------------------------- > 1 file changed, 17 insertions(+), 167 deletions(-) > > diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm > index 3ecaa049ee..1a39006cd7 100644 > --- a/gnu/packages/rust-apps.scm > +++ b/gnu/packages/rust-apps.scm > @@ -44,6 +44,7 @@ > (define-module (gnu packages rust-apps) > #:use-module (guix build-system cargo) > #:use-module (guix build-system pyproject) > + #:use-module (guix build-system trivial) > #:use-module (guix deprecation) > #:use-module (guix download) > #:use-module (guix gexp) > @@ -1940,174 +1941,23 @@ (define-public rbw > (define-public rust-analyzer maybe can use deprecated-package > (package > (name "rust-analyzer") > - (version "2022-01-10") > - (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 > - "1ci85bp8xwqrk8nqr8sh6yj8njgd98nhgnhaks2g00c77wwyra41")))) > - (build-system cargo-build-system) > + (version (package-version rust)) > + (source #f) > + (build-system trivial-build-system) > (arguments > - `(#:rust ,rust-1.64 > - #:install-source? #f ; virtual manifest > - #:cargo-test-flags > - '("--release" "--lib" "--tests" "--" > - "--skip=tests::test_version_check" ;it need rustc's version > - ;; FIXME: Guix's rust does not install source in > - ;; %out/lib/rustlib/src/rust so "can't load standard library from > - ;; sysroot" > - "--skip=tests::test_loading_rust_analyzer" > - ;; Failed to run rustfmt from toolchain 'stable'. Please run `rustup > - ;; component add rustfmt --toolchain stable` to install it > - "--skip=tests::sourcegen::sourcegen_assists_docs" ;need rustfmt > - "--skip=tests::sourcegen_ast::sourcegen_ast" ;same > - > - "--skip=tidy::check_licenses" ;it runs cargo metadata > - "--skip=tidy::check_merge_commits" ;it runs git rev-list > - "--skip=tidy::check_code_formatting" ;need rustfmt as cargo fmt > - > - ;; These tests require rust <= 1.60 and too many packages > - ;; has as dependency rust-serde-json-1 that use indexmap2 > - ;; and it need rust >= 1.64 > - "--skip=tests::list_test_macros" > - "--skip=tests::test_derive_empty" > - "--skip=tests::test_attr_macro" > - "--skip=tests::test_fn_like_macro" > - "--skip=tests::test_fn_like_macro2" > - "--skip=tests::test_derive_error") > - #:cargo-development-inputs > - (("rust-arbitrary" ,rust-arbitrary-1) > - ("rust-derive-arbitrary" ,rust-derive-arbitrary-1) > - ("rust-expect-test" ,rust-expect-test-1) > - ("rust-oorandom" ,rust-oorandom-11) > - ("rust-quote" ,rust-quote-1.0.10) > - ("rust-rayon" ,rust-rayon-1) > - ("rust-tracing" ,rust-tracing-0.1) > - ("rust-tracing-subscriber" ,rust-tracing-subscriber-0.3) > - ("rust-tracing-tree" ,rust-tracing-tree-0.2) > - ("rust-ungrammar" ,rust-ungrammar-1)) > - #: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-cargo-metadata" ,rust-cargo-metadata-0.14) > - ("rust-cfg-if" ,rust-cfg-if-1) > - ("rust-chalk-ir" ,rust-chalk-ir-0.75) > - ("rust-chalk-recursive" ,rust-chalk-recursive-0.75) > - ("rust-chalk-solve" ,rust-chalk-solve-0.75) > - ("rust-countme" ,rust-countme-3) > - ("rust-cov-mark" ,rust-cov-mark-2) > - ("rust-crossbeam-channel" ,rust-crossbeam-channel-0.5) > - ("rust-dissimilar" ,rust-dissimilar-1) > - ("rust-dot" ,rust-dot-0.1) > - ("rust-drop-bomb" ,rust-drop-bomb-0.1) > - ("rust-either" ,rust-either-1.6.0) > - ("rust-ena" ,rust-ena-0.14) > - ("rust-env-logger" ,rust-env-logger-0.8) > - ("rust-flate2" ,rust-flate2-1) > - ("rust-fst" ,rust-fst-0.4) > - ("rust-home" ,rust-home-0.5) > - ("rust-indexmap" ,rust-indexmap-1.7) > - ("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.91) > - ("rust-memmap2" ,rust-memmap2-0.5) > - ("rust-mimalloc" ,rust-mimalloc-0.1) > - ("rust-miow" ,rust-miow-0.4) > - ("rust-notify" ,rust-notify-5-pre.13) > - ("rust-object" ,rust-object-0.28) > - ("rust-once-cell" ,rust-once-cell-1) > - ("rust-parking-lot" ,rust-parking-lot-0.11) > - ("rust-perf-event" ,rust-perf-event-0.4) > - ("rust-proc-macro2" ,rust-proc-macro2-1.0.34) > - ("rust-pulldown-cmark" ,rust-pulldown-cmark-0.8) > - ("rust-pulldown-cmark-to-cmark" ,rust-pulldown-cmark-to-cmark-7) > - ("rust-rowan" ,rust-rowan-0.15) > - ("rust-rustc-ap-rustc-lexer" ,rust-rustc-ap-rustc-lexer-725) > - ("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.0.73) > - ("rust-serde-path-to-error" ,rust-serde-path-to-error-0.1) > - ("rust-typed-arena" ,rust-typed-arena-2) > - ("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-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-before 'check 'fix-tests > - (lambda _ > - (let ((bash (string-append "#!" (which "bash")))) > - (with-directory-excursion "crates/parser/test_data/lexer/ok" > - (substitute* "single_line_comments.txt" > - (("SHEBANG 19") > - (string-append "SHEBANG " > - (number->string (string-length bash)))) > - (("#!/usr/bin/env bash") bash)))))) > - (add-before 'install 'install-doc > - (lambda* (#:key outputs #:allow-other-keys) > - (let* ((out (assoc-ref outputs "out")) > - (doc (string-append out "/share/doc/rust-analyzer-" > - ,version))) > - (copy-recursively "docs" doc)))) > - (add-before 'install 'chdir > - (lambda _ > - (chdir "crates/rust-analyzer"))) > - (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 environment variable RUST_SRC_PATH is not set, set it, > - ;; make rust-analyzer work 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\" \"$@\"" after use rust:tools's rust-analyzer, user cann't overwrite RUST_SRC_PATH to use their own version rust-src. maybe add a 'fallback for wrap-program and use it is better one. > - (which "bash") > - rust-src-path > - (canonicalize-path wrapped-file)))) > - (chmod prog-tmp #o755) > - (rename-file prog-tmp prog)))))) > - (replace 'install-license-files > - (lambda* (#:key outputs #:allow-other-keys) > - (let* ((out (assoc-ref outputs "out")) > - (doc (string-append out "/share/doc/rust-analyzer-" > - ,version))) > - (chdir "../..") > - (install-file "LICENSE-MIT" doc) > - (install-file "LICENSE-APACHE" doc))))))) > - (native-inputs (list rust-src-1.64)) please don't forget to delete rust-src-1.64. > + (list > + #:modules '((guix build utils)) > + #:builder > + #~(begin > + (use-modules (guix build utils)) > + (let ((rust (assoc-ref %build-inputs "rust")) > + (out (assoc-ref %outputs "out"))) > + (install-file (string-append rust "/bin/rust-analyzer") > + (string-append out "/bin")) > + (copy-recursively (string-append rust "/share") > + (string-append out "/share")))))) > + (inputs > + (list (list rust "tools"))) > (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 > > base-commit: a3946d5c1d6539546d0ad6502928bd58a8b0e8ea other LGTM.