From b9ca108fcae2b738ca3f0c88c84ae5dc5a6f843f Mon Sep 17 00:00:00 2001 From: Tim Ryan 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 --- 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 { 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)) 6902dd38b40d46c96'>refslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-12-27records: match-record supports specifying a different variable name.Attila Lendvai
An example: (match-record obj <my-type> (field1 (field2 custom-var-name) field3) ...) * guix/records.scm (match-record-inner): Add support for the new syntax. * tests/records.scm ("match-record, simple"): Add a simple test case for the new syntax. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-12-02records: 'match-record' checks fields at macro-expansion time.Ludovic Courtès
This allows 'match-record' to be more efficient (field offsets are computed at compilation time) and to report unknown fields at macro-expansion time. * guix/records.scm (map-fields): New macro. (define-record-type*)[rtd-identifier]: New procedure. Define TYPE as a macro and use a separate identifier for the RTD. (lookup-field, match-record-inner): New macros. (match-record): Rewrite in terms of 'match-error-inner'. * tests/records.scm ("match-record, simple") ("match-record, unknown field"): New tests. * gnu/services/cuirass.scm (cuirass-shepherd-service): Rename 'log-file' local variable to 'main-log-file'. * gnu/services/getmail.scm (serialize-getmail-configuration-file): Move after <getmail-configuration-file> definition.
2022-07-01tests: Add sanitizer test.Ludovic Courtès
* tests/records.scm ("define-record-type* & sanitize without default value"): New test.