about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-04-29 20:38:15 +0000
committerbors <bors@rust-lang.org>2017-04-29 20:38:15 +0000
commitafa1240e57330d85a372db4e28cd8bc8fa528ccb (patch)
tree196d279b28389512c66dd2facdf615604ac51d1f /src/bootstrap
parentb4d3ed64ec7f6d7a9fa0530377a29520a90a451f (diff)
parent5daf557a77391f14a26038d7ab70d424cfe5b040 (diff)
downloadrust-afa1240e57330d85a372db4e28cd8bc8fa528ccb.tar.gz
rust-afa1240e57330d85a372db4e28cd8bc8fa528ccb.zip
Auto merge of #41544 - alexcrichton:bump-bootstrap, r=brson
Update stage0 bootstrap compiler

We've got a freshly minted beta compiler, let's update to use that on nightly!
This has a few other changes associated with it as well

* A bump to the rustc version number (to 1.19.0)
* Movement of the `cargo` and `rls` submodules to their "proper" location in
  `src/tools/{cargo,rls}`. Now that Cargo workspaces support the `exclude`
  option this can work.
* Updates of the `cargo` and `rls` submodules to their master branches.
* Tweak to the `src/stage0.txt` format to be more amenable for Cargo version
  numbers. On the beta channel Cargo will bootstrap from a different version
  than rustc (e.g. the version numbers are different), so we need different
  configuration for this.
* Addition of `dev` as a readable key in the `src/stage0.txt` format. If present
  then stage0 compilers are downloaded from `dev-static.rust-lang.org` instead
  of `static.rust-lang.org`. This is added to accomodate our updated release
  process with Travis and AppVeyor.
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/bootstrap.py44
-rw-r--r--src/bootstrap/channel.rs2
-rw-r--r--src/bootstrap/check.rs2
-rw-r--r--src/bootstrap/compile.rs5
-rw-r--r--src/bootstrap/dist.rs6
-rw-r--r--src/bootstrap/lib.rs6
-rw-r--r--src/bootstrap/step.rs4
7 files changed, 37 insertions, 32 deletions
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py
index e5f8143b418..2bccdef9b0a 100644
--- a/src/bootstrap/bootstrap.py
+++ b/src/bootstrap/bootstrap.py
@@ -159,19 +159,20 @@ def format_build_time(duration):
 class RustBuild(object):
     def download_stage0(self):
         cache_dst = os.path.join(self.build_dir, "cache")
-        rustc_cache = os.path.join(cache_dst, self.stage0_rustc_date())
+        rustc_cache = os.path.join(cache_dst, self.stage0_date())
         if not os.path.exists(rustc_cache):
             os.makedirs(rustc_cache)
 
-        channel = self.stage0_rustc_channel()
+        rustc_channel = self.stage0_rustc_channel()
+        cargo_channel = self.stage0_cargo_channel()
 
         if self.rustc().startswith(self.bin_root()) and \
                 (not os.path.exists(self.rustc()) or self.rustc_out_of_date()):
             self.print_what_it_means_to_bootstrap()
             if os.path.exists(self.bin_root()):
                 shutil.rmtree(self.bin_root())
-            filename = "rust-std-{}-{}.tar.gz".format(channel, self.build)
-            url = "https://static.rust-lang.org/dist/" + self.stage0_rustc_date()
+            filename = "rust-std-{}-{}.tar.gz".format(rustc_channel, self.build)
+            url = self._download_url + "/dist/" + self.stage0_date()
             tarball = os.path.join(rustc_cache, filename)
             if not os.path.exists(tarball):
                 get("{}/{}".format(url, filename), tarball, verbose=self.verbose)
@@ -179,8 +180,8 @@ class RustBuild(object):
                    match="rust-std-" + self.build,
                    verbose=self.verbose)
 
-            filename = "rustc-{}-{}.tar.gz".format(channel, self.build)
-            url = "https://static.rust-lang.org/dist/" + self.stage0_rustc_date()
+            filename = "rustc-{}-{}.tar.gz".format(rustc_channel, self.build)
+            url = self._download_url + "/dist/" + self.stage0_date()
             tarball = os.path.join(rustc_cache, filename)
             if not os.path.exists(tarball):
                 get("{}/{}".format(url, filename), tarball, verbose=self.verbose)
@@ -188,11 +189,11 @@ class RustBuild(object):
             self.fix_executable(self.bin_root() + "/bin/rustc")
             self.fix_executable(self.bin_root() + "/bin/rustdoc")
             with open(self.rustc_stamp(), 'w') as f:
-                f.write(self.stage0_rustc_date())
+                f.write(self.stage0_date())
 
             if "pc-windows-gnu" in self.build:
-                filename = "rust-mingw-{}-{}.tar.gz".format(channel, self.build)
-                url = "https://static.rust-lang.org/dist/" + self.stage0_rustc_date()
+                filename = "rust-mingw-{}-{}.tar.gz".format(rustc_channel, self.build)
+                url = self._download_url + "/dist/" + self.stage0_date()
                 tarball = os.path.join(rustc_cache, filename)
                 if not os.path.exists(tarball):
                     get("{}/{}".format(url, filename), tarball, verbose=self.verbose)
@@ -201,15 +202,15 @@ class RustBuild(object):
         if self.cargo().startswith(self.bin_root()) and \
                 (not os.path.exists(self.cargo()) or self.cargo_out_of_date()):
             self.print_what_it_means_to_bootstrap()
-            filename = "cargo-{}-{}.tar.gz".format(channel, self.build)
-            url = "https://static.rust-lang.org/dist/" + self.stage0_rustc_date()
+            filename = "cargo-{}-{}.tar.gz".format(cargo_channel, self.build)
+            url = self._download_url + "/dist/" + self.stage0_date()
             tarball = os.path.join(rustc_cache, filename)
             if not os.path.exists(tarball):
                 get("{}/{}".format(url, filename), tarball, verbose=self.verbose)
             unpack(tarball, self.bin_root(), match="cargo", verbose=self.verbose)
             self.fix_executable(self.bin_root() + "/bin/cargo")
             with open(self.cargo_stamp(), 'w') as f:
-                f.write(self.stage0_rustc_date())
+                f.write(self.stage0_date())
 
     def fix_executable(self, fname):
         # If we're on NixOS we need to change the path to the dynamic loader
@@ -264,12 +265,15 @@ class RustBuild(object):
             print("warning: failed to call patchelf: %s" % e)
             return
 
-    def stage0_rustc_date(self):
-        return self._rustc_date
+    def stage0_date(self):
+        return self._date
 
     def stage0_rustc_channel(self):
         return self._rustc_channel
 
+    def stage0_cargo_channel(self):
+        return self._cargo_channel
+
     def rustc_stamp(self):
         return os.path.join(self.bin_root(), '.rustc-stamp')
 
@@ -280,13 +284,13 @@ class RustBuild(object):
         if not os.path.exists(self.rustc_stamp()) or self.clean:
             return True
         with open(self.rustc_stamp(), 'r') as f:
-            return self.stage0_rustc_date() != f.read()
+            return self.stage0_date() != f.read()
 
     def cargo_out_of_date(self):
         if not os.path.exists(self.cargo_stamp()) or self.clean:
             return True
         with open(self.cargo_stamp(), 'r') as f:
-            return self.stage0_rustc_date() != f.read()
+            return self.stage0_date() != f.read()
 
     def bin_root(self):
         return os.path.join(self.build_dir, self.build, "stage0")
@@ -585,7 +589,13 @@ def bootstrap():
             shutil.rmtree('.cargo')
 
     data = stage0_data(rb.rust_root)
-    rb._rustc_channel, rb._rustc_date = data['rustc'].split('-', 1)
+    rb._date = data['date']
+    rb._rustc_channel = data['rustc']
+    rb._cargo_channel = data['cargo']
+    if 'dev' in data:
+        rb._download_url = 'https://dev-static.rust-lang.org'
+    else:
+        rb._download_url = 'https://static.rust-lang.org'
 
     # Fetch/build the bootstrap
     rb.build = rb.build_triple()
diff --git a/src/bootstrap/channel.rs b/src/bootstrap/channel.rs
index a95bdcb3d26..1b9536fba35 100644
--- a/src/bootstrap/channel.rs
+++ b/src/bootstrap/channel.rs
@@ -23,7 +23,7 @@ use build_helper::output;
 use Build;
 
 // The version number
-pub const CFG_RELEASE_NUM: &'static str = "1.18.0";
+pub const CFG_RELEASE_NUM: &'static str = "1.19.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
diff --git a/src/bootstrap/check.rs b/src/bootstrap/check.rs
index 1bcec2cdede..4e9f5913b49 100644
--- a/src/bootstrap/check.rs
+++ b/src/bootstrap/check.rs
@@ -106,7 +106,7 @@ pub fn cargo(build: &Build, stage: u32, host: &str) {
     let ref newpath = format!("{}{}{}", path.display(), sep, old_path);
 
     let mut cargo = build.cargo(compiler, Mode::Tool, host, "test");
-    cargo.arg("--manifest-path").arg(build.src.join("cargo/Cargo.toml"));
+    cargo.arg("--manifest-path").arg(build.src.join("src/tools/cargo/Cargo.toml"));
 
     // Don't build tests dynamically, just a pain to work with
     cargo.env("RUSTC_NO_PREFER_DYNAMIC", "1");
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
index 6f1de62d07e..c810a0e05d4 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
@@ -461,10 +461,7 @@ pub fn tool(build: &Build, stage: u32, target: &str, tool: &str) {
     let compiler = Compiler::new(stage, &build.config.build);
 
     let mut cargo = build.cargo(&compiler, Mode::Tool, target, "build");
-    let mut dir = build.src.join(tool);
-    if !dir.exists() {
-        dir = build.src.join("src/tools").join(tool);
-    }
+    let dir = build.src.join("src/tools").join(tool);
     cargo.arg("--manifest-path").arg(dir.join("Cargo.toml"));
 
     // We don't want to build tools dynamically as they'll be running across
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
index 639ba5d5b0c..5e8d0f4e0c3 100644
--- a/src/bootstrap/dist.rs
+++ b/src/bootstrap/dist.rs
@@ -394,8 +394,6 @@ pub fn rust_src(build: &Build) {
     let src_dirs = [
         "man",
         "src",
-        "cargo",
-        "rls",
     ];
 
     let filter_fn = move |path: &Path| {
@@ -576,7 +574,7 @@ pub fn cargo(build: &Build, stage: u32, target: &str) {
     println!("Dist cargo stage{} ({})", stage, target);
     let compiler = Compiler::new(stage, &build.config.build);
 
-    let src = build.src.join("cargo");
+    let src = build.src.join("src/tools/cargo");
     let etc = src.join("src/etc");
     let release_num = build.release_num("cargo");
     let name = pkgname(build, "cargo");
@@ -637,7 +635,7 @@ pub fn rls(build: &Build, stage: u32, target: &str) {
     println!("Dist RLS stage{} ({})", stage, target);
     let compiler = Compiler::new(stage, &build.config.build);
 
-    let src = build.src.join("rls");
+    let src = build.src.join("src/tools/rls");
     let release_num = build.release_num("rls");
     let name = pkgname(build, "rls");
     let version = build.rls_info.version(build, &release_num);
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index 2852421ad28..017d4015134 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -234,8 +234,8 @@ impl Build {
             None => false,
         };
         let rust_info = channel::GitInfo::new(&src);
-        let cargo_info = channel::GitInfo::new(&src.join("cargo"));
-        let rls_info = channel::GitInfo::new(&src.join("rls"));
+        let cargo_info = channel::GitInfo::new(&src.join("src/tools/cargo"));
+        let rls_info = channel::GitInfo::new(&src.join("src/tools/rls"));
         let src_is_git = src.join(".git").exists();
 
         Build {
@@ -1071,7 +1071,7 @@ impl Build {
     /// Returns the `a.b.c` version that the given package is at.
     fn release_num(&self, package: &str) -> String {
         let mut toml = String::new();
-        let toml_file_name = self.src.join(&format!("{}/Cargo.toml", package));
+        let toml_file_name = self.src.join(&format!("src/tools/{}/Cargo.toml", package));
         t!(t!(File::open(toml_file_name)).read_to_string(&mut toml));
         for line in toml.lines() {
             let prefix = "version = \"";
diff --git a/src/bootstrap/step.rs b/src/bootstrap/step.rs
index c15e889394f..f69b68a9545 100644
--- a/src/bootstrap/step.rs
+++ b/src/bootstrap/step.rs
@@ -574,7 +574,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
          .dep(|s| s.name("maybe-clean-tools"))
          .dep(|s| s.name("libstd-tool"))
          .run(move |s| compile::tool(build, s.stage, s.target, "remote-test-client"));
-    rules.build("tool-cargo", "cargo")
+    rules.build("tool-cargo", "src/tools/cargo")
          .host(true)
          .default(build.config.extended)
          .dep(|s| s.name("maybe-clean-tools"))
@@ -588,7 +588,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
               .host(&build.config.build)
          })
          .run(move |s| compile::tool(build, s.stage, s.target, "cargo"));
-    rules.build("tool-rls", "rls")
+    rules.build("tool-rls", "src/tools/rls")
          .host(true)
          .default(build.config.extended)
          .dep(|s| s.name("librustc-tool"))