Skip to content

Commit 133f8fc

Browse files
authored
Show elapsed time even in the case of a build failure (#1098)
Fixes microsoft/vcpkg#30443
1 parent a5a33c3 commit 133f8fc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/vcpkg/commands.install.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -521,13 +521,15 @@ namespace vcpkg
521521
msg::spec = action.spec);
522522
}
523523

524-
~TrackedPackageInstallGuard()
524+
void print_elapsed_time() const
525525
{
526526
current_summary.timing = build_timer.elapsed();
527527
msg::println(
528528
msgElapsedForPackage, msg::spec = current_summary.get_spec(), msg::elapsed = current_summary.timing);
529529
}
530530

531+
~TrackedPackageInstallGuard() { print_elapsed_time(); }
532+
531533
TrackedPackageInstallGuard(const TrackedPackageInstallGuard&) = delete;
532534
TrackedPackageInstallGuard& operator=(const TrackedPackageInstallGuard&) = delete;
533535
};
@@ -581,6 +583,7 @@ namespace vcpkg
581583
perform_install_plan_action(args, paths, action, status_db, binary_cache, build_logs_recorder);
582584
if (result.code != BuildResult::SUCCEEDED && keep_going == KeepGoing::NO)
583585
{
586+
this_install.print_elapsed_time();
584587
print_user_troubleshooting_message(action, paths, result.stdoutlog.then([&](auto&) -> Optional<Path> {
585588
auto issue_body_path = paths.installed().root() / "vcpkg" / "issue_body.md";
586589
paths.get_filesystem().write_contents(

0 commit comments

Comments
 (0)