fix: report package conflicts in resolve and rebuild handlers

Conflicts were detected in the resolver but silently ignored in both
the resolve and rebuild subcommands. Both now print conflict errors
and abort before any builds start.
This commit is contained in:
2026-08-04 14:05:16 -04:00
parent 7345b026cc
commit 09dde98159
+13
View File
@@ -714,6 +714,14 @@ int main(int argc, char* argv[]) {
return 1; return 1;
} }
if (!plan.conflicts.empty()) {
std::cerr << "error: package conflicts detected:\n";
for (auto& c : plan.conflicts) {
std::cerr << " " << c << "\n";
}
return 1;
}
std::cout << plan.steps.size() << " packages in build order:\n"; std::cout << plan.steps.size() << " packages in build order:\n";
for (auto& step : plan.steps) { for (auto& step : plan.steps) {
std::cout << " " << step.name << " (" << step.dependencies.size() std::cout << " " << step.name << " (" << step.dependencies.size()
@@ -781,6 +789,11 @@ int main(int argc, char* argv[]) {
for (auto& c : plan.cycles) std::cerr << " " << c << "\n"; for (auto& c : plan.cycles) std::cerr << " " << c << "\n";
return 1; return 1;
} }
if (!plan.conflicts.empty()) {
std::cerr << "error: package conflicts detected:\n";
for (auto& c : plan.conflicts) std::cerr << " " << c << "\n";
return 1;
}
if (plan.steps.empty()) { if (plan.steps.empty()) {
std::cout << "nothing to build\n"; std::cout << "nothing to build\n";
return 0; return 0;