diff mbox series

[bug#53208,38/39] gnu: rust-analyzer: Update to 2022-01-10.

Message ID tencent_DDA6BCB544AEF678B32DB53DCBECAF4E8705@qq.com
State Accepted
Headers show
Series [bug#53208,01/39] gnu: Add rust-typed-arena-2. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Z572 Jan. 12, 2022, 3:27 p.m. UTC
* gnu/packages/rust-apps.scm (rust-analyzer): Update to 2022-01-10.
[arguments]: Add #:rust rust-1.57.
<#:cargo-test-flags>: Skip two fail test.
<#:cargo-inputs>:
Add rust-typed-arena-2. Remove rust-tracing-tree-0.1
Use rust-cargo-metadata-0.14 replace rust-cargo-metadata-0.13,
use rust-chalk-ir-0.75 replace rust-chalk-ir-0.68,
use rust-chalk-recursive-0.75 replace rust-chalk-recursive-0.68,
use rust-countme-3 replace rust-countme-2,
use rust-cov-mark-2 replace rust-cov-mark-1,
use rust-lsp-types-0.91 replace rust-lsp-types-0.89,
use rust-memmap2-0.5 replace rust-memmap2-0.2,
use rust-miow-0.4 replace rust-miow-0.3,
use rust-object-0.28 replace rust-object-0.24,
use rust-pulldown-cmark-to-cmark-7 replace rust-pulldown-cmark-to-cmark-6,
use rust-rowan-0.15 replace rust-rowan-0.13,
use rust-rustc-ap-rustc-lexer-725 replace rust-rustc-ap-rustc-lexer-721.
Move rust-quote-1 to #:cargo-development-inputs,
Move rust-expect-test-1 to #:cargo-development-inputs,
move rust-rayon-1 to #:cargo-development-inputs,
move rust-tracing-0.1 to #:cargo-development-inputs,
move rust-ungrammar-1 to #:cargo-development-inputs.
<#:cargo-development-inputs>:
Add rust-arbitrary-1, rust-derive-arbitrary, rust-tracing-subscriber-0.3,
rust-tracing-tree-0.2.
<#:phases>:
Remove patch-build-failures.
Add install-doc, chdir phase.
Remove replace install phase.
Replace install-license-files phase.
Update fix-tests phase
---
 gnu/packages/rust-apps.scm | 88 +++++++++++++++++++++++---------------
 1 file changed, 53 insertions(+), 35 deletions(-)

Comments

Leo Famulari Jan. 23, 2022, 1 a.m. UTC | #1
On Wed, Jan 12, 2022 at 11:27:58PM +0800, Z572 via Guix-patches via wrote:
> * gnu/packages/rust-apps.scm (rust-analyzer): Update to 2022-01-10.

This patch series caused ~2300 rebuilds on the build farm, if I
understand correctly:

https://ci.guix.gnu.org/eval/56317

Remember: changes that cause more than 300 rebuilds per architecture
may not be pushed to the master branch:

https://guix.gnu.org/manual/en/html_node/Submitting-Patches.html#Submitting-Patches
Nicolas Goaziou Jan. 23, 2022, 8:35 a.m. UTC | #2
Hello,

Leo Famulari <leo@famulari.name> writes:

> This patch series caused ~2300 rebuilds on the build farm, if I
> understand correctly:
>
> https://ci.guix.gnu.org/eval/56317

Ouch! Sorry about the mess.

Fortunately, all packages are rebuilt already, IIUC.

> Remember: changes that cause more than 300 rebuilds per architecture
> may not be pushed to the master branch:
>
> https://guix.gnu.org/manual/en/html_node/Submitting-Patches.html#Submitting-Patches

As you may guess, I know this part (which IMO could be refreshed as the
capacity of the build farm and the number of Guix packages evolved since
2016) of the manual.

What I do not know, however, is how to predict the number of rebuilds
when it comes to Rust packages. Do you have an idea?

Regards,
Leo Famulari Jan. 23, 2022, 6:53 p.m. UTC | #3
On Sun, Jan 23, 2022 at 09:35:10AM +0100, Nicolas Goaziou wrote:
> As you may guess, I know this part (which IMO could be refreshed as the
> capacity of the build farm and the number of Guix packages evolved since
> 2016) of the manual.

I agree about refreshing the guidelines, although I'm waiting until
after the 1.4.0 release to start a discussion about it. Think about
ideas for improving the workflow!

> What I do not know, however, is how to predict the number of rebuilds
> when it comes to Rust packages. Do you have an idea?

It's tough, indeed.

Maybe something like `./pre-inst-env guix build --no-grafts gnome
--dry-run` can reliably give a good answer.

GNOME does depend on Rust packages, in at least two ways: via librsvg
and via rav1e.

------
$ guix graph --path gnome rav1e
gnome@41.0    
tracker-miners@3.1.2
ffmpeg@4.4.1
rav1e@0.5.1
$ guix graph --path gnome librsvg
gnome@41.0    
gnome-control-center@41.2
librsvg@2.50.7
------

And anyways, it's good practice to make sure that GNOME builds after
changing big parts of the dependency graph.

If it's too computationally expensive for you to perform builds like
that, let us know maybe we can provide a solution via ci.guix.gnu.org
diff mbox series

Patch

diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm
index 7dd60dd35b..2831b1401f 100644
--- a/gnu/packages/rust-apps.scm
+++ b/gnu/packages/rust-apps.scm
@@ -9,7 +9,7 @@ 
 ;;; Copyright © 2020–2022 Nicolas Goaziou <mail@nicolasgoaziou.fr>
 ;;; Copyright © 2021 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2021 Sharlatan Hellseher <sharlatanus@gmail.ccom>
-;;; Copyright © 2021 Zheng Junjie <873216071@qq.com>
+;;; Copyright © 2021, 2022 Zheng Junjie <873216071@qq.com>
 ;;; Copyright © 2021 Alexandru-Sergiu Marton <brown121407@posteo.ro>
 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
@@ -1161,7 +1161,7 @@  (define-public watchexec
 (define-public rust-analyzer
   (package
     (name "rust-analyzer")
-    (version "2021-06-07")
+    (version "2022-01-10")
     (source
      (origin
        ;; The crate at "crates.io" is empty.
@@ -1172,35 +1172,52 @@  (define-public rust-analyzer
        (file-name (git-file-name name version))
        (sha256
         (base32
-         "06bc3s5kjwpyr2cq79p0306a9bqp3xp928d750ybby9npq2dvj3z"))))
+         "1ci85bp8xwqrk8nqr8sh6yj8njgd98nhgnhaks2g00c77wwyra41"))))
     (build-system cargo-build-system)
     (arguments
      `(#:install-source? #f             ; virtual manifest
+       #:rust ,rust-1.57
        #: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"
+         ;; 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::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-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.1)
+        ("rust-quote" ,rust-quote-1)
+        ("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-backtrace" ,rust-backtrace-0.3)
-        ("rust-cargo-metadata" ,rust-cargo-metadata-0.13)
+        ("rust-cargo-metadata" ,rust-cargo-metadata-0.14)
         ("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-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-dashmap" ,rust-dashmap-4)
         ("rust-dissimilar" ,rust-dissimilar-1)
@@ -1209,7 +1226,6 @@  (define-public rust-analyzer
         ("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)
@@ -1220,29 +1236,27 @@  (define-public rust-analyzer
         ("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-lsp-types" ,rust-lsp-types-0.91)
+        ("rust-memmap2" ,rust-memmap2-0.5)
         ("rust-mimalloc" ,rust-mimalloc-0.1)
-        ("rust-miow" ,rust-miow-0.3)
+        ("rust-miow" ,rust-miow-0.4)
         ("rust-notify" ,rust-notify-5)
-        ("rust-object" ,rust-object-0.24)
+        ("rust-object" ,rust-object-0.28)
         ("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-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)
         ("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)
@@ -1250,10 +1264,6 @@  (define-public rust-analyzer
         ("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)
@@ -1262,24 +1272,32 @@  (define-public rust-analyzer
         ("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)
+           (lambda _
              (let ((bash (string-append "#!" (which "bash"))))
-               (with-directory-excursion "crates/syntax/test_data/lexer/ok"
-                 (substitute* "0010_single_line_comments.txt"
+               (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))))))
-         (replace 'install
+         (add-before 'install 'install-doc
            (lambda* (#:key outputs #:allow-other-keys)
-             (install-file "target/release/rust-analyzer"
-                           (string-append (assoc-ref outputs "out")
-                                          "/bin")))))))
+             (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")))
+         (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)))))))
     (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