about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2018-02-05 23:43:53 +0100
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2018-02-08 10:53:09 +0100
commitdec9fab768e43a5c75456bb61c21701502db6de6 (patch)
tree00c644b78a52c56bf8e393ba023fb35089f5bb0e /src/bootstrap
parentb1b11d4589e8f7486bfc181286b954c498bba4c9 (diff)
downloadrust-dec9fab768e43a5c75456bb61c21701502db6de6.tar.gz
rust-dec9fab768e43a5c75456bb61c21701502db6de6.zip
Convert python script to rust
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/test.rs19
-rw-r--r--src/bootstrap/tool.rs1
2 files changed, 9 insertions, 11 deletions
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs
index 351d10df28d..eae8ec1311d 100644
--- a/src/bootstrap/test.rs
+++ b/src/bootstrap/test.rs
@@ -113,7 +113,7 @@ impl Step for Linkcheck {
 
         let _time = util::timeit();
         try_run(build, builder.tool_cmd(Tool::Linkchecker)
-                            .arg(build.out.join(host).join("doc")));
+                              .arg(build.out.join(host).join("doc")));
     }
 
     fn should_run(run: ShouldRun) -> ShouldRun {
@@ -427,7 +427,6 @@ fn path_for_cargo(builder: &Builder, compiler: Compiler) -> OsString {
 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
 pub struct RustdocTheme {
     pub compiler: Compiler,
-    pub host: Interned<String>,
 }
 
 impl Step for RustdocTheme {
@@ -444,27 +443,25 @@ impl Step for RustdocTheme {
 
         run.builder.ensure(RustdocTheme {
             compiler: compiler,
-            host: run.builder.build.build,
         });
     }
 
     fn run(self, builder: &Builder) {
         let rustdoc = builder.rustdoc(self.compiler.host);
-        let mut cmd = Command::new(builder.config.python.clone().expect("python not defined"));
-        cmd.args(&[builder.src.join("src/tools/rustdoc-themes/test-themes.py").to_str().unwrap(),
-                   rustdoc.to_str().unwrap(),
-                   builder.src.join("src/librustdoc/html/static/themes").to_str().unwrap()]);
-        cmd.env("RUSTC_STAGE", self.compiler.stage.to_string())
+        let mut cmd = builder.tool_cmd(Tool::RustdocTheme);
+        cmd.arg(rustdoc.to_str().unwrap())
+           .arg(builder.src.join("src/librustdoc/html/static/themes").to_str().unwrap())
+           .env("RUSTC_STAGE", self.compiler.stage.to_string())
            .env("RUSTC_SYSROOT", builder.sysroot(self.compiler))
            .env("RUSTDOC_LIBDIR", builder.sysroot_libdir(self.compiler, self.compiler.host))
            .env("CFG_RELEASE_CHANNEL", &builder.build.config.channel)
-           .env("RUSTDOC_REAL", builder.rustdoc(self.host))
+           .env("RUSTDOC_REAL", builder.rustdoc(self.compiler.host))
            .env("RUSTDOC_CRATE_VERSION", builder.build.rust_version())
            .env("RUSTC_BOOTSTRAP", "1");
-        if let Some(linker) = builder.build.linker(self.host) {
+        if let Some(linker) = builder.build.linker(self.compiler.host) {
             cmd.env("RUSTC_TARGET_LINKER", linker);
         }
-        builder.run(&mut cmd);
+        try_run(builder.build, &mut cmd);
     }
 }
 
diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs
index ea055cb5d1b..9036eb044b5 100644
--- a/src/bootstrap/tool.rs
+++ b/src/bootstrap/tool.rs
@@ -260,6 +260,7 @@ tool!(
     BuildManifest, "src/tools/build-manifest", "build-manifest", Mode::Libstd;
     RemoteTestClient, "src/tools/remote-test-client", "remote-test-client", Mode::Libstd;
     RustInstaller, "src/tools/rust-installer", "fabricate", Mode::Libstd;
+    RustdocTheme, "src/tools/rustdoc-themes", "rustdoc-themes", Mode::Libstd;
 );
 
 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]