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
-
7
1
use toml;
8
2
use serde:: Serialize ;
9
3
10
4
use std:: collections:: BTreeMap ;
11
5
use std:: env;
12
6
use std:: fs;
13
- use std:: io:: { self , Read , Write , BufRead , BufReader } ;
7
+ use std:: io:: { self , Read , Write } ;
14
8
use std:: path:: { PathBuf , Path } ;
15
9
use std:: process:: { Command , Stdio } ;
16
- use std:: collections:: HashMap ;
17
10
18
11
static HOSTS : & [ & str ] = & [
19
12
"aarch64-unknown-linux-gnu" ,
@@ -153,9 +146,6 @@ static MINGW: &[&str] = &[
153
146
"x86_64-pc-windows-gnu" ,
154
147
] ;
155
148
156
- static TOOLSTATE : & str =
157
- "https://raw.githubusercontent.com/rust-lang-nursery/rust-toolstate/master/history/linux.tsv" ;
158
-
159
149
#[ derive( Serialize ) ]
160
150
#[ serde( rename_all = "kebab-case" ) ]
161
151
struct Manifest {
@@ -280,7 +270,6 @@ fn main() {
280
270
// Do not ask for a passphrase while manually testing
281
271
let mut passphrase = String :: new ( ) ;
282
272
if should_sign {
283
- // `x.py` passes the passphrase via stdin.
284
273
t ! ( io:: stdin( ) . read_to_string( & mut passphrase) ) ;
285
274
}
286
275
@@ -364,7 +353,6 @@ impl Builder {
364
353
self . lldb_git_commit_hash = self . git_commit_hash ( "lldb" , "x86_64-unknown-linux-gnu" ) ;
365
354
self . miri_git_commit_hash = self . git_commit_hash ( "miri" , "x86_64-unknown-linux-gnu" ) ;
366
355
367
- self . check_toolstate ( ) ;
368
356
self . digest_and_sign ( ) ;
369
357
let manifest = self . build_manifest ( ) ;
370
358
self . write_channel_files ( & self . rust_release , & manifest) ;
@@ -374,37 +362,6 @@ impl Builder {
374
362
}
375
363
}
376
364
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`.
408
365
fn digest_and_sign ( & mut self ) {
409
366
for file in t ! ( self . input. read_dir( ) ) . map ( |e| t ! ( e) . path ( ) ) {
410
367
let filename = file. file_name ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) ;
@@ -575,20 +532,19 @@ impl Builder {
575
532
. as_ref ( )
576
533
. cloned ( )
577
534
. map ( |version| ( version, true ) )
578
- . unwrap_or_default ( ) ; // `is_present` defaults to `false` here.
535
+ . unwrap_or_default ( ) ;
579
536
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>
581
539
if pkgname == "miri-preview" && self . rust_release != "nightly" {
582
- is_present = false ; // Pretend the component is entirely missing.
540
+ is_present = false ; // ignore it
583
541
}
584
542
585
543
let targets = targets. iter ( ) . map ( |name| {
586
544
if is_present {
587
- // The component generally exists, but it might still be missing for this target.
588
545
let filename = self . filename ( pkgname, name) ;
589
546
let digest = match self . digests . remove ( & filename) {
590
547
Some ( digest) => digest,
591
- // This component does not exist for this target -- skip it.
592
548
None => return ( name. to_string ( ) , Target :: unavailable ( ) ) ,
593
549
} ;
594
550
let xz_filename = filename. replace ( ".tar.gz" , ".tar.xz" ) ;
0 commit comments