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-
71use toml;
82use serde:: Serialize ;
93
104use std:: collections:: BTreeMap ;
115use std:: env;
126use std:: fs;
13- use std:: io:: { self , Read , Write , BufRead , BufReader } ;
7+ use std:: io:: { self , Read , Write } ;
148use std:: path:: { PathBuf , Path } ;
159use std:: process:: { Command , Stdio } ;
16- use std:: collections:: HashMap ;
1710
1811static 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" ) ]
161151struct 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