summary refs log tree commit diff
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2022-07-05 10:26:03 +0300
committerEfraim Flashner <efraim@flashner.co.il>2022-07-05 12:52:48 +0300
commit5cf9a03b7a86de9b7cc696fe4e45a650a4196b99 (patch)
treeb303135f9f43b0d610a406aad9780d1cdce7913b
parent9061ac29af057edbed625e4f5d38f0cb0740d09e (diff)
downloadguix-5cf9a03b7a86de9b7cc696fe4e45a650a4196b99.tar.gz
gnu: rust: Bootstrap with rust-1.54.0.
* gnu/packages/rust.scm (rust-1.39): Rename to rust-bootstrap. Update to
1.54.0.
[source]: Update snippet to new version. Replace mrustc patch for 1.39.0
with patch for 1.54.0.
[inputs]: Remove libssh2. Replace llvm-9 with llvm. Add gcc-9.
[arguments]: Adjust custom 'setup-mrustc-sources to also create file
with rust version. Adjust custom 'patch-makefiles phase to changes in
mrustc's build steps. Adjust custom 'build phase to follow mrustc's
build steps for rust-1.54.
(rust-1.40): Replace post-bootstrapped rust-1.40 with 1.55.
[arguments]: Add custom 'set-linker-locale-to-utf8 phase. Adjust custom
'build phase. Remove custom 'neuter-tidy phase.
[inputs]: Replace llvm-9 with llvm.
(rust-1.41, rust-1.42, rust-1.43, rust-1.44, rust-1.45, rust-1.46,
rust-1.47, rust-1.48, rust-1.49, rust-1.50, rust-1.51, rust-1.52,
rust-1.53): Remove variables.

* gnu/packages/patches/rust-1.39.0-src.patch: Remove file.
* gnu/packages/patches/rust-1.54.0-src.patch: Add file.
* gnu/local.mk (dist_patch_DATA): Register changes.
-rw-r--r--gnu/local.mk2
-rw-r--r--gnu/packages/patches/rustc-1.39.0-src.patch99
-rw-r--r--gnu/packages/patches/rustc-1.54.0-src.patch117
-rw-r--r--gnu/packages/rust.scm238
4 files changed, 182 insertions, 274 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index f8ccbd34ec..be6d37fc26 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1769,7 +1769,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/rocm-opencl-runtime-4.3-noopencl.patch \
   %D%/packages/patches/ruby-mustache-1.1.1-fix-race-condition-tests.patch \
   %D%/packages/patches/ruby-sanitize-system-libxml.patch	\
-  %D%/packages/patches/rustc-1.39.0-src.patch			\
+  %D%/packages/patches/rustc-1.54.0-src.patch			\
   %D%/packages/patches/rust-adblock-ignore-live-tests.patch		\
   %D%/packages/patches/i3status-rust-enable-unstable-features.patch	\
   %D%/packages/patches/rust-ndarray-remove-blas-src-dep.patch	\
diff --git a/gnu/packages/patches/rustc-1.39.0-src.patch b/gnu/packages/patches/rustc-1.39.0-src.patch
deleted file mode 100644
index 7859bd44d5..0000000000
--- a/gnu/packages/patches/rustc-1.39.0-src.patch
+++ /dev/null
@@ -1,99 +0,0 @@
-# This modified patch is to disable the hunk applying to LLVM, unbundled in Guix.
-
-# Add mrustc slice length intrinsics
---- src/libcore/intrinsics.rs
-+++ src/libcore/intrinsics.rs
-@@ -685,4 +685,8 @@
-     pub fn min_align_of_val<T: ?Sized>(_: &T) -> usize;
- 
-+    /// Obtain the length of a slice pointer
-+    #[cfg(rust_compiler="mrustc")]
-+    pub fn mrustc_slice_len<T>(pointer: *const [T]) -> usize;
-+
-     /// Gets a static string slice containing the name of a type.
-     pub fn type_name<T: ?Sized>() -> &'static str;
-
---- src/libcore/slice/mod.rs
-+++ src/libcore/slice/mod.rs
-@@ -68,5 +68,8 @@
-     pub const fn len(&self) -> usize {
--        unsafe {
--            crate::ptr::Repr { rust: self }.raw.len
--        }
-+        #[cfg(not(rust_compiler="mrustc"))]
-+        #[cfg_attr(not(bootstrap), allow_internal_unstable(const_fn_union))]
-+        const fn len_inner<T>(s: &[T]) -> usize { unsafe { crate::ptr::Repr { rust: s }.raw.len } };
-+        #[cfg(rust_compiler="mrustc")]
-+        const fn len_inner<T>(s: &[T]) -> usize { unsafe { crate::intrinsics::mrustc_slice_len(s) } }
-+        len_inner(self)
-     }
-#
-# Static-link rustc_codegen_llvm so the generated rustc is standalone
-# > Note: Interacts with `rustc-1.39.0-overrides.toml`
-#
---- src/librustc_interface/util.rs
-+++ src/librustc_interface/util.rs
-@@ -421,2 +421,4 @@
- pub fn get_codegen_sysroot(backend_name: &str) -> fn() -> Box<dyn CodegenBackend> {
-+    #[cfg(rust_compiler="mrustc")]
-+    { if(backend_name == "llvm") { extern "Rust" { fn __rustc_codegen_backend() -> Box<dyn CodegenBackend>; } return || unsafe { __rustc_codegen_backend() } } }
-     // For now we only allow this function to be called once as it'll dlopen a
-# Disable most architecture intrinsics
---- src/stdarch/crates/std_detect/src/detect/mod.rs
-+++ src/stdarch/crates/std_detect/src/detect/mod.rs
-@@ -74,4 +74,7 @@
-         // this run-time detection logic is never called.
-         #[path = "os/other.rs"]
-         mod os;
-+    } else if #[cfg(rust_compiler="mrustc")] {
-+        #[path = "os/other.rs"]
-+        mod os;
-     } else if #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] {
---- vendor/ppv-lite86/src/lib.rs
-+++ vendor/ppv-lite86/src/lib.rs
-@@ -12,10 +12,10 @@
--#[cfg(all(feature = "simd", target_arch = "x86_64", not(miri)))]
-+#[cfg(all(feature = "simd", target_arch = "x86_64", not(miri), not(rust_compiler="mrustc")))]
- pub mod x86_64;
--#[cfg(all(feature = "simd", target_arch = "x86_64", not(miri)))]
-+#[cfg(all(feature = "simd", target_arch = "x86_64", not(miri), not(rust_compiler="mrustc")))]
- use self::x86_64 as arch;
-
--#[cfg(any(miri, not(all(feature = "simd", any(target_arch = "x86_64")))))]
-+#[cfg(any(miri, rust_compiler="mrustc", not(all(feature = "simd", any(target_arch = "x86_64")))))]
- pub mod generic;
--#[cfg(any(miri, not(all(feature = "simd", any(target_arch = "x86_64")))))]
-+#[cfg(any(miri, rust_compiler="mrustc", not(all(feature = "simd", any(target_arch = "x86_64")))))]
- use self::generic as arch;
-
-# diff --git a/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h b/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h
-# index da9d9d5bfdc0..3d47471f0ef0 100644
-# --- src/llvm-project/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h
-# +++ src/llvm-project/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h
-# @@ -16,6 +16,8 @@
-#  #include "llvm/Demangle/DemangleConfig.h"
-#  #include "llvm/Demangle/StringView.h"
-#  #include <array>
-# +#include <cstdint>
-# +#include <string>
-
-#  namespace llvm {
-#  namespace itanium_demangle {
-##
-## gcc (used by mrustc) has 16-byte uint128_t alignment, while rustc uses 8
-##
-#--- src/libsyntax/ast.rs
-#+++ src/libsyntax/ast.rs
-#@@ -986,2 +986,2 @@
-#-#[cfg(target_arch = "x86_64")]
-#-static_assert_size!(Expr, 96);
-#+//#[cfg(target_arch = "x86_64")]
-#+//static_assert_size!(Expr, 96);
-#--- src/librustc/ty/sty.rs
-#+++ src/librustc/ty/sty.rs
-#@@ -2258,2 +2258,2 @@
-#-#[cfg(target_arch = "x86_64")]
-#-static_assert_size!(Const<'_>, 40);
-#+//#[cfg(target_arch = "x86_64")]
-#+//static_assert_size!(Const<'_>, 40);
-
diff --git a/gnu/packages/patches/rustc-1.54.0-src.patch b/gnu/packages/patches/rustc-1.54.0-src.patch
new file mode 100644
index 0000000000..d075dce39b
--- /dev/null
+++ b/gnu/packages/patches/rustc-1.54.0-src.patch
@@ -0,0 +1,117 @@
+# mrustc is much better at enum packing, so causes almost all of these to be smaller by one pointer
+--- compiler/rustc_ast/src/ast.rs
++++ compiler/rustc_ast/src/ast.rs
+@@ -1075,7 +1075,7 @@ pub struct Expr {
+ }
+ 
+ // `Expr` is used a lot. Make sure it doesn't unintentionally get bigger.
+-#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
++#[cfg(all(not(rust_compiler = "mrustc"), target_arch = "x86_64", target_pointer_width = "64"))]
+ rustc_data_structures::static_assert_size!(Expr, 104);
+ 
+ impl Expr {
+@@ -2779,7 +2779,7 @@ pub enum AssocItemKind {
+     MacCall(MacCall),
+ }
+ 
+-#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
++#[cfg(all(not(rust_compiler = "mrustc"), target_arch = "x86_64", target_pointer_width = "64"))]
+ rustc_data_structures::static_assert_size!(AssocItemKind, 72);
+ 
+ impl AssocItemKind {
+@@ -2831,7 +2831,7 @@ pub enum ForeignItemKind {
+     MacCall(MacCall),
+ }
+ 
+-#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
++#[cfg(all(not(rust_compiler="mrustc"),target_arch = "x86_64", target_pointer_width = "64"))]
+ rustc_data_structures::static_assert_size!(ForeignItemKind, 72);
+ 
+ impl From<ForeignItemKind> for ItemKind {
+--- compiler/rustc_hir/src/hir.rs
++++ compiler/rustc_hir/src/hir.rs
+@@ -3050,3 +3050,3 @@
+ // Some nodes are used a lot. Make sure they don't unintentionally get bigger.
+-#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
++#[cfg(all(not(rust_compiler="mrustc"),target_arch = "x86_64", target_pointer_width = "64"))]
+ mod size_asserts {
+--- compiler/rustc_middle/src/mir/interpret/error.rs
++++ compiler/rustc_middle/src/mir/interpret/error.rs
+@@ -452,2 +452,2 @@
+-#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
++#[cfg(all(not(rust_compiler="mrustc"), target_arch = "x86_64", target_pointer_width = "64"))]
+ static_assert_size!(InterpError<'_>, 64);
+--- compiler/rustc_middle/src/mir/mod.rs
++++ compiler/rustc_middle/src/mir/mod.rs
+@@ -2203,2 +2203,2 @@
+-#[cfg(target_arch = "x86_64")]
++#[cfg(all(not(rust_compiler="mrustc"), target_arch = "x86_64"))]
+ static_assert_size!(AggregateKind<'_>, 48);
+--- compiler/rustc_middle/src/thir.rs
++++ compiler/rustc_middle/src/thir.rs
+@@ -147,2 +147,2 @@
+-#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
++#[cfg(all(not(rust_compiler="mrustc"), target_arch = "x86_64", target_pointer_width = "64"))]
+ rustc_data_structures::static_assert_size!(Expr<'_>, 144);
+--- compiler/rustc_mir/src/interpret/place.rs
++++ compiler/rustc_mir/src/interpret/place.rs
+@@ -91,2 +91,2 @@
+-#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
++#[cfg(all(not(rust_compiler = "mrustc"), target_arch = "x86_64", target_pointer_width = "64"))]
+ rustc_data_structures::static_assert_size!(Place, 64);
+@@ -100,2 +100,2 @@
+-#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
++#[cfg(all(not(rust_compiler = "mrustc"), target_arch = "x86_64", target_pointer_width = "64"))]
+ rustc_data_structures::static_assert_size!(PlaceTy<'_>, 80);
+--- compiler/rustc_mir/src/interpret/operand.rs
++++ compiler/rustc_mir/src/interpret/operand.rs
+@@ -35,2 +35,2 @@
+-#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
++#[cfg(all(not(rust_compiler = "mrustc"), target_arch = "x86_64", target_pointer_width = "64"))]
+ rustc_data_structures::static_assert_size!(Immediate, 56);
+@@ -90,2 +90,2 @@
+-#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
++#[cfg(all(not(rust_compiler = "mrustc"), target_arch = "x86_64", target_pointer_width = "64"))]
+ rustc_data_structures::static_assert_size!(ImmTy<'_>, 72);
+
+#
+# Disable crc32fast's use of stdarch
+#
+--- vendor/crc32fast/src/specialized/mod.rs
++++ vendor/crc32fast/src/specialized/mod.rs
+@@ -1,5 +1,6 @@
+ cfg_if! {
+     if #[cfg(all(
++        not(rust_compiler = "mrustc"),
+         crc32fast_stdarchx86,
+         any(target_arch = "x86", target_arch = "x86_64")
+     ))] {
+
+#
+# Disable std_detect's detection logic (use the same logic as miri)
+#
+--- library/stdarch/crates/std_detect/src/detect/mod.rs
++++ library/stdarch/crates/std_detect/src/detect/mod.rs
+@@ -88,2 +88,2 @@
+ cfg_if! {
+-    if #[cfg(miri)] {
++    if #[cfg(any(miri, rust_compiler = "mrustc"))] {
+
+# PPV-Lite also needs to know that we're pretending to be miri
+--- vendor/ppv-lite86/src/lib.rs
++++ vendor/ppv-lite86/src/lib.rs
+@@ -12,9 +12,9 @@
+-#[cfg(all(feature = "simd", target_arch = "x86_64", not(miri)))]
++#[cfg(all(feature = "simd", target_arch = "x86_64", not(miri), not(rust_compiler = "mrustc")))]
+ pub mod x86_64;
+-#[cfg(all(feature = "simd", target_arch = "x86_64", not(miri)))]
++#[cfg(all(feature = "simd", target_arch = "x86_64", not(miri), not(rust_compiler = "mrustc")))]
+ use self::x86_64 as arch;
+ 
+-#[cfg(any(miri, not(all(feature = "simd", any(target_arch = "x86_64")))))]
++#[cfg(any(miri, rust_compiler = "mrustc", not(all(feature = "simd", any(target_arch = "x86_64")))))]
+ pub mod generic;
+-#[cfg(any(miri, not(all(feature = "simd", any(target_arch = "x86_64")))))]
++#[cfg(any(miri, rust_compiler = "mrustc", not(all(feature = "simd", any(target_arch = "x86_64")))))]
+ use self::generic as arch;
+
diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index 67dc5cdaf3..fa8a96d7cf 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -4,7 +4,7 @@
 ;;; Copyright © 2016 Nikita <nikita@n0.is>
 ;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
 ;;; Copyright © 2017, 2018 Nikolai Merinov <nikolai.merinov@member.fsf.org>
-;;; Copyright © 2017, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2017, 2019-2022 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Danny Milosavljevic <dannym+a@scratchpost.org>
 ;;; Copyright © 2019 Ivan Petkov <ivanppetkov@gmail.com>
@@ -138,23 +138,23 @@
        (base32
         "0f7kh4n2663sn0z3xib8gzw0s97qpvwag40g2vs3bfjlrbpgi9z0")))))
 
-;;; Rust 1.39 is special in that it is built with mrustc, which shortens the
+;;; Rust 1.54 is special in that it is built with mrustc, which shortens the
 ;;; bootstrap path.
-(define rust-1.39
+(define rust-bootstrap
   (package
     (name "rust")
-    (version "1.39.0")
+    (version "1.54.0")
     (source
      (origin
        (method url-fetch)
        (uri (rust-uri version))
-       (sha256 (base32 "0mwkc1bnil2cfyf6nglpvbn2y0zfbv44zfhsd5qg4c9rm6vgd8dl"))
+       (sha256 (base32 "0xk9dhfff16caambmwij67zgshd8v9djw6ha0fnnanlv7rii31dc"))
        (modules '((guix build utils)))
-       (snippet '(for-each delete-file-recursively
-                           '("src/llvm-emscripten"
-                             "src/llvm-project"
-                             "vendor/jemalloc-sys/jemalloc")))
-       (patches (search-patches "rustc-1.39.0-src.patch"))
+       (snippet
+        '(begin
+           (for-each delete-file-recursively
+                     '("src/llvm-project"))))
+       (patches (search-patches "rustc-1.54.0-src.patch"))
        (patch-flags '("-p0"))))         ;default is -p1
     (outputs '("out" "cargo"))
     (properties '((timeout . 72000)           ;20 hours
@@ -162,12 +162,15 @@
     (build-system gnu-build-system)
     (inputs
      `(("libcurl" ,curl)
-       ("libssh2" ,libssh2)
-       ("llvm" ,llvm-9)
+       ("llvm" ,llvm)
        ("openssl" ,openssl)
        ("zlib" ,zlib)))
     (native-inputs
      `(("bison" ,bison)
+       ;; A compiler bug in gcc 10/11/12/13 prevents us from using gcc-10.4. See:
+       ;; https://github.com/thepowersgang/mrustc/issues/266
+       ;; https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105860
+       ("gcc" ,gcc-9)
        ("flex" ,flex)
        ("pkg-config" ,pkg-config)
        ;; Required for the libstd sources.
@@ -206,25 +209,24 @@
              ;; to be at this location, and it simplifies things to make it
              ;; so.
              (symlink (getcwd)
-                      (string-append "../mrustc/rustc-" ,version "-src"))))
+                      (string-append "../mrustc/rustc-" ,version "-src"))
+             (with-output-to-file "dl-version"
+               (lambda _
+                 (format #t "~a~%"
+                         ,version)))))
          (add-after 'setup-mrustc-sources 'patch-makefiles
            ;; This disables building the (unbundled) LLVM.
            (lambda* (#:key inputs parallel-build? #:allow-other-keys)
-             (let ((llvm (assoc-ref inputs "llvm"))
-                   (job-spec (format #f "-j~a"
-                                     (if parallel-build?
-                                         (number->string (parallel-job-count))
-                                         "1"))))
+             (let ((llvm (assoc-ref inputs "llvm")))
                (with-directory-excursion "../mrustc"
                  (substitute* '("minicargo.mk"
                                 "run_rustc/Makefile")
                    ;; Use the system-provided LLVM.
                    (("LLVM_CONFIG := .*")
-                    (string-append "LLVM_CONFIG := " llvm "/bin/llvm-config\n"))
-                   (("\\$\\(LLVM_CONFIG\\): .*")
-                    "$(LLVM_CONFIG):\n")
-                   (("\\$Vcd \\$\\(RUSTCSRC\\)build && \\$\\(MAKE\\).*")
-                    "true\n"))
+                    (string-append "LLVM_CONFIG := " llvm "/bin/llvm-config\n")))
+                 (substitute* "minicargo.mk"
+                   ;; Do not try to fetch sources from the Internet.
+                   (("@curl.*") ""))
                  (substitute* "Makefile"
                    ;; Patch date and git obtained version information.
                    ((" -D VERSION_GIT_FULLHASH=.*")
@@ -269,9 +271,6 @@
              (setenv "CXX" "g++")
              ;; The Guix LLVM package installs only shared libraries.
              (setenv "LLVM_LINK_SHARED" "1")
-             ;; This is a workaround for
-             ;; https://github.com/thepowersgang/mrustc/issues/138.
-             (setenv "LIBSSH2_SYS_USE_PKG_CONFIG" "yes")
              ;; rustc still insists on having 'cc' on PATH in some places
              ;; (e.g. when building the 'test' library crate).
              (mkdir-p "/tmp/bin")
@@ -283,22 +282,36 @@
              (let* ((src-root (getcwd))
                     (job-count (if parallel-build?
                                    (parallel-job-count)
-                                   1))
-                    (job-spec (string-append "-j" (number->string job-count))))
+                                   1)))
                ;; Adapted from:
-               ;; https://github.com/dtolnay/bootstrap/blob/master/build.sh.
+               ;; https://github.com/dtolnay/bootstrap/blob/master/build-1.54.0.sh.
                (chdir "../mrustc")
-               (setenv "MINICARGO_FLAGS" job-spec)
+               ;; Use PARLEVEL since both minicargo and mrustc use it
+               ;; to set the level of parallelism.
+               (setenv "PARLEVEL" (number->string job-count))
                (setenv "CARGO_BUILD_JOBS" (number->string job-count))
+               (display "Building mrustc...\n")
+               (apply invoke "make" make-flags)
+
+               ;; This doesn't seem to build anything, but it
+               ;; sets additional minicargo flags.
+               (display "Building RUSTCSRC...\n")
+               (apply invoke "make" "RUSTCSRC" make-flags)
+
+               ;; This probably doesn't need to be called explicitly.
+               (display "Building LIBS...\n")
+               (apply invoke "make" "-f" "minicargo.mk" "LIBS" make-flags)
+
                (display "Building rustc...\n")
                (apply invoke "make" "-f" "minicargo.mk" "output/rustc"
-                      job-spec make-flags)
+                      make-flags)
+
                (display "Building cargo...\n")
                (apply invoke "make" "-f" "minicargo.mk" "output/cargo"
-                      job-spec make-flags)
+                      make-flags)
+
+               ;; This one isn't listed in the build script.
                (display "Rebuilding stdlib with rustc...\n")
-               ;; Note: invoking make with -j would cause a compiler error
-               ;; (unexpected panic).
                (apply invoke "make" "-C" "run_rustc" make-flags))))
          (replace 'install
            (lambda* (#:key inputs outputs #:allow-other-keys)
@@ -331,35 +344,23 @@ safety and thread safety guarantees.")
     ;; Dual licensed.
     (license (list license:asl2.0 license:expat))))
 
-(define rust-1.40
+(define rust-1.55
   (package
     (name "rust")
-    (version "1.40.0")
+    (version "1.55.0")
     (source
      (origin
        (method url-fetch)
        (uri (rust-uri version))
-       (sha256 (base32 "1ba9llwhqm49w7sz3z0gqscj039m53ky9wxzhaj11z6yg1ah15yx"))
+       (sha256 (base32 "07l28f7grdmi65naq71pbmvdd61hwcpi40ry7kp7dy7m233rldxj"))
        (modules '((guix build utils)))
-       ;; llvm-emscripten is no longer bundled, as that codegen backend got
-       ;; removed.
        (snippet '(for-each delete-file-recursively
                            '("src/llvm-project"
-                             "vendor/jemalloc-sys/jemalloc")))))
+                             "vendor/tikv-jemalloc-sys/jemalloc")))))
     (outputs '("out" "cargo"))
     (properties '((timeout . 72000)           ;20 hours
                   (max-silent-time . 18000))) ;5 hours (for armel)
     (build-system gnu-build-system)
-    ;; Rust 1.40 does not ship rustc-internal libraries by default (see
-    ;; rustc-dev-split). This means that librustc_driver.so is no longer
-    ;; available in lib/rustlib/$target/lib, which is the directory
-    ;; included in the runpath of librustc_codegen_llvm-llvm.so.  This is
-    ;; detected by our validate-runpath phase as an error, but it is
-    ;; harmless as the codegen backend is loaded by librustc_driver.so
-    ;; itself, which must at that point have been already loaded.  As such,
-    ;; we skip validating the runpath for Rust 1.40.  Rust 1.41 stopped
-    ;; putting the codegen backend in a separate library, which makes this
-    ;; workaround only necessary for this release.
     (arguments
      `(#:validate-runpath? #f
        ;; Only the final Rust is tested, not the intermediate bootstrap ones,
@@ -380,24 +381,16 @@ safety and thread safety guarantees.")
              (setenv "CC" (search-input-file inputs "/bin/gcc"))
              ;; The Guix LLVM package installs only shared libraries.
              (setenv "LLVM_LINK_SHARED" "1")))
+         (add-after 'unpack 'set-linker-locale-to-utf8
+           (lambda _
+             (substitute* (find-files "." "^linker.rs$")
+               (("linker.env\\(\"LC_ALL\", \"C\"\\);")
+                "linker.env(\"LC_ALL\", \"en_US.UTF-8\");"))))
          (add-after 'unpack 'add-cc-shim-to-path
            (lambda _
              (mkdir-p "/tmp/bin")
              (symlink (which "gcc") "/tmp/bin/cc")
              (setenv "PATH" (string-append "/tmp/bin:" (getenv "PATH")))))
-         (add-after 'unpack 'neuter-tidy
-           ;; We often need to patch tests with various Guix-specific paths.
-           ;; This often increases the line length and makes tidy, rustc's
-           ;; style checker, complain.  We could insert additional newlines or
-           ;; add an "// ignore-tidy-linelength" comment, but as an ignore
-           ;; comment must be used, both approaches are fragile due to
-           ;; upstream formatting changes.  As such, disable running the
-           ;; linter during tests, since it's intended for rustc developers
-           ;; anyway.
-           (lambda _
-             (substitute* "src/bootstrap/builder.rs"
-               ((".*::Tidy,.*")
-                ""))))
          (replace 'configure
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
@@ -443,13 +436,14 @@ ar = \"" binutils "/bin/ar" "\"
 [dist]
 ") port))))))
          (replace 'build
+           ;; The standard library source location moved in this release.
            (lambda* (#:key parallel-build? #:allow-other-keys)
              (let ((job-spec (string-append
                               "-j" (if parallel-build?
                                        (number->string (parallel-job-count))
                                        "1"))))
                (invoke "./x.py" job-spec "build" "--stage=1"
-                       "src/libstd"
+                       "library/std"
                        "src/tools/cargo"))))
          (replace 'install
            (lambda* (#:key outputs #:allow-other-keys)
@@ -490,12 +484,12 @@ ar = \"" binutils "/bin/ar" "\"
      `(("cmake" ,cmake-minimal)
        ("pkg-config" ,pkg-config)       ; For "cargo"
        ("python" ,python-wrapper)
-       ("rustc-bootstrap" ,rust-1.39)
-       ("cargo-bootstrap" ,rust-1.39 "cargo")
+       ("rustc-bootstrap" ,rust-bootstrap)
+       ("cargo-bootstrap" ,rust-bootstrap "cargo")
        ("which" ,which)))
     (inputs
      `(("jemalloc" ,jemalloc)
-       ("llvm" ,llvm-9)
+       ("llvm" ,llvm)
        ("openssl" ,openssl)
        ("libssh2" ,libssh2)             ; For "cargo"
        ("libcurl" ,curl)))              ; For "cargo"
@@ -519,10 +513,10 @@ safety and thread safety guarantees.")
     ;; Dual licensed.
     (license (list license:asl2.0 license:expat))))
 
-(define rust-1.41
+(define rust-1.56
   (let ((base-rust (rust-bootstrapped-package
-                    rust-1.40 "1.41.1"
-                    "0ws5x0fxv57fyllsa6025h3q6j9v3m8nb3syl4x0hgkddq0kvj9q")))
+                    rust-1.55 "1.56.1"
+                    "04cmqx7nn63hzz7z27b2b0dj2qx18rck9ifvip43s6dampx8v2f3")))
     (package
       (inherit base-rust)
       (arguments
@@ -539,110 +533,6 @@ safety and thread safety guarantees.")
                     (string-append name "\"" ,%cargo-reference-hash "\"")))
                  (generate-all-checksums "vendor"))))))))))
 
-(define rust-1.42
-  (rust-bootstrapped-package
-   rust-1.41 "1.42.0" "0x9lxs82may6c0iln0b908cxyn1cv7h03n5cmbx3j1bas4qzks6j"))
-
-(define rust-1.43
-  (rust-bootstrapped-package
-   rust-1.42 "1.43.0" "18akhk0wz1my6y9vhardriy2ysc482z0fnjdcgs9gy59kmnarxkm"))
-
-;; This version requires llvm <= 11.
-(define rust-1.44
-  (rust-bootstrapped-package
-   rust-1.43 "1.44.1"
-   "0ww4z2v3gxgn3zddqzwqya1gln04p91ykbrflnpdbmcd575n8bky"))
-
-(define rust-1.45
-  (let ((base-rust (rust-bootstrapped-package
-                    rust-1.44 "1.45.2"
-                    "0273a1g3f59plyi1n0azf21qjzwml1yqdnj5z472crz37qggr8xp")))
-    (package
-      (inherit base-rust)
-      (arguments
-       (substitute-keyword-arguments (package-arguments base-rust)
-         ((#:phases phases)
-          `(modify-phases ,phases
-             (add-after 'unpack 'set-linker-locale-to-utf8
-               (lambda _
-                 (substitute* (find-files "." "^linker.rs$")
-                   (("linker.env\\(\"LC_ALL\", \"C\"\\);")
-                    "linker.env(\"LC_ALL\", \"en_US.UTF-8\");")))))))))))
-
-(define rust-1.46
-  (rust-bootstrapped-package
-   rust-1.45 "1.46.0" "0a17jby2pd050s24cy4dfc0gzvgcl585v3vvyfilniyvjrqknsid"))
-
-(define rust-1.47
-  (let ((base-rust (rust-bootstrapped-package
-                    rust-1.46 "1.47.0"
-                    "07fqd2vp7cf1ka3hr207dnnz93ymxml4935vp74g4is79h3dz19i")))
-    (package/inherit base-rust
-      (arguments
-       (substitute-keyword-arguments (package-arguments base-rust)
-         ((#:phases phases)
-          `(modify-phases ,phases
-             (replace 'build
-               ;; The standard library source location moved in this release.
-               (lambda* (#:key parallel-build? #:allow-other-keys)
-                 (let ((job-spec (string-append
-                                  "-j" (if parallel-build?
-                                           (number->string (parallel-job-count))
-                                           "1"))))
-                   (invoke "./x.py" job-spec "build" "--stage=1"
-                           "library/std"
-                           "src/tools/cargo")))))))))))
-
-(define rust-1.48
-  (rust-bootstrapped-package
-   rust-1.47 "1.48.0" "0fz4gbb5hp5qalrl9lcl8yw4kk7ai7wx511jb28nypbxninkwxhf"))
-
-(define rust-1.49
-  (rust-bootstrapped-package
-   rust-1.48 "1.49.0" "0yf7kll517398dgqsr7m3gldzj0iwsp3ggzxrayckpqzvylfy2mm"))
-
-(define rust-1.50
-  (rust-bootstrapped-package
-   rust-1.49 "1.50.0" "0pjs7j62maiyvkmhp9zrxl528g2n0fphp4rq6ap7aqdv0a6qz5wm"))
-
-(define rust-1.51
-  (rust-bootstrapped-package
-   rust-1.50 "1.51.0" "0ixqkqglv3isxbvl4ldr4byrkx692wghsz3fasy1pn5kr2prnsvs"))
-
-;;; The LLVM requiriment has been bumped to version 10 in Rust 1.52.  Use the
-;;; latest available.
-(define rust-1.52
-  (let ((base-rust (rust-bootstrapped-package
-                    rust-1.51 "1.52.1"
-                    "165zs3xzp9dravybwslqs1qhn35agp6wacmzpymqg3qfdni26vrs")))
-    (package
-      (inherit base-rust)
-      (inputs (alist-replace "llvm" (list llvm-12)
-                             (package-inputs base-rust))))))
-
-(define rust-1.53
-  (rust-bootstrapped-package
-   rust-1.52 "1.53.0" "1f95p259dfp5ca118bg107rj3rqwlswy65dxn3hg8sqgl4wwmxsw"))
-
-(define rust-1.54
-  (let ((base-rust
-         (rust-bootstrapped-package
-          rust-1.53
-          "1.54.0" "0xk9dhfff16caambmwij67zgshd8v9djw6ha0fnnanlv7rii31dc")))
-    (package/inherit base-rust
-      (source
-       (origin
-         (inherit (package-source base-rust))
-         (snippet '(delete-file-recursively "src/llvm-project")))))))
-
-(define rust-1.55
-  (rust-bootstrapped-package
-   rust-1.54 "1.55.0" "07l28f7grdmi65naq71pbmvdd61hwcpi40ry7kp7dy7m233rldxj"))
-
-(define rust-1.56
-  (rust-bootstrapped-package
-   rust-1.55 "1.56.1" "04cmqx7nn63hzz7z27b2b0dj2qx18rck9ifvip43s6dampx8v2f3"))
-
 (define rust-1.57
   (let ((base-rust
          (rust-bootstrapped-package