all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob b4ae3a4b8364a55c09c2aebdd884fe758df952b2 1187 bytes (raw)
name: gnu/packages/patches/rust-mdbook-support-reproducible-builds-by-forcing-window.search.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 
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))
-- 
2.19.0


debug log:

solving b4ae3a4b8 ...
found b4ae3a4b8 in https://yhetil.org/guix/87sh11slfg.fsf_-_@member.fsf.org/ ||
	https://yhetil.org/guix/87y3atsouq.fsf@member.fsf.org/

applying [1/1] https://yhetil.org/guix/87sh11slfg.fsf_-_@member.fsf.org/
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 000000000..b4ae3a4b8

1:30: trailing whitespace.
 
1:32: trailing whitespace.
-- 
Checking patch gnu/packages/patches/rust-mdbook-support-reproducible-builds-by-forcing-window.search.patch...
1:34: new blank line at EOF.
+
Applied patch gnu/packages/patches/rust-mdbook-support-reproducible-builds-by-forcing-window.search.patch cleanly.
warning: 3 lines add whitespace errors.

skipping https://yhetil.org/guix/87y3atsouq.fsf@member.fsf.org/ for b4ae3a4b8
index at:
100644 b4ae3a4b8364a55c09c2aebdd884fe758df952b2	gnu/packages/patches/rust-mdbook-support-reproducible-builds-by-forcing-window.search.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.