Skip to content

Commit 5a89d0b

Browse files
authored
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 2e20ad8 + 3e2390f commit 5a89d0b

File tree

1 file changed

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

1 file changed

+14
-3
lines changed

Diff for: src/tools/build-manifest/src/main.rs

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

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

193+
let filename = format!("channel-rust-{}-date.txt", self.rust_release);
194+
self.write_date_stamp(&date, &filename);
195+
193196
if self.rust_release != "beta" && self.rust_release != "nightly" {
194197
self.write_manifest(&manifest, "channel-rust-stable.toml");
198+
self.write_date_stamp(&date, "channel-rust-stable-date.txt");
195199
}
196200
}
197201

@@ -218,7 +222,7 @@ impl Builder {
218222
self.package("rust-docs", &mut manifest.pkg, TARGETS);
219223
self.package("rust-src", &mut manifest.pkg, &["*"]);
220224

221-
if self.channel == "nightly" {
225+
if self.rust_release == "nightly" {
222226
self.package("rust-analysis", &mut manifest.pkg, TARGETS);
223227
}
224228

@@ -271,7 +275,7 @@ impl Builder {
271275
target: target.to_string(),
272276
});
273277
}
274-
if self.channel == "nightly" {
278+
if self.rust_release == "nightly" {
275279
extensions.push(Component {
276280
pkg: "rust-analysis".to_string(),
277281
target: target.to_string(),
@@ -411,4 +415,11 @@ impl Builder {
411415
self.hash(&dst);
412416
self.sign(&dst);
413417
}
418+
419+
fn write_date_stamp(&self, date: &str, name: &str) {
420+
let dst = self.output.join(name);
421+
t!(t!(File::create(&dst)).write_all(date.as_bytes()));
422+
self.hash(&dst);
423+
self.sign(&dst);
424+
}
414425
}

0 commit comments

Comments
 (0)