Skip to content

Commit

Permalink
Show elapsed time even in the case of a build failure (#1098)
Browse files Browse the repository at this point in the history
  • Loading branch information
autoantwort authored Jun 15, 2023
1 parent a5a33c3 commit 133f8fc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/vcpkg/commands.install.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -521,13 +521,15 @@ namespace vcpkg
msg::spec = action.spec);
}

~TrackedPackageInstallGuard()
void print_elapsed_time() const
{
current_summary.timing = build_timer.elapsed();
msg::println(
msgElapsedForPackage, msg::spec = current_summary.get_spec(), msg::elapsed = current_summary.timing);
}

~TrackedPackageInstallGuard() { print_elapsed_time(); }

TrackedPackageInstallGuard(const TrackedPackageInstallGuard&) = delete;
TrackedPackageInstallGuard& operator=(const TrackedPackageInstallGuard&) = delete;
};
Expand Down Expand Up @@ -581,6 +583,7 @@ namespace vcpkg
perform_install_plan_action(args, paths, action, status_db, binary_cache, build_logs_recorder);
if (result.code != BuildResult::SUCCEEDED && keep_going == KeepGoing::NO)
{
this_install.print_elapsed_time();
print_user_troubleshooting_message(action, paths, result.stdoutlog.then([&](auto&) -> Optional<Path> {
auto issue_body_path = paths.installed().root() / "vcpkg" / "issue_body.md";
paths.get_filesystem().write_contents(
Expand Down

0 comments on commit 133f8fc

Please sign in to comment.