From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id QIDHLDzQN2XjcAAAauVa8A:P1 (envelope-from ) for ; Tue, 24 Oct 2023 16:10:04 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id QIDHLDzQN2XjcAAAauVa8A (envelope-from ) for ; Tue, 24 Oct 2023 16:10:04 +0200 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 B36146A2E5 for ; Tue, 24 Oct 2023 16:10:03 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=XO5tFxOf; 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"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1698156604; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=WDCOFS2tpi35bDcxZEeriQxs1vcrsBxSIWU9IcMx5ic=; b=phd8D/mdKsw0WKKaOw9IO9FYZ+mAjZA1AC/3iLy6Ndm2LwvETz/Cmd+cBQsegcdn5KQ7/n W5mhIWLp/C82qcToNdLdHCfG5AF3C/5jBQBuWlK5ZE1BG0bR5cbqA9MKiXyuhB85b663kT LBthgjCNXew2OH/FVAySPzHEa88kYz/NpeX1hvsceFp+kVHsfoGKPHeOaR+OnAZYnNh0cS 8UsZlT3euUPgUPpxhs2+m1Q+PcEYAqlwo4br66SQKgpcPCLPJW4WRO865/IytvPu2C1i0Z Nd0C+fkC3Lp6NpZeH287bBrImUlv0KoXtW0VcM/YWHtNzGlbRbgHy28OYdJfTg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1698156604; a=rsa-sha256; cv=none; b=LELWFOW59BDjV8SvDwwA/GylIiy9vuSVqdfNBPF6NC/Uh56Sn51CtIDSSoUparywdeJBun DVEFXvPLe3C3ieJc1TW6RgBhBQAOPFbM8cnls9PzvPCpKK1XEHSH+7znMLwN6WlORLJwD3 J6BWXOT/WyW2W3wko2crcL7OOjLjMdHLrIzhOL2y2/fjGN2+sToDeyv27M9/Sf6iUC9QMU dbhcxPeC+P6/lwej0LJm5mMj7DxY+1San0wsJDa65jVgtL24PYz9FUq3b9B/kmbM56xJa9 o39tod5BGpBizo3pBC0yiddk7Ux2y6TyBIwiGOh0tNgFvirh/9tys+x4XUajvg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=XO5tFxOf; 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"; dmarc=none Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qvI6D-0000v8-2a; Tue, 24 Oct 2023 10:09:37 -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 1qvI68-0000uW-OC for guix-patches@gnu.org; Tue, 24 Oct 2023 10:09:32 -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 1qvI68-0004xc-G7 for guix-patches@gnu.org; Tue, 24 Oct 2023 10:09:32 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qvI6b-0007CO-Qb; Tue, 24 Oct 2023 10:10:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#66728] [PATCH] gnu: rust-analyzer: Replace with version from rust. Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: efraim@flashner.co.il, guix-patches@gnu.org Resent-Date: Tue, 24 Oct 2023 14:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 66728 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 66728@debbugs.gnu.org Cc: 873216071@qq.com, Efraim Flashner , Distopico , Efraim Flashner X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Efraim Flashner Received: via spool by submit@debbugs.gnu.org id=B.169815658027637 (code B ref -1); Tue, 24 Oct 2023 14:10:01 +0000 Received: (at submit) by debbugs.gnu.org; 24 Oct 2023 14:09:40 +0000 Received: from localhost ([127.0.0.1]:56054 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qvI6G-0007Bg-0f for submit@debbugs.gnu.org; Tue, 24 Oct 2023 10:09:40 -0400 Received: from lists.gnu.org ([2001:470:142::17]:58138) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qvI6C-0007BR-6Q for submit@debbugs.gnu.org; Tue, 24 Oct 2023 10:09:38 -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 1qvI5b-0000oe-9I for guix-patches@gnu.org; Tue, 24 Oct 2023 10:08:59 -0400 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvI5Y-0004sf-Jt for guix-patches@gnu.org; Tue, 24 Oct 2023 10:08:58 -0400 Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-5079f9675c6so7138928e87.2 for ; Tue, 24 Oct 2023 07:08:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698156535; x=1698761335; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:from:to:cc:subject:date:message-id:reply-to; bh=WDCOFS2tpi35bDcxZEeriQxs1vcrsBxSIWU9IcMx5ic=; b=XO5tFxOfoAVL6XFlmDphKf66PG9v/jKRNMDBfitfQNA2hcb0zENWi9nokK5WbBrMz2 3JTgnFyCrVWrTzazaaqVskzha9AQyVcUv6dWej78DpM4NETV+FzJj6TEwbDGscbpuZgU 8pS2HksIjae1QG+WhTTJH7BM+cEdTtD24xGlyXN1WeD4nlekQMgg6mqz30sQ5tSnGzFO LNjbhfdsin/azelRNLpSno7Y+YPJ0uF68ZQziOJRUYOO36iw/45YZR7M2oeSdUf1YIdj HBqgCkBS82uuVt/3er0l87OqmDfu5pBZcpUn1yTRF6JgHXKxhzAoXUugQ53d7b8j94Lx ZEdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698156535; x=1698761335; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=WDCOFS2tpi35bDcxZEeriQxs1vcrsBxSIWU9IcMx5ic=; b=ewWk8XFWE7sD2rCfT84WqID5mVqMUfAfpYGXJoolOBijOnxdu3dXw473pXpGsPhB/w zAS1OUskvCyRfS57tYi8871esoX3/MPqOcPiu5NOUI//51KrSKHHd0Vl/nnCe36Izy1H dP/jzbCBV70nihbdZFvFUEg5od18s9VmH0Izn1/EOZ2QMwp7wP3EBP5rqRJIy3solqlR qf9Q8EBdqCRZzNX7+ZCuZn84aI8+z60hjFlsC08wYiLmeV4hrhxI+Dd1G1P2DrqJfW/q a9F9onv8sYWbAaPFSF3423HUgn9sph7rBmDXTsAXEhtclkdsb/+HnqmfedgxLazFwH7B llDg== X-Gm-Message-State: AOJu0YyHxr+PDdvosHoB+Sw5pm8DJU7re6w2RUOpUHoNl+Rqg08wTnkN xWNsX2K8aU2zPuC/NFs3KpkUhcB7NA0j0w== X-Google-Smtp-Source: AGHT+IHk06fZx5HR9l1Fun8Oob2SNNOBVASzurYbmKzWBjnpc9vKcx4bA6x0PstAMu8h6anPu1n+eA== X-Received: by 2002:a05:6512:3132:b0:500:d960:8b6d with SMTP id p18-20020a056512313200b00500d9608b6dmr8914176lfd.33.1698156534298; Tue, 24 Oct 2023 07:08:54 -0700 (PDT) Received: from localhost ([31.210.180.106]) by smtp.gmail.com with ESMTPSA id i21-20020a05600c355500b00405bbfd5d16sm12287134wmq.7.2023.10.24.07.08.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 07:08:53 -0700 (PDT) From: Efraim Flashner Date: Tue, 24 Oct 2023 17:07:13 +0300 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::12a; envelope-from=efraim.flashner@gmail.com; helo=mail-lf1-x12a.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Spam-Score: 1.88 X-Migadu-Queue-Id: B36146A2E5 X-Migadu-Scanner: mx0.migadu.com X-Migadu-Spam-Score: 1.88 X-TUID: QhWaOzD5vd8B * 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 (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\" \"$@\"" - (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)) + (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 -- Efraim Flashner רנשלפ םירפא GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted