Lines Matching +full:- +full:- +full:allow +full:- +full:dirty
7 // http://www.apache.org/licenses/LICENSE-2.0
35 mtime_ = disk_interface->Stat(path_, err); in Stat()
36 if (mtime_ == -1) { in Stat()
58 // checked for dirty state, keep a queue of nodes to visit. in RecomputeDirty()
73 validation_nodes->insert(validation_nodes->end(), in RecomputeDirty()
85 Edge* edge = node->in_edge(); in RecomputeNodeDirty()
88 if (node->status_known()) in RecomputeNodeDirty()
90 // This node has no in-edge; it is dirty if it is missing. in RecomputeNodeDirty()
91 if (!node->StatIfNecessary(disk_interface_, err)) in RecomputeNodeDirty()
93 if (!node->exists()) in RecomputeNodeDirty()
94 EXPLAIN("%s has no in-edge and is missing", node->path().c_str()); in RecomputeNodeDirty()
95 node->set_dirty(!node->exists()); in RecomputeNodeDirty()
100 if (edge->mark_ == Edge::VisitDone) in RecomputeNodeDirty()
108 edge->mark_ = Edge::VisitInStack; in RecomputeNodeDirty()
109 stack->push_back(node); in RecomputeNodeDirty()
111 bool dirty = false; in RecomputeNodeDirty() local
112 edge->outputs_ready_ = true; in RecomputeNodeDirty()
113 edge->deps_missing_ = false; in RecomputeNodeDirty()
115 if (!edge->deps_loaded_) { in RecomputeNodeDirty()
127 if (edge->dyndep_ && edge->dyndep_->dyndep_pending()) { in RecomputeNodeDirty()
128 if (!RecomputeNodeDirty(edge->dyndep_, stack, validation_nodes, err)) in RecomputeNodeDirty()
131 if (!edge->dyndep_->in_edge() || in RecomputeNodeDirty()
132 edge->dyndep_->in_edge()->outputs_ready()) { in RecomputeNodeDirty()
134 if (!LoadDyndeps(edge->dyndep_, err)) in RecomputeNodeDirty()
141 for (vector<Node*>::iterator o = edge->outputs_.begin(); in RecomputeNodeDirty()
142 o != edge->outputs_.end(); ++o) { in RecomputeNodeDirty()
143 if (!(*o)->StatIfNecessary(disk_interface_, err)) in RecomputeNodeDirty()
147 if (!edge->deps_loaded_) { in RecomputeNodeDirty()
149 edge->deps_loaded_ = true; in RecomputeNodeDirty()
151 if (!err->empty()) in RecomputeNodeDirty()
155 dirty = edge->deps_missing_ = true; in RecomputeNodeDirty()
164 validation_nodes->insert(validation_nodes->end(), in RecomputeNodeDirty()
165 edge->validations_.begin(), edge->validations_.end()); in RecomputeNodeDirty()
167 // Visit all inputs; we're dirty if any of the inputs are dirty. in RecomputeNodeDirty()
169 for (vector<Node*>::iterator i = edge->inputs_.begin(); in RecomputeNodeDirty()
170 i != edge->inputs_.end(); ++i) { in RecomputeNodeDirty()
176 if (Edge* in_edge = (*i)->in_edge()) { in RecomputeNodeDirty()
177 if (!in_edge->outputs_ready_) in RecomputeNodeDirty()
178 edge->outputs_ready_ = false; in RecomputeNodeDirty()
181 if (!edge->is_order_only(i - edge->inputs_.begin())) { in RecomputeNodeDirty()
182 // If a regular input is dirty (or missing), we're dirty. in RecomputeNodeDirty()
184 if ((*i)->dirty()) { in RecomputeNodeDirty()
185 EXPLAIN("%s is dirty", (*i)->path().c_str()); in RecomputeNodeDirty()
186 dirty = true; in RecomputeNodeDirty()
188 if (!most_recent_input || (*i)->mtime() > most_recent_input->mtime()) { in RecomputeNodeDirty()
195 // We may also be dirty due to output state: missing outputs, out of in RecomputeNodeDirty()
196 // date outputs, etc. Visit all outputs and determine whether they're dirty. in RecomputeNodeDirty()
197 if (!dirty) in RecomputeNodeDirty()
198 if (!RecomputeOutputsDirty(edge, most_recent_input, &dirty, err)) in RecomputeNodeDirty()
201 // Finally, visit each output and update their dirty state if necessary. in RecomputeNodeDirty()
202 for (vector<Node*>::iterator o = edge->outputs_.begin(); in RecomputeNodeDirty()
203 o != edge->outputs_.end(); ++o) { in RecomputeNodeDirty()
204 if (dirty) in RecomputeNodeDirty()
205 (*o)->MarkDirty(); in RecomputeNodeDirty()
208 // If an edge is dirty, its outputs are normally not ready. (It's in RecomputeNodeDirty()
210 // order-only inputs.) in RecomputeNodeDirty()
213 if (dirty && !(edge->is_phony() && edge->inputs_.empty())) in RecomputeNodeDirty()
214 edge->outputs_ready_ = false; in RecomputeNodeDirty()
218 edge->mark_ = Edge::VisitDone; in RecomputeNodeDirty()
219 assert(stack->back() == node); in RecomputeNodeDirty()
220 stack->pop_back(); in RecomputeNodeDirty()
226 Edge* edge = node->in_edge(); in VerifyDAG()
230 if (edge->mark_ != Edge::VisitInStack) in VerifyDAG()
234 vector<Node*>::iterator start = stack->begin(); in VerifyDAG()
235 while (start != stack->end() && (*start)->in_edge() != edge) in VerifyDAG()
237 assert(start != stack->end()); in VerifyDAG()
244 // should report a -> c -> a instead of b -> c -> a. in VerifyDAG()
249 for (vector<Node*>::const_iterator i = start; i != stack->end(); ++i) { in VerifyDAG()
250 err->append((*i)->path()); in VerifyDAG()
251 err->append(" -> "); in VerifyDAG()
253 err->append((*start)->path()); in VerifyDAG()
255 if ((start + 1) == stack->end() && edge->maybe_phonycycle_diagnostic()) { in VerifyDAG()
256 // The manifest parser would have filtered out the self-referencing in VerifyDAG()
257 // input if it were not configured to allow the error. in VerifyDAG()
258 err->append(" [-w phonycycle=err]"); in VerifyDAG()
266 string command = edge->EvaluateCommand(/*incl_rsp_file=*/true); in RecomputeOutputsDirty()
267 for (vector<Node*>::iterator o = edge->outputs_.begin(); in RecomputeOutputsDirty()
268 o != edge->outputs_.end(); ++o) { in RecomputeOutputsDirty()
281 if (edge->is_phony()) { in RecomputeOutputDirty()
282 // Phony edges don't write any output. Outputs are only dirty if in RecomputeOutputDirty()
284 if (edge->inputs_.empty() && !output->exists()) { in RecomputeOutputDirty()
286 output->path().c_str()); in RecomputeOutputDirty()
293 output->UpdatePhonyMtime(most_recent_input->mtime()); in RecomputeOutputDirty()
300 // Dirty if we're missing the output. in RecomputeOutputDirty()
301 if (!output->exists()) { in RecomputeOutputDirty()
302 EXPLAIN("output %s doesn't exist", output->path().c_str()); in RecomputeOutputDirty()
310 // We don't want to consider a restat rule's outputs as dirty unless in RecomputeOutputDirty()
315 if (edge->GetBindingBool("restat") && build_log() && in RecomputeOutputDirty()
316 (entry = build_log()->LookupByOutput(output->path()))) { in RecomputeOutputDirty()
320 // Dirty if the output is older than the input. in RecomputeOutputDirty()
321 if (!used_restat && most_recent_input && output->mtime() < most_recent_input->mtime()) { in RecomputeOutputDirty()
324 output->path().c_str(), in RecomputeOutputDirty()
325 most_recent_input->path().c_str(), in RecomputeOutputDirty()
326 output->mtime(), most_recent_input->mtime()); in RecomputeOutputDirty()
331 bool generator = edge->GetBindingBool("generator"); in RecomputeOutputDirty()
332 if (entry || (entry = build_log()->LookupByOutput(output->path()))) { in RecomputeOutputDirty()
334 BuildLog::LogEntry::HashCommand(command) != entry->command_hash) { in RecomputeOutputDirty()
335 // May also be dirty due to the command changing since the last build. in RecomputeOutputDirty()
337 // dirty. in RecomputeOutputDirty()
338 EXPLAIN("command line changed for %s", output->path().c_str()); in RecomputeOutputDirty()
341 if (most_recent_input && entry->mtime < most_recent_input->mtime()) { in RecomputeOutputDirty()
342 // May also be dirty due to the mtime in the log being older than the in RecomputeOutputDirty()
349 output->path().c_str(), most_recent_input->path().c_str(), in RecomputeOutputDirty()
350 entry->mtime, most_recent_input->mtime()); in RecomputeOutputDirty()
355 EXPLAIN("command line not found in log for %s", output->path().c_str()); in RecomputeOutputDirty()
375 if ((*i)->in_edge() && !(*i)->in_edge()->outputs_ready()) in AllInputsReady()
402 int explicit_deps_count = edge_->inputs_.size() - edge_->implicit_deps_ - in LookupVariable()
403 edge_->order_only_deps_; in LookupVariable()
404 return MakePathList(edge_->inputs_.data(), explicit_deps_count, in LookupVariable()
407 int explicit_outs_count = edge_->outputs_.size() - edge_->implicit_outs_; in LookupVariable()
408 return MakePathList(&edge_->outputs_[0], explicit_outs_count, ' '); in LookupVariable()
427 // command --> foo in LookupVariable()
430 // var1 <-----. in LookupVariable()
433 // var2 ---> var3 in LookupVariable()
449 cycle.append(*it + " -> "); in LookupVariable()
456 const EvalString* eval = edge_->rule_->GetBinding(var); in LookupVariable()
464 std::string result = edge_->env_->LookupWithFallback(var, eval, this); in LookupVariable()
476 const string& path = (*i)->PathDecanonicalized(); in MakePathList()
494 std::string path = (*it)->PathDecanonicalized(); in CollectInputs()
505 out->push_back(std::move(path)); in CollectInputs()
507 out->push_back(path); in CollectInputs()
550 printf("%s ", (*i)->path().c_str()); in Dump()
552 printf("--%s-> ", rule_->name().c_str()); in Dump()
555 printf("%s ", (*i)->path().c_str()); in Dump()
561 printf("%s ", (*i)->path().c_str()); in Dump()
565 if (!pool_->name().empty()) { in Dump()
566 printf("(in pool '%s')", pool_->name().c_str()); in Dump()
583 // CMake 2.8.12.x and 3.0.x produced self-referencing phony rules in maybe_phonycycle_diagnostic()
609 dirty() ? " dirty" : " clean"); in Dump()
611 in_edge()->Dump("in-edge: "); in Dump()
613 printf("no in-edge\n"); in Dump()
618 (*e)->Dump(" +- "); in Dump()
624 (*e)->Dump(" +- "); in Dump()
630 string deps_type = edge->GetBinding("deps"); in LoadDeps()
634 string depfile = edge->GetUnescapedDepfile(); in LoadDeps()
646 StringPiece opath = StringPiece(node->path()); in operator ()()
658 switch (disk_interface_->ReadFile(path, &content, err)) { in LoadDepFile()
662 err->clear(); in LoadDepFile()
690 CanonicalizePath(const_cast<char*>(primary_out->str_), &primary_out->len_, in LoadDepFile()
694 // mark the edge as dirty. in LoadDepFile()
695 Node* first_output = edge->outputs_[0]; in LoadDepFile()
696 StringPiece opath = StringPiece(first_output->path()); in LoadDepFile()
699 first_output->path().c_str(), primary_out->AsString().c_str()); in LoadDepFile()
707 if (std::find_if(edge->outputs_.begin(), edge->outputs_.end(), m) == edge->outputs_.end()) { in LoadDepFile()
708 …*err = path + ": depfile mentions '" + o->AsString() + "' as an output, but no such output was dec… in LoadDepFile()
718 // Preallocate space in edge->inputs_ to be filled in below. in ProcessDepfileDeps()
720 PreallocateSpace(edge, depfile_ins->size()); in ProcessDepfileDeps()
722 // Add all its in-edges. in ProcessDepfileDeps()
723 for (std::vector<StringPiece>::iterator i = depfile_ins->begin(); in ProcessDepfileDeps()
724 i != depfile_ins->end(); ++i, ++implicit_dep) { in ProcessDepfileDeps()
726 CanonicalizePath(const_cast<char*>(i->str_), &i->len_, &slash_bits); in ProcessDepfileDeps()
727 Node* node = state_->GetNode(*i, slash_bits); in ProcessDepfileDeps()
729 node->AddOutEdge(edge); in ProcessDepfileDeps()
736 // NOTE: deps are only supported for single-target edges. in LoadDepsFromLog()
737 Node* output = edge->outputs_[0]; in LoadDepsFromLog()
738 DepsLog::Deps* deps = deps_log_ ? deps_log_->GetDeps(output) : NULL; in LoadDepsFromLog()
740 EXPLAIN("deps for '%s' are missing", output->path().c_str()); in LoadDepsFromLog()
745 if (output->mtime() > deps->mtime) { in LoadDepsFromLog()
747 output->path().c_str(), deps->mtime, output->mtime()); in LoadDepsFromLog()
752 PreallocateSpace(edge, deps->node_count); in LoadDepsFromLog()
753 for (int i = 0; i < deps->node_count; ++i, ++implicit_dep) { in LoadDepsFromLog()
754 Node* node = deps->nodes[i]; in LoadDepsFromLog()
756 node->AddOutEdge(edge); in LoadDepsFromLog()
763 edge->inputs_.insert(edge->inputs_.end() - edge->order_only_deps_, in PreallocateSpace()
765 edge->implicit_deps_ += count; in PreallocateSpace()
766 return edge->inputs_.end() - edge->order_only_deps_ - count; in PreallocateSpace()