"getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "toml 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)",
+ "toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "build-manifest"
version = "0.1.0"
dependencies = [
- "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
- "toml 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_derive 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "tidy"
version = "0.1.0"
-[[package]]
-name = "toml"
-version = "0.1.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
[[package]]
name = "toml"
version = "0.2.1"
"checksum thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a9539db560102d1cef46b8b78ce737ff0bb64e7e18d35b2a5688f7d097d0ff03"
"checksum thread_local 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8576dbbfcaef9641452d5cf0df9b0e7eeab7694956dd33bb61515fb8f18cfdd5"
"checksum thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1697c4b57aeeb7a536b647165a2825faddffb1d3bad386d507709bd51a90bb14"
-"checksum toml 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)" = "0590d72182e50e879c4da3b11c6488dae18fccb1ae0c7a3eda18e16795844796"
"checksum toml 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "736b60249cb25337bc196faa43ee12c705e426f3d55c214d73a4e7be06f92cb4"
"checksum toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b0601da6c97135c8d330c7a13a013ca6cd4143221b01de2f8d4edc50a9e551c7"
"checksum typed-arena 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5934776c3ac1bea4a9d56620d6bf2d483b20d394e49581db40f187e1118ff667"
cmake = "0.1.23"
filetime = "0.1"
num_cpus = "1.0"
-toml = "0.1"
getopts = "0.2"
-rustc-serialize = "0.3"
gcc = "0.3.50"
libc = "0.2"
-serde = "1.0"
-serde_json = "1.0"
-serde_derive = "1.0"
+serde = "1.0.8"
+serde_derive = "1.0.8"
+serde_json = "1.0.2"
+toml = "0.4"
use check;
use flags::Subcommand;
use doc;
+use tool;
pub use Compiler;
let builder = &builder;
match builder.kind {
Kind::Build => check!(builder, paths, compile::Std, compile::Test, compile::Rustc,
- compile::StartupObjects),
+ compile::StartupObjects, tool::BuildManifest, tool::Rustbook, tool::ErrorIndex,
+ tool::UnstableBookGen, tool::Tidy, tool::Linkchecker, tool::CargoTest,
+ tool::Compiletest, tool::RemoteTestServer, tool::RemoteTestClient,
+ tool::RustInstaller, tool::Cargo, tool::Rls),
Kind::Test => check!(builder, paths, check::Tidy, check::Bootstrap, check::Compiletest,
check::Krate, check::KrateLibrustc, check::Linkcheck, check::Cargotest,
check::Cargo, check::Docs, check::ErrorIndex, check::Distcheck),
use std::process;
use num_cpus;
-use rustc_serialize::Decodable;
-use toml::{Parser, Decoder, Value};
+use toml;
use util::{exe, push_exe_path};
/// Global configuration for the entire build and/or bootstrap.
/// This structure uses `Decodable` to automatically decode a TOML configuration
/// file into this format, and then this is traversed and written into the above
/// `Config` structure.
-#[derive(RustcDecodable, Default)]
+#[derive(Deserialize, Default)]
+#[serde(deny_unknown_fields)]
+#[serde(rename_all = "kebab-case")]
struct TomlConfig {
build: Option<Build>,
install: Option<Install>,
}
/// TOML representation of various global build decisions.
-#[derive(RustcDecodable, Default, Clone)]
+#[derive(Deserialize, Default, Clone)]
+#[serde(deny_unknown_fields)]
+#[serde(rename_all = "kebab-case")]
struct Build {
build: Option<String>,
+ #[serde(default)]
host: Vec<String>,
+ #[serde(default)]
target: Vec<String>,
cargo: Option<String>,
rustc: Option<String>,
}
/// TOML representation of various global install decisions.
-#[derive(RustcDecodable, Default, Clone)]
+#[derive(Deserialize, Default, Clone)]
+#[serde(deny_unknown_fields)]
+#[serde(rename_all = "kebab-case")]
struct Install {
prefix: Option<String>,
sysconfdir: Option<String>,
}
/// TOML representation of how the LLVM build is configured.
-#[derive(RustcDecodable, Default)]
+#[derive(Deserialize, Default)]
+#[serde(deny_unknown_fields)]
+#[serde(rename_all = "kebab-case")]
struct Llvm {
ccache: Option<StringOrBool>,
ninja: Option<bool>,
clean_rebuild: Option<bool>,
}
-#[derive(RustcDecodable, Default, Clone)]
+#[derive(Deserialize, Default, Clone)]
+#[serde(deny_unknown_fields)]
+#[serde(rename_all = "kebab-case")]
struct Dist {
sign_folder: Option<String>,
gpg_password_file: Option<String>,
src_tarball: Option<bool>,
}
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
+#[serde(untagged)]
enum StringOrBool {
String(String),
Bool(bool),
}
/// TOML representation of how the Rust build is configured.
-#[derive(RustcDecodable, Default)]
+#[derive(Deserialize, Default)]
+#[serde(deny_unknown_fields)]
+#[serde(rename_all = "kebab-case")]
struct Rust {
optimize: Option<bool>,
codegen_units: Option<u32>,
}
/// TOML representation of how each build target is configured.
-#[derive(RustcDecodable, Default)]
+#[derive(Deserialize, Default)]
+#[serde(deny_unknown_fields)]
+#[serde(rename_all = "kebab-case")]
struct TomlTarget {
llvm_config: Option<String>,
jemalloc: Option<String>,
let toml = file.map(|file| {
let mut f = t!(File::open(&file));
- let mut toml = String::new();
- t!(f.read_to_string(&mut toml));
- let mut p = Parser::new(&toml);
- let table = match p.parse() {
- Some(table) => table,
- None => {
- println!("failed to parse TOML configuration '{}':", file.to_str().unwrap());
- for err in p.errors.iter() {
- let (loline, locol) = p.to_linecol(err.lo);
- let (hiline, hicol) = p.to_linecol(err.hi);
- println!("{}:{}-{}:{}: {}", loline, locol, hiline,
- hicol, err.desc);
- }
- process::exit(2);
- }
- };
- let mut d = Decoder::new(Value::Table(table));
- match Decodable::decode(&mut d) {
- Ok(cfg) => cfg,
- Err(e) => {
- println!("failed to decode TOML: {}", e);
+ let mut contents = String::new();
+ t!(f.read_to_string(&mut contents));
+ match toml::from_str(&contents) {
+ Ok(table) => table,
+ Err(err) => {
+ println!("failed to parse TOML configuration '{}': {}",
+ file.display(), err);
process::exit(2);
}
}
extern crate gcc;
extern crate getopts;
extern crate num_cpus;
-extern crate rustc_serialize;
extern crate toml;
#[cfg(unix)]
use std::path::PathBuf;
use build_helper::output;
-use rustc_serialize::json;
+use serde_json;
use {Build, Crate};
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
struct Output {
packages: Vec<Package>,
resolve: Resolve,
}
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
struct Package {
id: String,
name: String,
manifest_path: String,
}
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
struct Resolve {
nodes: Vec<ResolveNode>,
}
-#[derive(RustcDecodable)]
+#[derive(Deserialize)]
struct ResolveNode {
id: String,
dependencies: Vec<String>,
.arg("--format-version").arg("1")
.arg("--manifest-path").arg(build.src.join(krate).join("Cargo.toml"));
let output = output(&mut cargo);
- let output: Output = json::decode(&output).unwrap();
+ let output: Output = serde_json::from_str(&output).unwrap();
let mut id2name = HashMap::new();
for package in output.packages {
if package.source.is_none() {
// .dep(|s| s.name("maybe-clean-tools"))
// .dep(|s| s.name("libstd-tool"))
// .run(move |s| compile::tool(build, s.stage, s.target, "build-manifest"));
- BuildManifest, "src/tools/build-manifest", "build-manifest", Mode::Libstd;
+ BuildManifest, "src/tools/build-manifest", "build-manifest", Mode::Librustc;
// rules.build("tool-remote-test-server", "src/tools/remote-test-server")
// .dep(|s| s.name("maybe-clean-tools"))
// .dep(|s| s.name("libstd-tool"))
authors = ["Alex Crichton <alex@alexcrichton.com>"]
[dependencies]
-toml = "0.1"
-rustc-serialize = "0.3"
+toml = "0.4"
+serde = "1.0"
+serde_derive = "1.0"
// except according to those terms.
extern crate toml;
-extern crate rustc_serialize;
+#[macro_use]
+extern crate serde_derive;
+extern crate serde;
use std::collections::BTreeMap;
use std::env;
"x86_64-pc-windows-gnu",
];
+#[derive(Serialize)]
+#[serde(rename_all = "kebab-case")]
struct Manifest {
manifest_version: String,
date: String,
pkg: BTreeMap<String, Package>,
}
-#[derive(RustcEncodable)]
+#[derive(Serialize)]
struct Package {
version: String,
target: BTreeMap<String, Target>,
}
-#[derive(RustcEncodable)]
+#[derive(Serialize)]
struct Target {
available: bool,
url: Option<String>,
}
}
-#[derive(RustcEncodable)]
+#[derive(Serialize)]
struct Component {
pkg: String,
target: String,
self.rls_version = self.version("rls", "x86_64-unknown-linux-gnu");
self.digest_and_sign();
- let Manifest { manifest_version, date, pkg } = self.build_manifest();
-
- // Unfortunately we can't use derive(RustcEncodable) here because the
- // version field is called `manifest-version`, not `manifest_version`.
- // In lieu of that just create the table directly here with a `BTreeMap`
- // and wrap it up in a `Value::Table`.
- let mut manifest = BTreeMap::new();
- manifest.insert("manifest-version".to_string(),
- toml::Value::String(manifest_version));
- manifest.insert("date".to_string(), toml::Value::String(date.clone()));
- manifest.insert("pkg".to_string(), toml::encode(&pkg));
- let manifest = toml::Value::Table(manifest).to_string();
-
+ let manifest = self.build_manifest();
let filename = format!("channel-rust-{}.toml", self.rust_release);
- self.write_manifest(&manifest, &filename);
+ self.write_manifest(&toml::to_string(&manifest).unwrap(), &filename);
let filename = format!("channel-rust-{}-date.txt", self.rust_release);
- self.write_date_stamp(&date, &filename);
+ self.write_date_stamp(&manifest.date, &filename);
if self.rust_release != "beta" && self.rust_release != "nightly" {
- self.write_manifest(&manifest, "channel-rust-stable.toml");
- self.write_date_stamp(&date, "channel-rust-stable-date.txt");
+ self.write_manifest(&toml::to_string(&manifest).unwrap(), "channel-rust-stable.toml");
+ self.write_date_stamp(&manifest.date, "channel-rust-stable-date.txt");
}
}