Skip to content

Commit 5a26b65

Browse files
authored
Auto merge of #2630 - alexcrichton:build-script-warnings, r=brson
Add build script warnings, streaming output from build scripts to the console These commits add a few features to Cargo: * Cargo now recognizes the `warning` key in build scripts and will print warnings *after a build script has completed* if the build script is for a path dependency. That is, if a build script prints `cargo:warning=foo` then Cargo will forward that to the console if the crate's being developed. * Cargo now accepts multiple `-v` flags for all commands. The `-vv` flag prints warnings for *all* upstream crates, not just the local ones. * When the `-vv` flag is passed Cargo will stream the output of all build scripts to the console, allowing more easy debugging of what happened if the build fails later on. More details can be found in each commit, and otherwise this Closes #1106
2 parents 941f488 + 26690d3 commit 5a26b65

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+667
-117
lines changed

Cargo.lock

Lines changed: 38 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ glob = "0.2"
3333
kernel32-sys = "0.2"
3434
libc = "0.2"
3535
log = "0.3"
36+
miow = "0.1"
3637
num_cpus = "0.2"
3738
regex = "0.1"
3839
rustc-serialize = "0.3"

src/bin/bench.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub struct Options {
1111
flag_no_default_features: bool,
1212
flag_target: Option<String>,
1313
flag_manifest_path: Option<String>,
14-
flag_verbose: Option<bool>,
14+
flag_verbose: u32,
1515
flag_quiet: Option<bool>,
1616
flag_color: Option<String>,
1717
flag_lib: bool,
@@ -42,7 +42,7 @@ Options:
4242
--no-default-features Do not build the `default` feature
4343
--target TRIPLE Build for the target triple
4444
--manifest-path PATH Path to the manifest to build benchmarks for
45-
-v, --verbose Use verbose output
45+
-v, --verbose ... Use verbose output
4646
-q, --quiet No output printed to stdout
4747
--color WHEN Coloring: auto, always, never
4848

src/bin/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub struct Options {
1313
flag_no_default_features: bool,
1414
flag_target: Option<String>,
1515
flag_manifest_path: Option<String>,
16-
flag_verbose: Option<bool>,
16+
flag_verbose: u32,
1717
flag_quiet: Option<bool>,
1818
flag_color: Option<String>,
1919
flag_release: bool,
@@ -44,7 +44,7 @@ Options:
4444
--no-default-features Do not build the `default` feature
4545
--target TRIPLE Build for the target triple
4646
--manifest-path PATH Path to the manifest to compile
47-
-v, --verbose Use verbose output
47+
-v, --verbose ... Use verbose output
4848
-q, --quiet No output printed to stdout
4949
--color WHEN Coloring: auto, always, never
5050

src/bin/cargo.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use cargo::util::process_builder::process;
2121
pub struct Flags {
2222
flag_list: bool,
2323
flag_version: bool,
24-
flag_verbose: Option<bool>,
24+
flag_verbose: u32,
2525
flag_quiet: Option<bool>,
2626
flag_color: Option<String>,
2727
flag_explain: Option<String>,
@@ -41,7 +41,7 @@ Options:
4141
-V, --version Print version info and exit
4242
--list List installed commands
4343
--explain CODE Run `rustc --explain CODE`
44-
-v, --verbose Use verbose output
44+
-v, --verbose ... Use verbose output
4545
-q, --quiet No output printed to stdout
4646
--color WHEN Coloring: auto, always, never
4747

src/bin/clean.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub struct Options {
99
flag_package: Vec<String>,
1010
flag_target: Option<String>,
1111
flag_manifest_path: Option<String>,
12-
flag_verbose: Option<bool>,
12+
flag_verbose: u32,
1313
flag_quiet: Option<bool>,
1414
flag_color: Option<String>,
1515
flag_release: bool,
@@ -27,7 +27,7 @@ Options:
2727
--manifest-path PATH Path to the manifest to the package to clean
2828
--target TRIPLE Target triple to clean output for (default all)
2929
--release Whether or not to clean release artifacts
30-
-v, --verbose Use verbose output
30+
-v, --verbose ... Use verbose output
3131
-q, --quiet No output printed to stdout
3232
--color WHEN Coloring: auto, always, never
3333

src/bin/doc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub struct Options {
1212
flag_no_deps: bool,
1313
flag_open: bool,
1414
flag_release: bool,
15-
flag_verbose: Option<bool>,
15+
flag_verbose: u32,
1616
flag_quiet: Option<bool>,
1717
flag_color: Option<String>,
1818
flag_package: Vec<String>,
@@ -39,7 +39,7 @@ Options:
3939
--no-default-features Do not build the `default` feature
4040
--target TRIPLE Build for the target triple
4141
--manifest-path PATH Path to the manifest to document
42-
-v, --verbose Use verbose output
42+
-v, --verbose ... Use verbose output
4343
-q, --quiet No output printed to stdout
4444
--color WHEN Coloring: auto, always, never
4545

src/bin/fetch.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use cargo::util::important_paths::find_root_manifest_for_wd;
55
#[derive(RustcDecodable)]
66
pub struct Options {
77
flag_manifest_path: Option<String>,
8-
flag_verbose: Option<bool>,
8+
flag_verbose: u32,
99
flag_quiet: Option<bool>,
1010
flag_color: Option<String>,
1111
}
@@ -19,7 +19,7 @@ Usage:
1919
Options:
2020
-h, --help Print this message
2121
--manifest-path PATH Path to the manifest to fetch dependencies for
22-
-v, --verbose Use verbose output
22+
-v, --verbose ... Use verbose output
2323
-q, --quiet No output printed to stdout
2424
--color WHEN Coloring: auto, always, never
2525

src/bin/generate_lockfile.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use cargo::util::important_paths::find_root_manifest_for_wd;
77
#[derive(RustcDecodable)]
88
pub struct Options {
99
flag_manifest_path: Option<String>,
10-
flag_verbose: Option<bool>,
10+
flag_verbose: u32,
1111
flag_quiet: Option<bool>,
1212
flag_color: Option<String>,
1313
}
@@ -21,7 +21,7 @@ Usage:
2121
Options:
2222
-h, --help Print this message
2323
--manifest-path PATH Path to the manifest to generate a lockfile for
24-
-v, --verbose Use verbose output
24+
-v, --verbose ... Use verbose output
2525
-q, --quiet No output printed to stdout
2626
--color WHEN Coloring: auto, always, never
2727
";

src/bin/git_checkout.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use cargo::util::{Config, CliResult, CliError, human, ToUrl};
66
pub struct Options {
77
flag_url: String,
88
flag_reference: String,
9-
flag_verbose: Option<bool>,
9+
flag_verbose: u32,
1010
flag_quiet: Option<bool>,
1111
flag_color: Option<String>,
1212
}
@@ -20,7 +20,7 @@ Usage:
2020
2121
Options:
2222
-h, --help Print this message
23-
-v, --verbose Use verbose output
23+
-v, --verbose ... Use verbose output
2424
-q, --quiet No output printed to stdout
2525
--color WHEN Coloring: auto, always, never
2626
";

0 commit comments

Comments
 (0)