From 216a3fa3f917f6b1bf94018e00aec6730d518cfc Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 7 Feb 2017 11:39:42 -0800 Subject: [PATCH 1/5] rustbuild: Clean build/dist on `make clean` Prevents stale artifacts from sticking around by accident! --- src/bootstrap/clean.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bootstrap/clean.rs b/src/bootstrap/clean.rs index e7655458aed8a..a66ed46fe464f 100644 --- a/src/bootstrap/clean.rs +++ b/src/bootstrap/clean.rs @@ -24,6 +24,7 @@ use Build; pub fn clean(build: &Build) { rm_rf(build, "tmp".as_ref()); rm_rf(build, &build.out.join("tmp")); + rm_rf(build, &build.out.join("dist")); for host in build.config.host.iter() { let entries = match build.out.join(host).read_dir() { From 3d4cea1ae35f2f5dfdda0c119714906a1ad83f4f Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 7 Feb 2017 15:47:03 -0800 Subject: [PATCH 2/5] Rename manifest_version to manifest-version The current manifests encode this with a dash in the name, so we should preserve that! --- src/tools/build-manifest/src/main.rs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs index 3eaac82d9fa85..0aefe703c9ca7 100644 --- a/src/tools/build-manifest/src/main.rs +++ b/src/tools/build-manifest/src/main.rs @@ -11,7 +11,7 @@ extern crate toml; extern crate rustc_serialize; -use std::collections::HashMap; +use std::collections::{BTreeMap, HashMap}; use std::env; use std::fs::File; use std::io::{self, Read, Write}; @@ -95,7 +95,6 @@ static MINGW: &'static [&'static str] = &[ "x86_64-pc-windows-gnu", ]; -#[derive(RustcEncodable)] struct Manifest { manifest_version: String, date: String, @@ -171,8 +170,18 @@ impl Builder { self.cargo_version = self.version("cargo", "x86_64-unknown-linux-gnu"); self.digest_and_sign(); - let manifest = self.build_manifest(); - let manifest = toml::encode(&manifest).to_string(); + 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::encode(&manifest_version)); + manifest.insert("date".to_string(), toml::encode(&date)); + manifest.insert("pkg".to_string(), toml::encode(&pkg)); + let manifest = toml::Value::Table(manifest).to_string(); let filename = format!("channel-rust-{}.toml", self.channel); self.write_manifest(&manifest, &filename); From 42b26e6d93d63e011b57f1be3f2a4ce4347d539b Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 8 Feb 2017 15:08:30 -0800 Subject: [PATCH 3/5] Don't include directory names in shasums Right now we just run `shasum` on an absolute path but right now the shasum files only include filenames, so let's use `current_dir` and just the file name to only have the file name emitted. --- src/tools/build-manifest/src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs index 0aefe703c9ca7..3cad5ebf6f823 100644 --- a/src/tools/build-manifest/src/main.rs +++ b/src/tools/build-manifest/src/main.rs @@ -361,7 +361,8 @@ impl Builder { fn hash(&self, path: &Path) -> String { let sha = t!(Command::new("shasum") .arg("-a").arg("256") - .arg(path) + .arg(path.file_name().unwrap()) + .current_dir(path.parent().unwrap()) .output()); assert!(sha.status.success()); From 78c2148f02c9186b18fe0d8aba9a89fccf2e729b Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 8 Feb 2017 20:49:58 -0800 Subject: [PATCH 4/5] Actually fix manifest generation The previous fix contained an error where `toml::encode` returned a runtime error, so this version just constructs a literal `toml::Value`. --- src/tools/build-manifest/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs index 3cad5ebf6f823..69abccace4ddc 100644 --- a/src/tools/build-manifest/src/main.rs +++ b/src/tools/build-manifest/src/main.rs @@ -178,8 +178,8 @@ impl Builder { // and wrap it up in a `Value::Table`. let mut manifest = BTreeMap::new(); manifest.insert("manifest-version".to_string(), - toml::encode(&manifest_version)); - manifest.insert("date".to_string(), toml::encode(&date)); + toml::Value::String(manifest_version)); + manifest.insert("date".to_string(), toml::Value::String(date)); manifest.insert("pkg".to_string(), toml::encode(&pkg)); let manifest = toml::Value::Table(manifest).to_string(); From f51adf95ea85b04eb18ba15b78b1c21c3f0205e4 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 14 Feb 2017 08:02:55 -0800 Subject: [PATCH 5/5] Bump beta to .2 --- mk/main.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/main.mk b/mk/main.mk index 9cd30be6531d1..5230e32656e15 100644 --- a/mk/main.mk +++ b/mk/main.mk @@ -18,7 +18,7 @@ CFG_RELEASE_NUM=1.16.0 # An optional number to put after the label, e.g. '.2' -> '-beta.2' # NB Make sure it starts with a dot to conform to semver pre-release # versions (section 9) -CFG_PRERELEASE_VERSION=.1 +CFG_PRERELEASE_VERSION=.2 ifeq ($(CFG_RELEASE_CHANNEL),stable) # This is the normal semver version string, e.g. "0.12.0", "0.12.0-nightly"