|
| 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 | +
|
1 | 7 | use toml;
|
2 | 8 | use serde::Serialize;
|
3 | 9 |
|
@@ -270,6 +276,7 @@ fn main() {
|
270 | 276 | // Do not ask for a passphrase while manually testing
|
271 | 277 | let mut passphrase = String::new();
|
272 | 278 | if should_sign {
|
| 279 | + // `x.py` passes the passphrase via stdin. |
273 | 280 | t!(io::stdin().read_to_string(&mut passphrase));
|
274 | 281 | }
|
275 | 282 |
|
@@ -362,6 +369,7 @@ impl Builder {
|
362 | 369 | }
|
363 | 370 | }
|
364 | 371 |
|
| 372 | + /// Hash all files, compute their signatures, and collect the hashes in `self.digests`. |
365 | 373 | fn digest_and_sign(&mut self) {
|
366 | 374 | for file in t!(self.input.read_dir()).map(|e| t!(e).path()) {
|
367 | 375 | let filename = file.file_name().unwrap().to_str().unwrap();
|
@@ -532,19 +540,20 @@ impl Builder {
|
532 | 540 | .as_ref()
|
533 | 541 | .cloned()
|
534 | 542 | .map(|version| (version, true))
|
535 |
| - .unwrap_or_default(); |
| 543 | + .unwrap_or_default(); // `is_present` defaults to `false` here. |
536 | 544 |
|
537 |
| - // miri needs to build std with xargo, which doesn't allow stable/beta: |
538 |
| - // <https://github.com/japaric/xargo/pull/204#issuecomment-374888868> |
| 545 | + // Miri is nightly-only; never ship it for other trains. |
539 | 546 | if pkgname == "miri-preview" && self.rust_release != "nightly" {
|
540 |
| - is_present = false; // ignore it |
| 547 | + is_present = false; // Pretend the component is entirely missing. |
541 | 548 | }
|
542 | 549 |
|
543 | 550 | let targets = targets.iter().map(|name| {
|
544 | 551 | if is_present {
|
| 552 | + // The component generally exists, but it might still be missing for this target. |
545 | 553 | let filename = self.filename(pkgname, name);
|
546 | 554 | let digest = match self.digests.remove(&filename) {
|
547 | 555 | Some(digest) => digest,
|
| 556 | + // This component does not exist for this target -- skip it. |
548 | 557 | None => return (name.to_string(), Target::unavailable()),
|
549 | 558 | };
|
550 | 559 | let xz_filename = filename.replace(".tar.gz", ".tar.xz");
|
|
0 commit comments