Skip to content

Commit

Permalink
Merge pull request #2406 from dcbaker/submit/cleandad-fixes
Browse files Browse the repository at this point in the history
Fix cleanded with dyndeps
  • Loading branch information
jhasse authored Apr 8, 2024
2 parents 903a05c + e3f44dd commit d7bb3f3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/clean.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ int Cleaner::CleanAll(bool generator) {
int Cleaner::CleanDead(const BuildLog::Entries& entries) {
Reset();
PrintHeader();
LoadDyndeps();
for (BuildLog::Entries::const_iterator i = entries.begin(); i != entries.end(); ++i) {
Node* n = state_->LookupNode(i->first);
// Detecting stale outputs works as follows:
Expand Down Expand Up @@ -292,7 +293,8 @@ void Cleaner::LoadDyndeps() {
// Load dyndep files that exist, before they are cleaned.
for (vector<Edge*>::iterator e = state_->edges_.begin();
e != state_->edges_.end(); ++e) {
if (Node* dyndep = (*e)->dyndep_) {
Node* dyndep;
if ((dyndep = (*e)->dyndep_) && dyndep->dyndep_pending()) {
// Capture and ignore errors loading the dyndep file.
// We clean as much of the graph as we know.
std::string err;
Expand Down

0 comments on commit d7bb3f3

Please sign in to comment.