From: Kornel Date: Wed, 15 Nov 2017 18:16:34 +0000 (+0000) Subject: Sort native library paths for deterministic builds X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~3^2~28^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=14b693a9e73aa11f86070a23342417c6214ebf98;p=cargo.git Sort native library paths for deterministic builds #3800 --- diff --git a/src/cargo/ops/cargo_rustc/compilation.rs b/src/cargo/ops/cargo_rustc/compilation.rs index b3643b6bf..1c79ade6a 100644 --- a/src/cargo/ops/cargo_rustc/compilation.rs +++ b/src/cargo/ops/cargo_rustc/compilation.rs @@ -1,4 +1,4 @@ -use std::collections::{HashMap, HashSet}; +use std::collections::{HashMap, HashSet, BTreeSet}; use std::ffi::OsStr; use std::path::PathBuf; use semver::Version; @@ -22,8 +22,10 @@ pub struct Compilation<'cfg> { /// /// This is currently used to drive some entries which are added to the /// LD_LIBRARY_PATH as appropriate. + /// + /// The order should be deterministic. // TODO: deprecated, remove - pub native_dirs: HashSet, + pub native_dirs: BTreeSet, /// Root output directory (for the local package's artifacts) pub root_output: PathBuf, @@ -61,7 +63,7 @@ impl<'cfg> Compilation<'cfg> { pub fn new(config: &'cfg Config) -> Compilation<'cfg> { Compilation { libraries: HashMap::new(), - native_dirs: HashSet::new(), // TODO: deprecated, remove + native_dirs: BTreeSet::new(), // TODO: deprecated, remove root_output: PathBuf::from("/"), deps_output: PathBuf::from("/"), host_deps_output: PathBuf::from("/"),