guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/02: gnu: rust: Work around rust 1.25...1.27 reproducibility issues.


From: Danny Milosavljevic
Subject: 01/02: gnu: rust: Work around rust 1.25...1.27 reproducibility issues.
Date: Fri, 26 Oct 2018 12:12:36 -0400 (EDT)

dannym pushed a commit to branch master
in repository guix.

commit e027a494fd5e6025e645ce9f36cccca39a77d327
Author: Nikolai Merinov <address@hidden>
Date:   Tue Oct 16 02:32:11 2018 +0500

    gnu: rust: Work around rust 1.25...1.27 reproducibility issues.
    
    * 
gnu/packages/patches/rust-mdbook-support-reproducible-builds-by-forcing-window.search.patch:
    New file.
    * gnu/local.mk (dist_patch_DATA): Add new patch file.
    * gnu/packages/rust.scm (rust-1.19): Use system libssh2 library.
    during cargo build.  Note: libgit2 still bundled, because cargo
    tests assume specific libgit2 minor release.
    (rust-1.23): Inherit native-inputs from previous package.
    (rust-1.25): Switch back to llvm 3.9.1 as workaround for
    https://github.com/rust-lang/rust/issues/50556 issue.
    (rust-1.27): Apply changes from
    https://github.com/rust-lang-nursery/mdBook/pull/692 to make
    generation of "searchindex.js" files reproducible. Disable cargo
    test that required llvm 6.
---
 gnu/local.mk                                       |  1 +
 ...roducible-builds-by-forcing-window.search.patch | 25 +++++++++++++
 gnu/packages/rust.scm                              | 41 ++++++++++------------
 3 files changed, 44 insertions(+), 23 deletions(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 6ae7ff4..c46f3a8 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1131,6 +1131,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/rust-1.25-accept-more-detailed-gdb-lines.patch \
   %D%/packages/patches/rust-bootstrap-stage0-test.patch                \
   %D%/packages/patches/rust-coresimd-doctest.patch             \
+  
%D%/packages/patches/rust-mdbook-support-reproducible-builds-by-forcing-window.search.patch
 \
   %D%/packages/patches/rxvt-unicode-escape-sequences.patch     \
   %D%/packages/patches/scheme48-tests.patch                    \
   %D%/packages/patches/scotch-test-threading.patch             \
diff --git 
a/gnu/packages/patches/rust-mdbook-support-reproducible-builds-by-forcing-window.search.patch
 
b/gnu/packages/patches/rust-mdbook-support-reproducible-builds-by-forcing-window.search.patch
new file mode 100644
index 0000000..ef7bf53
--- /dev/null
+++ 
b/gnu/packages/patches/rust-mdbook-support-reproducible-builds-by-forcing-window.search.patch
@@ -0,0 +1,25 @@
+From b9ca108fcae2b738ca3f0c88c84ae5dc5a6f843f Mon Sep 17 00:00:00 2001
+From: Tim Ryan <address@hidden>
+Date: Mon, 14 May 2018 06:22:21 -0400
+Subject: [PATCH] Support reproducible builds by forcing window.search to use
+ stable key ordering. (#692)
+See <https://github.com/rust-lang-nursery/mdBook/pull/692>
+---
+ src/vendor/mdbook/src/renderer/html_handlebars/search.rs | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/vendor/mdbook/src/renderer/html_handlebars/search.rs 
b/src/vendor/mdbook/src/renderer/html_handlebars/search.rs
+index d49772f8b..1ee66a511 100644
+--- a/src/vendor/mdbook/src/renderer/html_handlebars/search.rs
++++ b/src/vendor/mdbook/src/renderer/html_handlebars/search.rs
+@@ -205,6 +205,10 @@ fn write_to_js(index: Index, search_config: &Search) -> 
Result<String> {
+         searchoptions,
+         index,
+     };
++
++    // By converting to serde_json::Value as an intermediary, we use a
++    // BTreeMap internally and can force a stable ordering of map keys.
++    let json_contents = serde_json::to_value(&json_contents)?;
+     let json_contents = serde_json::to_string(&json_contents)?;
+ 
+     Ok(format!("window.search = {};", json_contents))
diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index 4063385..9a7d207 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -480,7 +480,8 @@ test = { path = \"../libtest\" }
      `(("jemalloc" ,jemalloc-4.5.0)
        ("llvm" ,llvm-3.9.1)
        ("openssl" ,openssl)
-       ("libcurl" ,curl))) ; For "cargo"
+       ("libssh2" ,libssh2) ; For "cargo"
+       ("libcurl" ,curl)))  ; For "cargo"
 
     ;; rustc invokes gcc, so we need to set its search paths accordingly.
     ;; Note: duplicate its value here to cope with circular dependencies among
@@ -649,18 +650,11 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
     (name "rust")
     (version "1.23.0")
     (source (rust-source version 
"14fb8vhjzsxlbi6yrn1r6fl5dlbdd1m92dn5zj5gmzfwf4w9ar3l"))
+    ;; Use address@hidden package to build rust 1.23
     (native-inputs
-     `(("bison" ,bison) ; For the tests
-       ("cmake" ,cmake)
-       ("flex" ,flex) ; For the tests
-       ("gdb" ,gdb)   ; For the tests
-       ("git" ,git)
-       ("procps" ,procps) ; For the tests
-       ("python-2" ,python-2)
-       ("rustc-bootstrap" ,rust-bootstrap)
-       ("cargo-bootstrap" ,rust-bootstrap "cargo")
-       ("pkg-config" ,pkg-config) ; For "cargo"
-       ("which" ,which)))
+     (alist-replace "cargo-bootstrap" (list rust-bootstrap "cargo")
+                    (alist-replace "rustc-bootstrap" (list rust-bootstrap)
+                                   (package-native-inputs rust-1.20))))
     (arguments
      (substitute-keyword-arguments (package-arguments rust-1.20)
        ((#:phases phases)
@@ -692,6 +686,9 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
                    (("fn test_loading_cosine") "#[ignore]\nfn 
test_loading_cosine"))
                  #t)))))))))
 
+;;; Rust 1.25 release support work with llvm 6--but build with llvm 6 is
+;;; not determenistic due to <https://github.com/rust-lang/rust/issues/50556>.
+;;; Keep using llvm 3.9.1 until builds become determenistic
 (define-public rust-1.25
   (let ((base-rust
          (rust-bootstrapped-package rust-1.24 "1.25.0"
@@ -699,10 +696,6 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
           #:patches '("rust-1.25-accept-more-detailed-gdb-lines.patch"))))
     (package
       (inherit base-rust)
-      (inputs
-       ;; Use LLVM 6.0
-       (alist-replace "llvm" (list llvm)
-                      (package-inputs base-rust)))
       (arguments
        (substitute-keyword-arguments (package-arguments base-rust)
          ((#:phases phases)
@@ -713,14 +706,9 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
                    ;; This test wants to update the crate index.
                    (("fn no_index_update") "#[ignore]\nfn no_index_update"))
                  #t))
-             (add-after 'configure 'enable-codegen-tests
-               (lambda _
-                 (substitute* "config.toml"
-                   (("codegen-tests = false") ""))
-                 #t))
              ;; FIXME: Re-enable this test if it's indeed supposed to work.
              ;; See <https://github.com/rust-lang/rust/issues/54178>.
-             (add-after 'enable-codegen-tests 'disable-nil-enum-test
+             (add-after 'configure 'disable-nil-enum-test
                (lambda _
                  (substitute* "src/test/debuginfo/nil-enum.rs"
                    (("ignore-lldb") "ignore-gdb"))
@@ -795,7 +783,8 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
                                     #:patches
                                     '("rust-coresimd-doctest.patch"
                                       "rust-bootstrap-stage0-test.patch"
-                                      
"rust-1.25-accept-more-detailed-gdb-lines.patch"))))
+                                      
"rust-1.25-accept-more-detailed-gdb-lines.patch"
+                                      
"rust-mdbook-support-reproducible-builds-by-forcing-window.search.patch"))))
     (package
       (inherit base-rust)
       (arguments
@@ -808,4 +797,10 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
                  ;; `prefix' directory should exist before `install' call
                  (mkdir-p (assoc-ref outputs "out"))
                  (mkdir-p (assoc-ref outputs "cargo"))
+                 #t))
+             (add-after 'patch-cargo-tests 'disable-thinlto-test
+               (lambda* _
+                 ;; thinlto required llvm 6.0 for work
+                 (substitute* "src/tools/cargo/tests/testsuite/path.rs"
+                   (("fn thin_lto_works") "#[ignore]\nfn thin_lto_works"))
                  #t)))))))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]