summary refs log tree commit diff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
authorNikolai Merinov <nikolai.merinov@member.fsf.org>2018-10-16 02:32:11 +0500
committerDanny Milosavljevic <dannym@scratchpost.org>2018-10-26 18:11:15 +0200
commite027a494fd5e6025e645ce9f36cccca39a77d327 (patch)
tree439449db88be424aabdf07daf0e4bdfeadd20df2 /gnu/packages/patches
parent1fdcee026b298aa19b71d0761ed034e1e56e84db (diff)
downloadguix-e027a494fd5e6025e645ce9f36cccca39a77d327.tar.gz
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.
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/rust-mdbook-support-reproducible-builds-by-forcing-window.search.patch25
1 files changed, 25 insertions, 0 deletions
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 0000000000..ef7bf53b5d
--- /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 <id@timryan.org>
+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))