Skip to content

Commit 62d2267

Browse files
authored
Rollup merge of #39630 - alexcrichton:update-manifest, r=brson
Rename manifest_version to manifest-version The current manifests encode this with a dash in the name, so we should preserve that!
2 parents 83a581c + e53eaa3 commit 62d2267

File tree

1 file changed

+13
-4
lines changed
  • src/tools/build-manifest/src

1 file changed

+13
-4
lines changed

Diff for: src/tools/build-manifest/src/main.rs

+13-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
extern crate toml;
1212
extern crate rustc_serialize;
1313

14-
use std::collections::HashMap;
14+
use std::collections::{BTreeMap, HashMap};
1515
use std::env;
1616
use std::fs::File;
1717
use std::io::{self, Read, Write};
@@ -95,7 +95,6 @@ static MINGW: &'static [&'static str] = &[
9595
"x86_64-pc-windows-gnu",
9696
];
9797

98-
#[derive(RustcEncodable)]
9998
struct Manifest {
10099
manifest_version: String,
101100
date: String,
@@ -171,8 +170,18 @@ impl Builder {
171170
self.cargo_version = self.version("cargo", "x86_64-unknown-linux-gnu");
172171

173172
self.digest_and_sign();
174-
let manifest = self.build_manifest();
175-
let manifest = toml::encode(&manifest).to_string();
173+
let Manifest { manifest_version, date, pkg } = self.build_manifest();
174+
175+
// Unfortunately we can't use derive(RustcEncodable) here because the
176+
// version field is called `manifest-version`, not `manifest_version`.
177+
// In lieu of that just create the table directly here with a `BTreeMap`
178+
// and wrap it up in a `Value::Table`.
179+
let mut manifest = BTreeMap::new();
180+
manifest.insert("manifest-version".to_string(),
181+
toml::encode(&manifest_version));
182+
manifest.insert("date".to_string(), toml::encode(&date));
183+
manifest.insert("pkg".to_string(), toml::encode(&pkg));
184+
let manifest = toml::Value::Table(manifest).to_string();
176185

177186
let filename = format!("channel-rust-{}.toml", self.channel);
178187
self.write_manifest(&manifest, &filename);

0 commit comments

Comments
 (0)