]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #40225 - shepmaster:restore-build-date-file, r=alexcrichton
authorAlex Crichton <alex@alexcrichton.com>
Fri, 10 Mar 2017 22:51:19 +0000 (16:51 -0600)
committerAlex Crichton <alex@alexcrichton.com>
Sat, 11 Mar 2017 00:18:27 +0000 (16:18 -0800)
Restore creating the channel-rust-$channel-date.txt files

I have **not** run this (because I don't know how to ðŸ˜‡), but it *does* compile.

r? @alexcrichton

1  2 
src/tools/build-manifest/src/main.rs

index 9449fac2197df9cf161b510c28bdb49884305224,b9c8a848444655da732e0b5c02e712e4bd049d74..c2ec42195fcb7e16a76601780e46a10334e1ac60
@@@ -45,7 -45,6 +45,7 @@@ static HOSTS: &'static [&'static str] 
  
  static TARGETS: &'static [&'static str] = &[
      "aarch64-apple-ios",
 +    "aarch64-unknown-fuchsia",
      "aarch64-linux-android",
      "aarch64-unknown-linux-gnu",
      "arm-linux-androideabi",
@@@ -87,7 -86,6 +87,7 @@@
      "x86_64-pc-windows-msvc",
      "x86_64-rumprun-netbsd",
      "x86_64-unknown-freebsd",
 +    "x86_64-unknown-fuchsia",
      "x86_64-unknown-linux-gnu",
      "x86_64-unknown-linux-musl",
      "x86_64-unknown-netbsd",
@@@ -185,15 -183,19 +185,19 @@@ impl Builder 
          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));
+         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 filename = format!("channel-rust-{}.toml", self.rust_release);
          self.write_manifest(&manifest, &filename);
  
+         let filename = format!("channel-rust-{}-date.txt", self.rust_release);
+         self.write_date_stamp(&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.package("rust-docs", &mut manifest.pkg, TARGETS);
          self.package("rust-src", &mut manifest.pkg, &["*"]);
  
-         if self.channel == "nightly" {
+         if self.rust_release == "nightly" {
              self.package("rust-analysis", &mut manifest.pkg, TARGETS);
          }
  
                          target: target.to_string(),
                      });
                  }
-                 if self.channel == "nightly" {
+                 if self.rust_release == "nightly" {
                      extensions.push(Component {
                          pkg: "rust-analysis".to_string(),
                          target: target.to_string(),
          self.hash(&dst);
          self.sign(&dst);
      }
+     fn write_date_stamp(&self, date: &str, name: &str) {
+         let dst = self.output.join(name);
+         t!(t!(File::create(&dst)).write_all(date.as_bytes()));
+         self.hash(&dst);
+         self.sign(&dst);
+     }
  }