Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit aa3dc06

Browse files
authoredSep 20, 2019
Rollup merge of rust-lang#64618 - alexcrichton:improve-dist-output, r=Mark-Simulacrum
rustbuild: Improve output of `dist` step * Pass `/Q` to `iscc` on Windows to supress the thousands of lines of output about compressing documentation. * Print out what's happening before long steps * Use `timeit` to print out timing information for long-running installer assemblies. * Try to scope output of `Dist ...` to not also encompass actual build steps
2 parents d4d6864 + 255dd3f commit aa3dc06

File tree

1 file changed

+47
-19
lines changed

1 file changed

+47
-19
lines changed
 

‎src/bootstrap/dist.rs

+47-19
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use build_helper::{output, t};
1818

1919
use crate::{Compiler, Mode, LLVM_TOOLS};
2020
use crate::channel;
21-
use crate::util::{is_dylib, exe};
21+
use crate::util::{is_dylib, exe, timeit};
2222
use crate::builder::{Builder, RunConfig, ShouldRun, Step};
2323
use crate::compile;
2424
use crate::tool::{self, Tool};
@@ -91,14 +91,15 @@ impl Step for Docs {
9191

9292
let name = pkgname(builder, "rust-docs");
9393

94-
builder.info(&format!("Dist docs ({})", host));
9594
if !builder.config.docs {
96-
builder.info("\tskipping - docs disabled");
9795
return distdir(builder).join(format!("{}-{}.tar.gz", name, host));
9896
}
9997

10098
builder.default_doc(None);
10199

100+
builder.info(&format!("Dist docs ({})", host));
101+
let _time = timeit(builder);
102+
102103
let image = tmpdir(builder).join(format!("{}-{}-image", name, host));
103104
let _ = fs::remove_dir_all(&image);
104105

@@ -151,9 +152,7 @@ impl Step for RustcDocs {
151152

152153
let name = pkgname(builder, "rustc-docs");
153154

154-
builder.info(&format!("Dist compiler docs ({})", host));
155155
if !builder.config.compiler_docs {
156-
builder.info("\tskipping - compiler docs disabled");
157156
return distdir(builder).join(format!("{}-{}.tar.gz", name, host));
158157
}
159158

@@ -179,6 +178,9 @@ impl Step for RustcDocs {
179178
.arg("--component-name=rustc-docs")
180179
.arg("--legacy-manifest-dirs=rustlib,cargo")
181180
.arg("--bulk-dirs=share/doc/rust/html");
181+
182+
builder.info(&format!("Dist compiler docs ({})", host));
183+
let _time = timeit(builder);
182184
builder.run(&mut cmd);
183185
builder.remove_dir(&image);
184186

@@ -350,6 +352,7 @@ impl Step for Mingw {
350352
}
351353

352354
builder.info(&format!("Dist mingw ({})", host));
355+
let _time = timeit(builder);
353356
let name = pkgname(builder, "rust-mingw");
354357
let image = tmpdir(builder).join(format!("{}-{}-image", name, host));
355358
let _ = fs::remove_dir_all(&image);
@@ -403,7 +406,6 @@ impl Step for Rustc {
403406
let compiler = self.compiler;
404407
let host = self.compiler.host;
405408

406-
builder.info(&format!("Dist rustc stage{} ({})", compiler.stage, host));
407409
let name = pkgname(builder, "rustc");
408410
let image = tmpdir(builder).join(format!("{}-{}-image", name, host));
409411
let _ = fs::remove_dir_all(&image);
@@ -460,6 +462,9 @@ impl Step for Rustc {
460462
.arg(format!("--package-name={}-{}", name, host))
461463
.arg("--component-name=rustc")
462464
.arg("--legacy-manifest-dirs=rustlib,cargo");
465+
466+
builder.info(&format!("Dist rustc stage{} ({})", compiler.stage, host));
467+
let _time = timeit(builder);
463468
builder.run(&mut cmd);
464469
builder.remove_dir(&image);
465470
builder.remove_dir(&overlay);
@@ -662,8 +667,6 @@ impl Step for Std {
662667
let target = self.target;
663668

664669
let name = pkgname(builder, "rust-std");
665-
builder.info(&format!("Dist std stage{} ({} -> {})",
666-
compiler.stage, &compiler.host, target));
667670

668671
// The only true set of target libraries came from the build triple, so
669672
// let's reduce redundant work by only producing archives from that host.
@@ -714,6 +717,10 @@ impl Step for Std {
714717
.arg(format!("--package-name={}-{}", name, target))
715718
.arg(format!("--component-name=rust-std-{}", target))
716719
.arg("--legacy-manifest-dirs=rustlib,cargo");
720+
721+
builder.info(&format!("Dist std stage{} ({} -> {})",
722+
compiler.stage, &compiler.host, target));
723+
let _time = timeit(builder);
717724
builder.run(&mut cmd);
718725
builder.remove_dir(&image);
719726
distdir(builder).join(format!("{}-{}.tar.gz", name, target))
@@ -754,11 +761,9 @@ impl Step for Analysis {
754761
let compiler = self.compiler;
755762
let target = self.target;
756763
assert!(builder.config.extended);
757-
builder.info("Dist analysis");
758764
let name = pkgname(builder, "rust-analysis");
759765

760766
if &compiler.host != builder.config.build {
761-
builder.info("\tskipping, not a build host");
762767
return distdir(builder).join(format!("{}-{}.tar.gz", name, target));
763768
}
764769

@@ -786,6 +791,9 @@ impl Step for Analysis {
786791
.arg(format!("--package-name={}-{}", name, target))
787792
.arg(format!("--component-name=rust-analysis-{}", target))
788793
.arg("--legacy-manifest-dirs=rustlib,cargo");
794+
795+
builder.info("Dist analysis");
796+
let _time = timeit(builder);
789797
builder.run(&mut cmd);
790798
builder.remove_dir(&image);
791799
distdir(builder).join(format!("{}-{}.tar.gz", name, target))
@@ -874,8 +882,6 @@ impl Step for Src {
874882

875883
/// Creates the `rust-src` installer component
876884
fn run(self, builder: &Builder<'_>) -> PathBuf {
877-
builder.info("Dist src");
878-
879885
let name = pkgname(builder, "rust-src");
880886
let image = tmpdir(builder).join(format!("{}-image", name));
881887
let _ = fs::remove_dir_all(&image);
@@ -930,6 +936,9 @@ impl Step for Src {
930936
.arg(format!("--package-name={}", name))
931937
.arg("--component-name=rust-src")
932938
.arg("--legacy-manifest-dirs=rustlib,cargo");
939+
940+
builder.info("Dist src");
941+
let _time = timeit(builder);
933942
builder.run(&mut cmd);
934943

935944
builder.remove_dir(&image);
@@ -957,8 +966,6 @@ impl Step for PlainSourceTarball {
957966

958967
/// Creates the plain source tarball
959968
fn run(self, builder: &Builder<'_>) -> PathBuf {
960-
builder.info("Create plain source tarball");
961-
962969
// Make sure that the root folder of tarball has the correct name
963970
let plain_name = format!("{}-src", pkgname(builder, "rustc"));
964971
let plain_dst_src = tmpdir(builder).join(&plain_name);
@@ -1020,6 +1027,9 @@ impl Step for PlainSourceTarball {
10201027
.arg("--output").arg(&tarball)
10211028
.arg("--work-dir=.")
10221029
.current_dir(tmpdir(builder));
1030+
1031+
builder.info("Create plain source tarball");
1032+
let _time = timeit(builder);
10231033
builder.run(&mut cmd);
10241034
distdir(builder).join(&format!("{}.tar.gz", plain_name))
10251035
}
@@ -1073,7 +1083,6 @@ impl Step for Cargo {
10731083
let compiler = self.compiler;
10741084
let target = self.target;
10751085

1076-
builder.info(&format!("Dist cargo stage{} ({})", compiler.stage, target));
10771086
let src = builder.src.join("src/tools/cargo");
10781087
let etc = src.join("src/etc");
10791088
let release_num = builder.release_num("cargo");
@@ -1126,6 +1135,9 @@ impl Step for Cargo {
11261135
.arg(format!("--package-name={}-{}", name, target))
11271136
.arg("--component-name=cargo")
11281137
.arg("--legacy-manifest-dirs=rustlib,cargo");
1138+
1139+
builder.info(&format!("Dist cargo stage{} ({})", compiler.stage, target));
1140+
let _time = timeit(builder);
11291141
builder.run(&mut cmd);
11301142
distdir(builder).join(format!("{}-{}.tar.gz", name, target))
11311143
}
@@ -1161,7 +1173,6 @@ impl Step for Rls {
11611173
let target = self.target;
11621174
assert!(builder.config.extended);
11631175

1164-
builder.info(&format!("Dist RLS stage{} ({})", compiler.stage, target));
11651176
let src = builder.src.join("src/tools/rls");
11661177
let release_num = builder.release_num("rls");
11671178
let name = pkgname(builder, "rls");
@@ -1210,6 +1221,8 @@ impl Step for Rls {
12101221
.arg("--legacy-manifest-dirs=rustlib,cargo")
12111222
.arg("--component-name=rls-preview");
12121223

1224+
builder.info(&format!("Dist RLS stage{} ({})", compiler.stage, target));
1225+
let _time = timeit(builder);
12131226
builder.run(&mut cmd);
12141227
Some(distdir(builder).join(format!("{}-{}.tar.gz", name, target)))
12151228
}
@@ -1245,7 +1258,6 @@ impl Step for Clippy {
12451258
let target = self.target;
12461259
assert!(builder.config.extended);
12471260

1248-
builder.info(&format!("Dist clippy stage{} ({})", compiler.stage, target));
12491261
let src = builder.src.join("src/tools/clippy");
12501262
let release_num = builder.release_num("clippy");
12511263
let name = pkgname(builder, "clippy");
@@ -1299,6 +1311,8 @@ impl Step for Clippy {
12991311
.arg("--legacy-manifest-dirs=rustlib,cargo")
13001312
.arg("--component-name=clippy-preview");
13011313

1314+
builder.info(&format!("Dist clippy stage{} ({})", compiler.stage, target));
1315+
let _time = timeit(builder);
13021316
builder.run(&mut cmd);
13031317
Some(distdir(builder).join(format!("{}-{}.tar.gz", name, target)))
13041318
}
@@ -1334,7 +1348,6 @@ impl Step for Miri {
13341348
let target = self.target;
13351349
assert!(builder.config.extended);
13361350

1337-
builder.info(&format!("Dist miri stage{} ({})", compiler.stage, target));
13381351
let src = builder.src.join("src/tools/miri");
13391352
let release_num = builder.release_num("miri");
13401353
let name = pkgname(builder, "miri");
@@ -1389,6 +1402,8 @@ impl Step for Miri {
13891402
.arg("--legacy-manifest-dirs=rustlib,cargo")
13901403
.arg("--component-name=miri-preview");
13911404

1405+
builder.info(&format!("Dist miri stage{} ({})", compiler.stage, target));
1406+
let _time = timeit(builder);
13921407
builder.run(&mut cmd);
13931408
Some(distdir(builder).join(format!("{}-{}.tar.gz", name, target)))
13941409
}
@@ -1423,7 +1438,6 @@ impl Step for Rustfmt {
14231438
let compiler = self.compiler;
14241439
let target = self.target;
14251440

1426-
builder.info(&format!("Dist Rustfmt stage{} ({})", compiler.stage, target));
14271441
let src = builder.src.join("src/tools/rustfmt");
14281442
let release_num = builder.release_num("rustfmt");
14291443
let name = pkgname(builder, "rustfmt");
@@ -1476,6 +1490,8 @@ impl Step for Rustfmt {
14761490
.arg("--legacy-manifest-dirs=rustlib,cargo")
14771491
.arg("--component-name=rustfmt-preview");
14781492

1493+
builder.info(&format!("Dist Rustfmt stage{} ({})", compiler.stage, target));
1494+
let _time = timeit(builder);
14791495
builder.run(&mut cmd);
14801496
Some(distdir(builder).join(format!("{}-{}.tar.gz", name, target)))
14811497
}
@@ -1576,6 +1592,7 @@ impl Step for Extended {
15761592
input_tarballs.push(tarball);
15771593
}
15781594

1595+
builder.info("building combined installer");
15791596
let mut cmd = rust_installer(builder);
15801597
cmd.arg("combine")
15811598
.arg("--product-name=Rust")
@@ -1587,7 +1604,9 @@ impl Step for Extended {
15871604
.arg("--legacy-manifest-dirs=rustlib,cargo")
15881605
.arg("--input-tarballs").arg(input_tarballs)
15891606
.arg("--non-installed-overlay").arg(&overlay);
1607+
let time = timeit(&builder);
15901608
builder.run(&mut cmd);
1609+
drop(time);
15911610

15921611
let mut license = String::new();
15931612
license += &builder.read(&builder.src.join("COPYRIGHT"));
@@ -1643,6 +1662,7 @@ impl Step for Extended {
16431662
};
16441663

16451664
if target.contains("apple-darwin") {
1665+
builder.info("building pkg installer");
16461666
let pkg = tmp.join("pkg");
16471667
let _ = fs::remove_dir_all(&pkg);
16481668

@@ -1692,6 +1712,7 @@ impl Step for Extended {
16921712
pkgname(builder, "rust"),
16931713
target)))
16941714
.arg("--package-path").arg(&pkg);
1715+
let _time = timeit(builder);
16951716
builder.run(&mut cmd);
16961717
}
16971718

@@ -1742,14 +1763,18 @@ impl Step for Extended {
17421763
builder.create(&exe.join("LICENSE.txt"), &license);
17431764

17441765
// Generate exe installer
1766+
builder.info("building `exe` installer with `iscc`");
17451767
let mut cmd = Command::new("iscc");
17461768
cmd.arg("rust.iss")
1769+
.arg("/Q")
17471770
.current_dir(&exe);
17481771
if target.contains("windows-gnu") {
17491772
cmd.arg("/dMINGW");
17501773
}
17511774
add_env(builder, &mut cmd, target);
1775+
let time = timeit(builder);
17521776
builder.run(&mut cmd);
1777+
drop(time);
17531778
builder.install(&exe.join(format!("{}-{}.exe", pkgname(builder, "rust"), target)),
17541779
&distdir(builder),
17551780
0o755);
@@ -1914,6 +1939,7 @@ impl Step for Extended {
19141939
builder.install(&etc.join("gfx/banner.bmp"), &exe, 0o644);
19151940
builder.install(&etc.join("gfx/dialogbg.bmp"), &exe, 0o644);
19161941

1942+
builder.info(&format!("building `msi` installer with {:?}", light));
19171943
let filename = format!("{}-{}.msi", pkgname(builder, "rust"), target);
19181944
let mut cmd = Command::new(&light);
19191945
cmd.arg("-nologo")
@@ -1946,6 +1972,7 @@ impl Step for Extended {
19461972
// ICE57 wrongly complains about the shortcuts
19471973
cmd.arg("-sice:ICE57");
19481974

1975+
let _time = timeit(builder);
19491976
builder.run(&mut cmd);
19501977

19511978
if !builder.config.dry_run {
@@ -2114,6 +2141,7 @@ impl Step for LlvmTools {
21142141
}
21152142

21162143
builder.info(&format!("Dist LlvmTools ({})", target));
2144+
let _time = timeit(builder);
21172145
let src = builder.src.join("src/llvm-project/llvm");
21182146
let name = pkgname(builder, "llvm-tools");
21192147

0 commit comments

Comments
 (0)
Please sign in to comment.