Skip to content

Commit 37265d8

Browse files
committed
Rollup merge of rust-lang#40225 - shepmaster:restore-build-date-file, r=alexcrichton
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
2 parents da994cd + 3e2390f commit 37265d8

File tree

1 file changed

+14
-3
lines changed
  • src/tools/build-manifest/src

1 file changed

+14
-3
lines changed

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

+14-3
Original file line numberDiff line numberDiff line change
@@ -185,15 +185,19 @@ impl Builder {
185185
let mut manifest = BTreeMap::new();
186186
manifest.insert("manifest-version".to_string(),
187187
toml::Value::String(manifest_version));
188-
manifest.insert("date".to_string(), toml::Value::String(date));
188+
manifest.insert("date".to_string(), toml::Value::String(date.clone()));
189189
manifest.insert("pkg".to_string(), toml::encode(&pkg));
190190
let manifest = toml::Value::Table(manifest).to_string();
191191

192192
let filename = format!("channel-rust-{}.toml", self.rust_release);
193193
self.write_manifest(&manifest, &filename);
194194

195+
let filename = format!("channel-rust-{}-date.txt", self.rust_release);
196+
self.write_date_stamp(&date, &filename);
197+
195198
if self.rust_release != "beta" && self.rust_release != "nightly" {
196199
self.write_manifest(&manifest, "channel-rust-stable.toml");
200+
self.write_date_stamp(&date, "channel-rust-stable-date.txt");
197201
}
198202
}
199203

@@ -220,7 +224,7 @@ impl Builder {
220224
self.package("rust-docs", &mut manifest.pkg, TARGETS);
221225
self.package("rust-src", &mut manifest.pkg, &["*"]);
222226

223-
if self.channel == "nightly" {
227+
if self.rust_release == "nightly" {
224228
self.package("rust-analysis", &mut manifest.pkg, TARGETS);
225229
}
226230

@@ -273,7 +277,7 @@ impl Builder {
273277
target: target.to_string(),
274278
});
275279
}
276-
if self.channel == "nightly" {
280+
if self.rust_release == "nightly" {
277281
extensions.push(Component {
278282
pkg: "rust-analysis".to_string(),
279283
target: target.to_string(),
@@ -413,4 +417,11 @@ impl Builder {
413417
self.hash(&dst);
414418
self.sign(&dst);
415419
}
420+
421+
fn write_date_stamp(&self, date: &str, name: &str) {
422+
let dst = self.output.join(name);
423+
t!(t!(File::create(&dst)).write_all(date.as_bytes()));
424+
self.hash(&dst);
425+
self.sign(&dst);
426+
}
416427
}

0 commit comments

Comments
 (0)