Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support extra-verbose builds #48943

Merged
merged 1 commit into from
Mar 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,10 +597,8 @@ def build_bootstrap(self):
self.cargo()))
args = [self.cargo(), "build", "--manifest-path",
os.path.join(self.rust_root, "src/bootstrap/Cargo.toml")]
if self.verbose:
for _ in range(1, self.verbose):
args.append("--verbose")
if self.verbose > 1:
args.append("--verbose")
if self.use_locked_deps:
args.append("--locked")
if self.use_vendored_sources:
Expand Down Expand Up @@ -675,7 +673,7 @@ def bootstrap(help_triggered):
parser.add_argument('--config')
parser.add_argument('--build')
parser.add_argument('--clean', action='store_true')
parser.add_argument('-v', '--verbose', action='store_true')
parser.add_argument('-v', '--verbose', action='count', default=0)

args = [a for a in sys.argv if a != '-h' and a != '--help']
args, _ = parser.parse_known_args(args)
Expand All @@ -691,10 +689,9 @@ def bootstrap(help_triggered):
except (OSError, IOError):
pass

if '\nverbose = 2' in build.config_toml:
build.verbose = 2
elif '\nverbose = 1' in build.config_toml:
build.verbose = 1
match = re.search(r'\nverbose = (\d+)', build.config_toml)
if match is not None:
build.verbose = max(build.verbose, int(match.group(1)))

build.use_vendored_sources = '\nvendor = true' in build.config_toml

Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ impl<'a> Builder<'a> {
cargo.env("WINAPI_NO_BUNDLED_LIBRARIES", "1");
}

if self.is_very_verbose() {
for _ in 1..self.verbosity {
cargo.arg("-v");
}

Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use cache::{Interned, INTERNER};

/// Deserialized version of all flags for this compile.
pub struct Flags {
pub verbose: usize, // verbosity level: 0 == not verbose, 1 == verbose, 2 == very verbose
pub verbose: usize, // number of -v args; each extra -v after the first is passed to Cargo
pub on_fail: Option<String>,
pub stage: Option<u32>,
pub keep_stage: Option<u32>,
Expand Down
4 changes: 0 additions & 4 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -605,10 +605,6 @@ impl Build {
self.verbosity > 0
}

pub fn is_very_verbose(&self) -> bool {
self.verbosity > 1
}

/// Prints a message if this build is configured in verbose mode.
fn verbose(&self, msg: &str) {
if self.is_verbose() {
Expand Down