@@ -113,7 +113,7 @@ impl Step for Linkcheck {
113113
114114 let _time = util:: timeit ( ) ;
115115 try_run ( build, builder. tool_cmd ( Tool :: Linkchecker )
116- . arg ( build. out . join ( host) . join ( "doc" ) ) ) ;
116+ . arg ( build. out . join ( host) . join ( "doc" ) ) ) ;
117117 }
118118
119119 fn should_run ( run : ShouldRun ) -> ShouldRun {
@@ -424,6 +424,47 @@ fn path_for_cargo(builder: &Builder, compiler: Compiler) -> OsString {
424424 env:: join_paths ( iter:: once ( path) . chain ( env:: split_paths ( & old_path) ) ) . expect ( "" )
425425}
426426
427+ #[ derive( Debug , Copy , Clone , Hash , PartialEq , Eq ) ]
428+ pub struct RustdocTheme {
429+ pub compiler : Compiler ,
430+ }
431+
432+ impl Step for RustdocTheme {
433+ type Output = ( ) ;
434+ const DEFAULT : bool = true ;
435+ const ONLY_HOSTS : bool = true ;
436+
437+ fn should_run ( run : ShouldRun ) -> ShouldRun {
438+ run. path ( "src/tools/rustdoc-themes" )
439+ }
440+
441+ fn make_run ( run : RunConfig ) {
442+ let compiler = run. builder . compiler ( run. builder . top_stage , run. host ) ;
443+
444+ run. builder . ensure ( RustdocTheme {
445+ compiler : compiler,
446+ } ) ;
447+ }
448+
449+ fn run ( self , builder : & Builder ) {
450+ let rustdoc = builder. rustdoc ( self . compiler . host ) ;
451+ let mut cmd = builder. tool_cmd ( Tool :: RustdocTheme ) ;
452+ cmd. arg ( rustdoc. to_str ( ) . unwrap ( ) )
453+ . arg ( builder. src . join ( "src/librustdoc/html/static/themes" ) . to_str ( ) . unwrap ( ) )
454+ . env ( "RUSTC_STAGE" , self . compiler . stage . to_string ( ) )
455+ . env ( "RUSTC_SYSROOT" , builder. sysroot ( self . compiler ) )
456+ . env ( "RUSTDOC_LIBDIR" , builder. sysroot_libdir ( self . compiler , self . compiler . host ) )
457+ . env ( "CFG_RELEASE_CHANNEL" , & builder. build . config . channel )
458+ . env ( "RUSTDOC_REAL" , builder. rustdoc ( self . compiler . host ) )
459+ . env ( "RUSTDOC_CRATE_VERSION" , builder. build . rust_version ( ) )
460+ . env ( "RUSTC_BOOTSTRAP" , "1" ) ;
461+ if let Some ( linker) = builder. build . linker ( self . compiler . host ) {
462+ cmd. env ( "RUSTC_TARGET_LINKER" , linker) ;
463+ }
464+ try_run ( builder. build , & mut cmd) ;
465+ }
466+ }
467+
427468#[ derive( Debug , Copy , Clone , Hash , PartialEq , Eq ) ]
428469pub struct RustdocJS {
429470 pub host : Interned < String > ,
0 commit comments