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

Properly index package actions in log #15076

Merged
merged 2 commits into from
Dec 15, 2020
Merged
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
12 changes: 7 additions & 5 deletions toolsrc/src/vcpkg/install.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -435,13 +435,14 @@ namespace vcpkg::Install
SpecSummary* current_summary = nullptr;
Chrono::ElapsedTimer build_timer = Chrono::ElapsedTimer::create_started();

TrackedPackageInstallGuard(const size_t package_count,
TrackedPackageInstallGuard(const size_t action_index,
const size_t action_count,
std::vector<SpecSummary>& results,
const PackageSpec& spec)
{
results.emplace_back(spec, nullptr);
current_summary = &results.back();
System::printf("Starting package %zd/%zd: %s\n", results.size(), package_count, spec.to_string());
System::printf("Starting package %zd/%zd: %s\n", action_index, action_count, spec.to_string());
}

~TrackedPackageInstallGuard()
Expand All @@ -465,12 +466,13 @@ namespace vcpkg::Install
const CMakeVars::CMakeVarProvider& var_provider)
{
std::vector<SpecSummary> results;
const size_t package_count = action_plan.remove_actions.size() + action_plan.install_actions.size();
const size_t action_count = action_plan.remove_actions.size() + action_plan.install_actions.size();
size_t action_index = 1;

const auto timer = Chrono::ElapsedTimer::create_started();
for (auto&& action : action_plan.remove_actions)
{
TrackedPackageInstallGuard this_install(package_count, results, action.spec);
TrackedPackageInstallGuard this_install(action_index++, action_count, results, action.spec);
Remove::perform_remove_plan_action(paths, action, Remove::Purge::YES, &status_db);
}

Expand All @@ -488,7 +490,7 @@ namespace vcpkg::Install

for (auto&& action : action_plan.install_actions)
{
TrackedPackageInstallGuard this_install(package_count, results, action.spec);
TrackedPackageInstallGuard this_install(action_index++, action_count, results, action.spec);
auto result =
perform_install_plan_action(args, paths, action, status_db, binaryprovider, build_logs_recorder);
if (result.code != BuildResult::SUCCEEDED && keep_going == KeepGoing::NO)
Expand Down