From 7bf169f75cb4ffcef1393e702104eed63bc70917 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Sun, 23 Sep 2018 01:19:53 +0200 Subject: [PATCH 1/5] gnu: rust: Hide "ar" entry from rust@1.21.0. * gnu/packages/rust.scm (rust-1.21)[arguments]<#:phases>[remove-ar]: New phase. --- gnu/packages/rust.scm | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index f2794be8a6..7871946883 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -637,8 +637,20 @@ (define-public rust-1.20 #t)))))))))) (define-public rust-1.21 - (rust-bootstrapped-package rust-1.20 "1.21.0" - "1yj8lnxybjrybp00fqhxw8fpr641dh8wcn9mk44xjnsb4i1c21qp")) + (let ((base-rust (rust-bootstrapped-package rust-1.20 "1.21.0" + "1yj8lnxybjrybp00fqhxw8fpr641dh8wcn9mk44xjnsb4i1c21qp"))) + (package + (inherit base-rust) + (arguments + (substitute-keyword-arguments (package-arguments base-rust) + ((#:phases phases) + `(modify-phases ,phases + (add-after 'configure 'remove-ar + (lambda* (#:key inputs #:allow-other-keys) + ;; Remove because toml complains about "unknown field". + (substitute* "config.toml" + (("^ar =.*") "\n")) + #t))))))))) (define-public rust-1.22 (rust-bootstrapped-package rust-1.21 "1.22.1" From a75b8c08c0a28b1243680efccbe59ec5aa88795d Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Mon, 24 Sep 2018 00:37:58 +0200 Subject: [PATCH 2/5] gnu: rust@1.23.0: Inherit from rust@1.22.0. * gnu/packages/rust.scm (rust-1.23)[inherit]: Inherit from rust-1.22. [arguments]: Inherit from rust-1.22. Delete "remove-ar" phase. --- gnu/packages/rust.scm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index 7871946883..6eb71d2787 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -658,7 +658,7 @@ (define-public rust-1.22 (define-public rust-1.23 (package - (inherit rust-1.20) + (inherit rust-1.22) (name "rust") (version "1.23.0") (source (rust-source version "14fb8vhjzsxlbi6yrn1r6fl5dlbdd1m92dn5zj5gmzfwf4w9ar3l")) @@ -666,12 +666,13 @@ (define-public rust-1.23 (native-inputs (alist-replace "cargo-bootstrap" (list rust-bootstrap "cargo") (alist-replace "rustc-bootstrap" (list rust-bootstrap) - (package-native-inputs rust-1.20)))) + (package-native-inputs rust-1.22)))) (arguments - (substitute-keyword-arguments (package-arguments rust-1.20) + (substitute-keyword-arguments (package-arguments rust-1.22) ((#:phases phases) `(modify-phases ,phases (delete 'configure-archiver) + (delete 'remove-ar) (add-after 'unpack 'dont-build-native (lambda _ ;; XXX: Revisit this when we use gcc 6. From 44d530ef095acb78847e917be4bfe70753561ead Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Mon, 24 Sep 2018 00:40:58 +0200 Subject: [PATCH 3/5] gnu: rust@1.23.0: Bootstrap from rust@1.22.0. * gnu/packages/rust.scm (rust-1.23): Bootstrap from rust@1.22.0. --- gnu/packages/rust.scm | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index 6eb71d2787..25ced10d9c 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -657,28 +657,22 @@ (define-public rust-1.22 "1lrzzp0nh7s61wgfs2h6ilaqi6iq89f1pd1yaf65l87bssyl4ylb")) (define-public rust-1.23 - (package - (inherit rust-1.22) - (name "rust") - (version "1.23.0") - (source (rust-source version "14fb8vhjzsxlbi6yrn1r6fl5dlbdd1m92dn5zj5gmzfwf4w9ar3l")) - ;; Use rust-bootstrap@1.22 package to build rust 1.23 - (native-inputs - (alist-replace "cargo-bootstrap" (list rust-bootstrap "cargo") - (alist-replace "rustc-bootstrap" (list rust-bootstrap) - (package-native-inputs rust-1.22)))) - (arguments - (substitute-keyword-arguments (package-arguments rust-1.22) - ((#:phases phases) - `(modify-phases ,phases - (delete 'configure-archiver) - (delete 'remove-ar) - (add-after 'unpack 'dont-build-native - (lambda _ - ;; XXX: Revisit this when we use gcc 6. - (substitute* "src/binaryen/CMakeLists.txt" - (("ADD_COMPILE_FLAG\\(\\\"-march=native\\\"\\)") "")) - #t)))))))) + (let ((base-rust (rust-bootstrapped-package rust-1.22 "1.23.0" + "14fb8vhjzsxlbi6yrn1r6fl5dlbdd1m92dn5zj5gmzfwf4w9ar3l"))) + (package + (inherit base-rust) + (arguments + (substitute-keyword-arguments (package-arguments base-rust) + ((#:phases phases) + `(modify-phases ,phases + (delete 'configure-archiver) + (delete 'remove-ar) + (add-after 'unpack 'dont-build-native + (lambda _ + ;; XXX: Revisit this when we use gcc 6. + (substitute* "src/binaryen/CMakeLists.txt" + (("ADD_COMPILE_FLAG\\(\\\"-march=native\\\"\\)") "")) + #t))))))))) (define-public rust-1.24 (let ((base-rust From 52bc7df1a19b05caef59a72b69e015cccf719893 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Mon, 24 Sep 2018 13:08:07 +0200 Subject: [PATCH 4/5] gnu: rust: Remove binary bootstrapper. * gnu/packages/rust.scm (rust-bootstrap): Delete variable. --- gnu/packages/rust.scm | 82 ------------------------------------------- 1 file changed, 82 deletions(-) diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index 25ced10d9c..a56faad079 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -69,88 +69,6 @@ (define* (nix-system->gnu-triplet-for-rust ("mips64el-linux" "mips64el-unknown-linux-gnuabi64") (_ (nix-system->gnu-triplet system)))) -(define rust-bootstrap - (package - (name "rust-bootstrap") - (version "1.22.1") - (source #f) - (build-system gnu-build-system) - (native-inputs - `(("patchelf" ,patchelf))) - (inputs - `(("gcc" ,(canonical-package gcc)) - ("gcc:lib" ,(canonical-package gcc) "lib") - ("zlib" ,zlib) - ("source" - ,(origin - (method url-fetch) - (uri (string-append - "https://static.rust-lang.org/dist/" - "rust-" version "-" (nix-system->gnu-triplet-for-rust) - ".tar.gz")) - (sha256 - (base32 - (match (nix-system->gnu-triplet-for-rust) - ("i686-unknown-linux-gnu" - "15zqbx86nm13d5vq2gm69b7av4vg479f74b5by64hs3bcwwm08pr") - ("x86_64-unknown-linux-gnu" - "1yll78x6b3abnvgjf2b66gvp6mmcb9y9jdiqcwhmgc0z0i0fix4c") - ("armv7-unknown-linux-gnueabihf" - "138a8l528kzp5wyk1mgjaxs304ac5ms8vlpq0ggjaznm6bn2j7a5") - ("aarch64-unknown-linux-gnu" - "0z6m9m1rx4d96nvybbfmpscq4dv616m615ijy16d5wh2vx0p4na8") - ("mips64el-unknown-linux-gnuabi64" - "07k4pcv7jvfa48cscdj8752lby7m7xdl88v3a6na1vs675lhgja2") - (_ "")))))))) - (outputs '("out" "cargo")) - (arguments - `(#:tests? #f - #:strip-binaries? #f - #:phases - (modify-phases %standard-phases - (delete 'configure) - (delete 'build) - (replace 'install - (lambda* (#:key inputs outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (cargo-out (assoc-ref outputs "cargo")) - (gcc:lib (assoc-ref inputs "gcc:lib")) - (libc (assoc-ref inputs "libc")) - (zlib (assoc-ref inputs "zlib")) - (ld-so (string-append libc ,(glibc-dynamic-linker))) - (rpath (string-append out "/lib:" zlib "/lib:" - libc "/lib:" gcc:lib "/lib")) - (cargo-rpath (string-append cargo-out "/lib:" libc "/lib:" - gcc:lib "/lib")) - (rustc (string-append out "/bin/rustc")) - (rustdoc (string-append out "/bin/rustdoc")) - (cargo (string-append cargo-out "/bin/cargo")) - (gcc (assoc-ref inputs "gcc"))) - ;; Install rustc/rustdoc. - (invoke "bash" "install.sh" - (string-append "--prefix=" out) - (string-append "--components=rustc," - "rust-std-" - ,(nix-system->gnu-triplet-for-rust))) - ;; Install cargo. - (invoke "bash" "install.sh" - (string-append "--prefix=" cargo-out) - (string-append "--components=cargo")) - (for-each (lambda (file) - (invoke "patchelf" "--set-rpath" rpath file)) - (cons* rustc rustdoc (find-files out "\\.so$"))) - (invoke "patchelf" "--set-rpath" cargo-rpath cargo) - (for-each (lambda (file) - (invoke "patchelf" "--set-interpreter" ld-so file)) - (list rustc rustdoc cargo)) - #t)))))) - (home-page "https://www.rust-lang.org") - (synopsis "Prebuilt rust compiler and cargo package manager") - (description "This package provides a pre-built @command{rustc} compiler -and a pre-built @command{cargo} package manager, which can -in turn be used to build the final Rust.") - (license license:asl2.0))) - (define* (rust-source version hash #:key (patches '())) (origin From 4df3e06210405dda92d0e9749b8434a095e1277e Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Mon, 15 Oct 2018 11:58:37 +0200 Subject: [PATCH 5/5] gnu: rust: Document upstream's assessment. * gnu/packages/patches/rust-1.25-accept-more-detailed-gdb-lines.patch: Add URL. --- .../patches/rust-1.25-accept-more-detailed-gdb-lines.patch | 1 + 1 file changed, 1 insertion(+) diff --git a/gnu/packages/patches/rust-1.25-accept-more-detailed-gdb-lines.patch b/gnu/packages/patches/rust-1.25-accept-more-detailed-gdb-lines.patch index f40a12d382..a2bad55117 100644 --- a/gnu/packages/patches/rust-1.25-accept-more-detailed-gdb-lines.patch +++ b/gnu/packages/patches/rust-1.25-accept-more-detailed-gdb-lines.patch @@ -1,5 +1,6 @@ GDB responds with some overly detailed lines - which makes the tests fail. Patch rust to accept those instead. +See . diff -ur orig/rustc-1.25.0-src/src/test/debuginfo/generic-enum-with-different-disr-sizes.rs rustc-1.25.0-src/src/test/debuginfo/generic-enum-with-different-disr-sizes.rs --- orig/rustc-1.25.0-src/src/test/debuginfo/generic-enum-with-different-disr-sizes.rs 2018-09-13 10:24:33.775565159 +0200 +++ rustc-1.25.0-src/src/test/debuginfo/generic-enum-with-different-disr-sizes.rs 2018-09-13 10:25:56.322513658 +0200