Skip to content

Commit

Permalink
Show failed ports when using --keep-going in manifest mode (#697)
Browse files Browse the repository at this point in the history
* Add show failed ports when using --keep-going in manifest mode

* Remove format setting in localized messages

* Add failed exit check
  • Loading branch information
Cheney-W authored Sep 16, 2022
1 parent eaddbdf commit 4bc93c8
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/vcpkg/install.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ namespace vcpkg
std::vector<SpecSummary> results;

void print() const;
void print_failed() const;
std::string xunit_results() const;
bool failed() const;
};
Expand Down
7 changes: 7 additions & 0 deletions src/vcpkg/commands.setinstalled.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,15 @@ namespace vcpkg::Commands::SetInstalled

const auto summary = Install::perform(
args, action_plan, keep_going, paths, status_db, binary_cache, null_build_logs_recorder(), cmake_vars);
msg::println();
msg::println(msgTotalTime, msg::elapsed = GlobalState::timer.to_string());

if (keep_going == KeepGoing::YES && summary.failed())
{
summary.print_failed();
Checks::exit_fail(VCPKG_LINE_INFO);
}

std::set<std::string> printed_usages;
for (auto&& ur_spec : user_requested_specs)
{
Expand Down
19 changes: 19 additions & 0 deletions src/vcpkg/install.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,25 @@ namespace vcpkg
}
}

void InstallSummary::print_failed() const
{
msg::println();
msg::println(msgResultsHeader);

for (const SpecSummary& result : this->results)
{
if (result.build_result.value_or_exit(VCPKG_LINE_INFO).code != BuildResult::SUCCEEDED)
{
msg::println(LocalizedString().append_indent().append_fmt_raw(
"{}: {}: {}",
result.get_spec(),
to_string(result.build_result.value_or_exit(VCPKG_LINE_INFO).code),
result.timing));
}
}
msg::println();
}

bool InstallSummary::failed() const
{
for (const auto& result : this->results)
Expand Down

0 comments on commit 4bc93c8

Please sign in to comment.