Skip to content

Commit f504e37

Browse files
committed
Auto merge of #64543 - pietroalbini:revert-miri-manifest, r=pietroalbini
Revert #64451 #64451 is making the release process panic, causing today's missing nightly (see #64540). This reverts that PR, but I'm happy to review a fixed version of it. cc @RalfJung r? @ghost Fixes #64540
2 parents 5670d04 + a7a6ded commit f504e37

File tree

4 files changed

+9
-63
lines changed

4 files changed

+9
-63
lines changed

Cargo.lock

-2
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,7 @@ dependencies = [
201201
name = "build-manifest"
202202
version = "0.1.0"
203203
dependencies = [
204-
"reqwest",
205204
"serde",
206-
"serde_json",
207205
"toml",
208206
]
209207

src/bootstrap/dist.rs

+4-10
Original file line numberDiff line numberDiff line change
@@ -2000,8 +2000,6 @@ impl Step for HashSign {
20002000
}
20012001

20022002
fn run(self, builder: &Builder<'_>) {
2003-
// This gets called by `promote-release`
2004-
// (https://github.com/rust-lang/rust-central-station/tree/master/promote-release).
20052003
let mut cmd = builder.tool_cmd(Tool::BuildManifest);
20062004
if builder.config.dry_run {
20072005
return;
@@ -2012,14 +2010,10 @@ impl Step for HashSign {
20122010
let addr = builder.config.dist_upload_addr.as_ref().unwrap_or_else(|| {
20132011
panic!("\n\nfailed to specify `dist.upload-addr` in `config.toml`\n\n")
20142012
});
2015-
let pass = if env::var("BUILD_MANIFEST_DISABLE_SIGNING").is_err() {
2016-
let file = builder.config.dist_gpg_password_file.as_ref().unwrap_or_else(|| {
2017-
panic!("\n\nfailed to specify `dist.gpg-password-file` in `config.toml`\n\n")
2018-
});
2019-
t!(fs::read_to_string(&file))
2020-
} else {
2021-
String::new()
2022-
};
2013+
let file = builder.config.dist_gpg_password_file.as_ref().unwrap_or_else(|| {
2014+
panic!("\n\nfailed to specify `dist.gpg-password-file` in `config.toml`\n\n")
2015+
});
2016+
let pass = t!(fs::read_to_string(&file));
20232017

20242018
let today = output(Command::new("date").arg("+%Y-%m-%d"));
20252019

src/tools/build-manifest/Cargo.toml

-2
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,3 @@ edition = "2018"
77
[dependencies]
88
toml = "0.5"
99
serde = { version = "1.0", features = ["derive"] }
10-
serde_json = "1.0"
11-
reqwest = "0.9"

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

+5-49
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
1-
//! Build a dist manifest, hash and sign everything.
2-
//! This gets called by `promote-release`
3-
//! (https://github.com/rust-lang/rust-central-station/tree/master/promote-release)
4-
//! via `x.py dist hash-and-sign`; the cmdline arguments are set up
5-
//! by rustbuild (in `src/bootstrap/dist.rs`).
6-
71
use toml;
82
use serde::Serialize;
93

104
use std::collections::BTreeMap;
115
use std::env;
126
use std::fs;
13-
use std::io::{self, Read, Write, BufRead, BufReader};
7+
use std::io::{self, Read, Write};
148
use std::path::{PathBuf, Path};
159
use std::process::{Command, Stdio};
16-
use std::collections::HashMap;
1710

1811
static HOSTS: &[&str] = &[
1912
"aarch64-unknown-linux-gnu",
@@ -153,9 +146,6 @@ static MINGW: &[&str] = &[
153146
"x86_64-pc-windows-gnu",
154147
];
155148

156-
static TOOLSTATE: &str =
157-
"https://raw.githubusercontent.com/rust-lang-nursery/rust-toolstate/master/history/linux.tsv";
158-
159149
#[derive(Serialize)]
160150
#[serde(rename_all = "kebab-case")]
161151
struct Manifest {
@@ -280,7 +270,6 @@ fn main() {
280270
// Do not ask for a passphrase while manually testing
281271
let mut passphrase = String::new();
282272
if should_sign {
283-
// `x.py` passes the passphrase via stdin.
284273
t!(io::stdin().read_to_string(&mut passphrase));
285274
}
286275

@@ -364,7 +353,6 @@ impl Builder {
364353
self.lldb_git_commit_hash = self.git_commit_hash("lldb", "x86_64-unknown-linux-gnu");
365354
self.miri_git_commit_hash = self.git_commit_hash("miri", "x86_64-unknown-linux-gnu");
366355

367-
self.check_toolstate();
368356
self.digest_and_sign();
369357
let manifest = self.build_manifest();
370358
self.write_channel_files(&self.rust_release, &manifest);
@@ -374,37 +362,6 @@ impl Builder {
374362
}
375363
}
376364

377-
/// If a tool does not pass its tests, don't ship it.
378-
/// Right now, we do this only for Miri.
379-
fn check_toolstate(&mut self) {
380-
// Get the toolstate for this rust revision.
381-
let rev = self.rust_git_commit_hash.as_ref().expect("failed to determine rust git hash");
382-
let toolstates = reqwest::get(TOOLSTATE).expect("failed to get toolstates");
383-
let toolstates = BufReader::new(toolstates);
384-
let toolstate = toolstates.lines()
385-
.find_map(|line| {
386-
let line = line.expect("failed to read toolstate lines");
387-
let mut pieces = line.splitn(2, '\t');
388-
let commit = pieces.next().expect("malformed toolstate line");
389-
if commit != rev {
390-
// Not the right commit.
391-
return None;
392-
}
393-
// Return the 2nd piece, the JSON.
394-
Some(pieces.next().expect("malformed toolstate line").to_owned())
395-
})
396-
.expect("failed to find toolstate for rust commit");
397-
let toolstate: HashMap<String, String> =
398-
serde_json::from_str(&toolstate).expect("toolstate is malformed JSON");
399-
// Mark some tools as missing based on toolstate.
400-
if toolstate.get("miri").map(|s| &*s as &str) != Some("test-pass") {
401-
println!("Miri tests are not passing, removing component");
402-
self.miri_version = None;
403-
self.miri_git_commit_hash = None;
404-
}
405-
}
406-
407-
/// Hash all files, compute their signatures, and collect the hashes in `self.digests`.
408365
fn digest_and_sign(&mut self) {
409366
for file in t!(self.input.read_dir()).map(|e| t!(e).path()) {
410367
let filename = file.file_name().unwrap().to_str().unwrap();
@@ -575,20 +532,19 @@ impl Builder {
575532
.as_ref()
576533
.cloned()
577534
.map(|version| (version, true))
578-
.unwrap_or_default(); // `is_present` defaults to `false` here.
535+
.unwrap_or_default();
579536

580-
// Miri is nightly-only; never ship it for other trains.
537+
// miri needs to build std with xargo, which doesn't allow stable/beta:
538+
// <https://github.com/japaric/xargo/pull/204#issuecomment-374888868>
581539
if pkgname == "miri-preview" && self.rust_release != "nightly" {
582-
is_present = false; // Pretend the component is entirely missing.
540+
is_present = false; // ignore it
583541
}
584542

585543
let targets = targets.iter().map(|name| {
586544
if is_present {
587-
// The component generally exists, but it might still be missing for this target.
588545
let filename = self.filename(pkgname, name);
589546
let digest = match self.digests.remove(&filename) {
590547
Some(digest) => digest,
591-
// This component does not exist for this target -- skip it.
592548
None => return (name.to_string(), Target::unavailable()),
593549
};
594550
let xz_filename = filename.replace(".tar.gz", ".tar.xz");

0 commit comments

Comments
 (0)