]> git.lizzy.rs Git - rust.git/commitdiff
rustbuild: Fix a few locations with makefiles gone
authorAlex Crichton <alex@alexcrichton.com>
Fri, 27 Jan 2017 22:48:48 +0000 (14:48 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Mon, 6 Feb 2017 16:44:27 +0000 (08:44 -0800)
* Add version info to channel.rs as main.mk is no longer available
* Update `Makefile.in` used with bootstrap to not try to require `mk/util.mk`
* Update the `dist` target to avoid the makefile pieces

src/bootstrap/channel.rs
src/bootstrap/dist.rs
src/bootstrap/mk/Makefile.in

index 585d9f51b92a8e10673059830af8a211d9662381..81e745bc76c9e7a1cdcf19be62f849297822b049 100644 (file)
 //! `package_vers`, and otherwise indicating to the compiler what it should
 //! print out as part of its version information.
 
-use std::fs::File;
-use std::io::prelude::*;
 use std::process::Command;
 
 use build_helper::output;
 
 use Build;
 
-pub fn collect(build: &mut Build) {
-    // Currently the canonical source for the release number (e.g. 1.10.0) and
-    // the prerelease version (e.g. `.1`) is in `mk/main.mk`. We "parse" that
-    // here to learn about those numbers.
-    let mut main_mk = String::new();
-    t!(t!(File::open(build.src.join("mk/main.mk"))).read_to_string(&mut main_mk));
-    let mut release_num = "";
-    let mut prerelease_version = "";
-    for line in main_mk.lines() {
-        if line.starts_with("CFG_RELEASE_NUM") {
-            release_num = line.split('=').skip(1).next().unwrap().trim();
-        }
-        if line.starts_with("CFG_PRERELEASE_VERSION") {
-            prerelease_version = line.split('=').skip(1).next().unwrap().trim();
-        }
-    }
+// The version number
+const CFG_RELEASE_NUM: &'static str = "1.17.0";
+
+// An optional number to put after the label, e.g. '.2' -> '-beta.2'
+// Be sure to make this starts with a dot to conform to semver pre-release
+// versions (section 9)
+const CFG_PRERELEASE_VERSION: &'static str = ".1";
 
-    build.release_num = release_num.to_string();
-    build.prerelease_version = release_num.to_string();
+pub fn collect(build: &mut Build) {
+    build.release_num = CFG_RELEASE_NUM.to_string();
+    build.prerelease_version = CFG_RELEASE_NUM.to_string();
 
     // Depending on the channel, passed in `./configure --release-channel`,
     // determine various properties of the build.
     match &build.config.channel[..] {
         "stable" => {
-            build.release = release_num.to_string();
+            build.release = CFG_RELEASE_NUM.to_string();
             build.package_vers = build.release.clone();
             build.unstable_features = false;
         }
         "beta" => {
-            build.release = format!("{}-beta{}", release_num,
-                                   prerelease_version);
+            build.release = format!("{}-beta{}", CFG_RELEASE_NUM,
+                                   CFG_PRERELEASE_VERSION);
             build.package_vers = "beta".to_string();
             build.unstable_features = false;
         }
         "nightly" => {
-            build.release = format!("{}-nightly", release_num);
+            build.release = format!("{}-nightly", CFG_RELEASE_NUM);
             build.package_vers = "nightly".to_string();
             build.unstable_features = true;
         }
         _ => {
-            build.release = format!("{}-dev", release_num);
+            build.release = format!("{}-dev", CFG_RELEASE_NUM);
             build.package_vers = build.release.clone();
             build.unstable_features = true;
         }
index 9327cc0cf7faf63845940cbe6f113e4584cc4e9c..1c3901bf2a14349619d1fdc379fb57bfd7b33970 100644 (file)
@@ -381,13 +381,11 @@ pub fn rust_src(build: &Build) {
         "README.md",
         "RELEASES.md",
         "configure",
-        "Makefile.in",
         "x.py",
     ];
     let src_dirs = [
         "man",
         "src",
-        "mk"
     ];
 
     let filter_fn = move |path: &Path| {
index d6f6a7772c9d98fee667753b77a486d8a8473d78..536095503e0daed170d0d0e6dcf4fbdc50bcca56 100644 (file)
@@ -9,11 +9,12 @@
 # except according to those terms.
 
 include config.mk
-include $(CFG_SRC_DIR)mk/util.mk
 
 ifdef VERBOSE
+Q :=
 BOOTSTRAP_ARGS := -v
 else
+Q := @
 BOOTSTRAP_ARGS :=
 endif