~ruther/guix-local

44b94a9276f39a653d68bd443c0aa0c3d05e471f — Brennan Vincent 1 year, 1 month ago d76575b
gnu: rust: Install stdlib manifest with original checksums.

* gnu/packages/rust.scm (rust)[arguments]: Install stdlib manifest with
the original checksums.

Change-Id: I1100ffe4ff67c8e2026e802fc3902ec218e2efee
Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
1 files changed, 17 insertions(+), 0 deletions(-)

M gnu/packages/rust.scm
M gnu/packages/rust.scm => gnu/packages/rust.scm +17 -0
@@ 1475,12 1475,29 @@ safety and thread safety guarantees.")
                 (invoke "./x.py" "install" "clippy")
                 (invoke "./x.py" "install" "rust-analyzer")
                 (invoke "./x.py" "install" "rustfmt")))
             (add-before 'patch-cargo-checksums 'save-old-library-manifest
               (lambda _
                 (copy-file "library/Cargo.lock" ".old-library-manifest")))
             (add-after 'install 'install-rust-src
               (lambda* (#:key outputs #:allow-other-keys)
                 (let ((out (assoc-ref outputs "rust-src"))
                       (dest "/lib/rustlib/src/rust"))
                   (mkdir-p (string-append out dest))
                   (copy-recursively "library" (string-append out dest "/library"))
                   ;; rust-analyzer needs the original checksums; otherwise
                   ;; it fails to cargo manifest in the stdlib, and then
                   ;; analysis/inference involving stdlib structs doesn't work.
                   ;;
                   ;; For example, in the following trivial program:
                   ;;
                   ;; fn main() {
                   ;;     let x = Vec::<usize>::new();
                   ;; }
                   ;;
                   ;; rust-analyzer since version 1.82 can't infer
                   ;; the type of x unless the following line is present.
                   (copy-file ".old-library-manifest"
                              (string-append out dest "/library/Cargo.lock"))
                   (copy-recursively "src" (string-append out dest "/src")))))
             (add-before 'install 'remove-uninstall-script
               (lambda _