summaryrefslogtreecommitdiff
path: root/gnu/packages/rust.scm
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2026-01-26 10:44:50 +0200
committerAndreas Enge <andreas@enge.fr>2026-02-21 10:14:48 +0100
commitaf0485d704a7ebf054281ce17227e70039e455db (patch)
tree2f0e5a792cb7536189d89bf19c4f5868824f53e8 /gnu/packages/rust.scm
parent47c4da52080613798b99ff4bceeeaa145d009fb9 (diff)
gnu: rust: Don't keep a reference to previous rust version.
Fixes: guix/guix#5792. * gnu/packages/rust.scm (rust)[arguments]: Update disallowed-references. Add a phase to rewrite references from the input cargo to the output cargo. (make-rust-sysroot/implementation)[arguments]: Remove new phase. Change-Id: Ice6abdf18cba8eb042bfc37025ce0e7686623e46
Diffstat (limited to 'gnu/packages/rust.scm')
-rw-r--r--gnu/packages/rust.scm17
1 files changed, 16 insertions, 1 deletions
diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index 0223e1fdc2e..bffac20657b 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -4,7 +4,7 @@
4;;; Copyright © 2016 Nikita <nikita@n0.is> 4;;; Copyright © 2016 Nikita <nikita@n0.is>
5;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com> 5;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
6;;; Copyright © 2017, 2018 Nikolai Merinov <nikolai.merinov@member.fsf.org> 6;;; Copyright © 2017, 2018 Nikolai Merinov <nikolai.merinov@member.fsf.org>
7;;; Copyright © 2017, 2019-2025 Efraim Flashner <efraim@flashner.co.il> 7;;; Copyright © 2017, 2019-2026 Efraim Flashner <efraim@flashner.co.il>
8;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr> 8;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
9;;; Copyright © 2018 Danny Milosavljevic <dannym+a@scratchpost.org> 9;;; Copyright © 2018 Danny Milosavljevic <dannym+a@scratchpost.org>
10;;; Copyright © 2019 Ivan Petkov <ivanppetkov@gmail.com> 10;;; Copyright © 2019 Ivan Petkov <ivanppetkov@gmail.com>
@@ -1642,6 +1642,11 @@ ge13ca993e8ccb9ba9847cc330696e02839f328f7/jemalloc"))
1642 (substitute-keyword-arguments 1642 (substitute-keyword-arguments
1643 (strip-keyword-arguments '(#:tests?) 1643 (strip-keyword-arguments '(#:tests?)
1644 (package-arguments base-rust)) 1644 (package-arguments base-rust))
1645 ((#:disallowed-references _ '())
1646 (list (this-package-native-input "rustc-bootstrap")
1647 ;; Refer to cargo-bootstrap as #$rustc-bootstrap:cargo.
1648 (gexp-input (this-package-native-input "rustc-bootstrap")
1649 "cargo")))
1645 ((#:modules modules) 1650 ((#:modules modules)
1646 (cons '(srfi srfi-26) modules)) 1651 (cons '(srfi srfi-26) modules))
1647 ((#:phases phases) 1652 ((#:phases phases)
@@ -1899,6 +1904,15 @@ ge13ca993e8ccb9ba9847cc330696e02839f328f7/jemalloc"))
1899 ;; on Guix and it retains a reference to the host's bash. 1904 ;; on Guix and it retains a reference to the host's bash.
1900 (substitute* "src/tools/rust-installer/install-template.sh" 1905 (substitute* "src/tools/rust-installer/install-template.sh"
1901 (("install_uninstaller \"") "# install_uninstaller \"")))) 1906 (("install_uninstaller \"") "# install_uninstaller \""))))
1907 (add-after 'install-rust-src 'dont-reference-previous-cargo-version
1908 (lambda* (#:key outputs #:allow-other-keys)
1909 (with-directory-excursion
1910 (string-append (assoc-ref outputs "rust-src")
1911 "/lib/rustlib/src/rust/src/tools/")
1912 (substitute* (find-files "." "cargo-test-fixture\\.rs")
1913 (("#!.*/bin/cargo")
1914 (string-append "#!" (assoc-ref outputs "cargo")
1915 "/bin/cargo"))))))
1902 (add-after 'install-rust-src 'wrap-rust-analyzer 1916 (add-after 'install-rust-src 'wrap-rust-analyzer
1903 (lambda* (#:key outputs #:allow-other-keys) 1917 (lambda* (#:key outputs #:allow-other-keys)
1904 (let ((bin (string-append (assoc-ref outputs "tools") "/bin"))) 1918 (let ((bin (string-append (assoc-ref outputs "tools") "/bin")))
@@ -2074,6 +2088,7 @@ ar = \"" (search-input-file inputs (string-append "/bin/" #$(ar-for-target targe
2074 (invoke "./x.py" "install" "library/std"))) 2088 (invoke "./x.py" "install" "library/std")))
2075 (delete 'enable-profiling) 2089 (delete 'enable-profiling)
2076 (delete 'install-rust-src) 2090 (delete 'install-rust-src)
2091 (delete 'dont-reference-previous-cargo-version)
2077 (delete 'wrap-rust-analyzer) 2092 (delete 'wrap-rust-analyzer)
2078 (delete 'wrap-rustc))))) 2093 (delete 'wrap-rustc)))))
2079 (inputs 2094 (inputs