Skip to content

Commit

Permalink
Rollup merge of rust-lang#41202 - brson:btree, r=nikomatsakis
Browse files Browse the repository at this point in the history
Convert HashMap to BTree in build-manifest

This is just for my peace of mind since it's important the output of this program be deterministic.
  • Loading branch information
frewsxcv authored Apr 11, 2017
2 parents b72c30a + 1c3f34d commit c03061d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/tools/build-manifest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
extern crate toml;
extern crate rustc_serialize;

use std::collections::{BTreeMap, HashMap};
use std::collections::BTreeMap;
use std::env;
use std::fs::File;
use std::io::{self, Read, Write};
Expand Down Expand Up @@ -101,13 +101,13 @@ static MINGW: &'static [&'static str] = &[
struct Manifest {
manifest_version: String,
date: String,
pkg: HashMap<String, Package>,
pkg: BTreeMap<String, Package>,
}

#[derive(RustcEncodable)]
struct Package {
version: String,
target: HashMap<String, Target>,
target: BTreeMap<String, Target>,
}

#[derive(RustcEncodable)]
Expand Down Expand Up @@ -138,7 +138,7 @@ struct Builder {
input: PathBuf,
output: PathBuf,
gpg_passphrase: String,
digests: HashMap<String, String>,
digests: BTreeMap<String, String>,
s3_address: String,
date: String,
rust_version: String,
Expand All @@ -162,7 +162,7 @@ fn main() {
input: input,
output: output,
gpg_passphrase: passphrase,
digests: HashMap::new(),
digests: BTreeMap::new(),
s3_address: s3_address,
date: date,
rust_version: String::new(),
Expand Down Expand Up @@ -214,7 +214,7 @@ impl Builder {
let mut manifest = Manifest {
manifest_version: "2".to_string(),
date: self.date.to_string(),
pkg: HashMap::new(),
pkg: BTreeMap::new(),
};

self.package("rustc", &mut manifest.pkg, HOSTS);
Expand All @@ -230,7 +230,7 @@ impl Builder {

let mut pkg = Package {
version: self.cached_version("rust").to_string(),
target: HashMap::new(),
target: BTreeMap::new(),
};
for host in HOSTS {
let filename = self.filename("rust", host);
Expand Down Expand Up @@ -299,7 +299,7 @@ impl Builder {

fn package(&mut self,
pkgname: &str,
dst: &mut HashMap<String, Package>,
dst: &mut BTreeMap<String, Package>,
targets: &[&str]) {
let targets = targets.iter().map(|name| {
let filename = self.filename(pkgname, name);
Expand Down

0 comments on commit c03061d

Please sign in to comment.