summaryrefslogtreecommitdiffstats
path: root/src/graph.cc
Commit message (Collapse)AuthorAgeFilesLines
* rearrange handling of builtin bindings to make rules simplerEvan Martin2012-12-291-36/+45
| | | | | Now, a 'build' block can override any special binding like 'command' or 'description' if it needs to.
* wrap some overlong linesEvan Martin2012-12-291-3/+4
|
* Make edge dump pool name, and skip default poolRobert Iannucci2012-11-101-0/+7
|
* Pull graph.cc tooRobert Iannucci2012-11-091-1/+2
|
* delete some obsolete TODOsEvan Martin2012-10-311-2/+1
|
* trailing whitespaceEvan Martin2012-10-311-1/+1
|
* fix whitespaceEvan Martin2012-10-231-14/+14
|
* remove a redundant arg to RecomputeOutputDirtyEvan Martin2012-09-021-17/+12
|
* split out dirty recomputation logic from Edge classEvan Martin2012-09-021-51/+56
| | | | | | | | | | Rather than passing States and DiskInterfaces through all the calls, put the necessary ambient information in a new DependencyScan object and move the code accordingly. Note: I didn't move the source location of the functions to preserve history, though this does result in a sort of weird order for the functions in graph.cc.
* safer build: consider target dirty if depfile is missingMaxim Kalaev2012-08-301-3/+9
|
* if a file is missing in the log, count it as dirtyScott Graham2012-08-151-4/+9
| | | | | | | This could cause overbuilding (if the log is missing an entry and the right file is already in place) but is otherwise necessary for correctness (if a file is already in place but we don't have a log entry for it).
* Revert "Make StringPiece data members private."Nico Weber2012-07-281-2/+1
| | | | | | This reverts commit 904c9610fe66c4f4bd63a07d6f057c8603d24394. The commit caused issue #380, this revert fixes it. The revert also makes the test from the previous commit pass.
* Merge pull request #352 from tfarina/string-piece-privateEvan Martin2012-07-271-1/+2
|\ | | | | Make StringPiece data members private.
| * Make StringPiece data members private.Thiago Farina2012-06-301-1/+2
| | | | | | | | Signed-off-by: Thiago Farina <tfarina@chromium.org>
* | explain mode: show which input is more recentEvan Martin2012-07-171-1/+4
| | | | | | | | Patch from Scott Graham <scottmg@chromium.org>.
* | Rename parsers.* to manifest_parser.*Thiago Farina2012-07-091-1/+1
|/ | | | | | So it matches with the class name in there. Signed-off-by: Thiago Farina <tfarina@chromium.org>
* Improving Edge::Dump, introducing Node::DumpMaxim Kalaev2012-06-281-5/+24
| | | | | | | - Edge::Dump could crash if called while inputs_ is being extended - Node::Dump prints Node attributes, in-edge and lists of out-edges - Dump functions now accept "prefix" parameter, printed along with the object for easier orientation. For example, edge->Dump("Re-reading deps files").
* add $in_newlineScott Graham2012-06-151-6/+10
|
* Only store command hashes in the build log.Nico Weber2012-06-151-2/+2
| | | | | | | | | | | | | | .build_log load time 350ms -> 17ms, filesize 197MB -> 1.6MB on Mac. On Windows, it's 500ms -> 20ms. Makes the build log a lot less useful for scripts, but there could be a tool for use cases that need log information. A prototype of such a tool is in https://github.com/nico/ninja/commit/1b243d311 The hash function is 64bit murmurhash2. Assuming that that different commands get the same hash only by chance, it's is very unlikely for two different commands to hash to the same value with a 64bit hash.
* views: Mark single-argument constructors as explicit.Thiago Farina2012-05-061-1/+1
| | | | | | | | This was reported by cpplint as: python ~/depot_tools/cpplint.py 2>&1 | grep -v "Done processing" | grep explicit Signed-off-by: Thiago Farina <tfarina@chromium.org>
* add support for -d explain to help debug why rules are runningScott Graham2012-04-131-6/+25
|
* Mark a phony target with no inputs as outputs-readyPeter Collingbourne2012-03-051-4/+4
| | | | | | | | Even if such a target is dirty (i.e. the file does not exist), it has nothing to do, which makes it safe to mark as outputs-ready. Without this change, ninja will print no output when rebuilding the target (or an order-only dependency thereof), instead of reporting it has "no work to do".
* fix some public/private errors in rspfile patchEvan Martin2012-02-231-3/+3
|
* Response filesunknown2012-02-091-3/+20
|
* remove string copy while loading depfilesEvan Martin2012-01-091-3/+2
|
* add a '-d stats' flag for detailed timingsEvan Martin2012-01-051-0/+3
| | | | | | 1) Add a system for recording detailed timing info of functions. 2) Add a -d flag for requesting debug info at runtime, with the above as the first user.
* convert all time_t to a new TimeStamp typeEvan Martin2012-01-051-4/+5
|
* When expanding $in and $out, wrap with quotes if the filename has a space.Jeremy Apthorp2012-01-021-1/+8
|
* switch DepfileParser to take a string* to make memory clearerEvan Martin2011-12-271-1/+1
| | | | Add some comments as well.
* Fix the TODO in Rule class.Thiago Farina2011-12-241-4/+4
| | | | | | Move various data members to private section and provide accessors for them. Signed-off-by: Thiago Farina <tfarina@chromium.org>
* use re2c to parse depfilesEvan Martin2011-12-071-11/+12
|
* refactor EdgeEnvEvan Martin2011-12-071-23/+35
|
* make Rule::generator_ and restat_ privateEvan Martin2011-12-071-2/+2
|
* make Rule::name_ privateEvan Martin2011-12-071-1/+1
|
* make Node::out_edges_ privateEvan Martin2011-12-071-1/+1
|
* make Node::in_edge_ privateEvan Martin2011-12-071-5/+5
|
* make Node::dirty_ privateEvan Martin2011-12-071-3/+3
|
* merge FileStat into NodeEvan Martin2011-12-071-18/+18
| | | | | | The two were always one-to-one anyway. I started adding accessors to FileStat and then realized most users wanted them on Node and that forwarding them through was silly.
* refactor to remove Node::ready()Evan Martin2011-12-071-0/+9
|
* Factor out Edge::EvaluateDepFilePeter Collingbourne2011-12-061-3/+6
|
* disable the 'unused parameter' warningEvan Martin2011-12-051-2/+2
| | | | It was firing too often, and hadn't uncovered any bugs.
* fix some minor style issues in RecomputeDirtyEvan Martin2011-12-041-11/+11
|
* when an edge is dirty, mark all outputs dirtyEvan Martin2011-12-041-9/+25
| | | | | | | | | | | | | | | The logic before was like: for each output: if edge_dirty or output.dirty: output.dirty = true edge_dirty = true This was wrong in the case where the second output would case the edge to be dirty; we needed to go back and mark the first output dirty as well. Fixed by taking two passes: one to compute the dirty state, then a latter sweep to mark all outputs. Fixes issue 148.
* refactor RecomputeOutputDirty to return true/false for dirtyEvan Martin2011-12-041-29/+25
| | | | | | | | | Rather than taking whether the edge is dirty as an input, instead only consider the arguments and return true/false, allowing the caller to decide what to do with that information. (In the restat case we were faking out the environment to get particular behavior for this.) Should have no side effects, but this is part of fixing issue 148.
* Implement restat rulesPeter Collingbourne2011-10-241-5/+18
| | | | | | | | | | | | | | | | | A restat rule is a rule which is capable of pruning the build tree depending on the timestamps of its outputs before and after a build. After a restat rule is rebuilt, Ninja will re-stat each output file to obtain its current timestamp. If the timestamp is unchanged from when Ninja initially stat'ed the file before starting the build, Ninja will mark that output file as clean, and recursively for each reverse dependency of the output file, recompute its dirty status. Ninja then stores the most recent timestamp of any input file in the build log entry associated with the output file. This timestamp will be treated by future invocations of Ninja as the output file's modification time instead of the output file's actual modification time for the purpose of deciding whether it is dirty (but not whether its reverse dependencies are dirty).
* Implement Make-style order-only dependenciesPeter Collingbourne2011-10-241-16/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the implementation of order-only dependencies differed between Make and Ninja in two important ways: 1) If the order-only dependency existed but was out of date, it would never be rebuilt, whereas Make would always rebuild out of date order-only dependencies. 2) If the order-only dependency did not exist, it would cause its reverse dependencies to always build, whereas Make would only rebuild a file if a non-order-only dependency was out of date. A key distinction between Ninja and Make as seen through the above two points was that in Ninja, order-only dependencies cared about whether the target as a file exists (so perhaps a better name for the old semantics would have been "missing-only dependencies"). These differences made it impossible to introduce an order-only dependency on an always out-of-date (i.e. missing) target without also causing the depender and its reverse dependencies to rebuild unnecessarily on every build. Build systems which must perform some action (such as logging the build start time, or printing a message) at the start of every build typically implement this by adding to every target an order-only dependency which performs this action, which would have forced an entire rebuild on every invocation of Ninja under the old semantics. This commit causes Ninja to conform to the Make-style behaviour.
* Split Node::dirty_ into two flags: Node::dirty_ and Edge::outputs_ready_Peter Collingbourne2011-10-181-27/+54
| | | | | dirty_ is intended to remain static during the build (unless a restat occurs), while outputs_ready_ reflects the dynamic state of the build.
* Implement generator rulesPeter Collingbourne2011-10-151-1/+3
| | | | | | | | | | | | | Introduce a rule attribute "generator" which, if present, specifies that this rule is used to re-invoke the generator program. Files built using generator rules are treated specially in two ways: firstly, they will not be rebuilt if the command line changes; and secondly, they are not cleaned by default. A command line flag "-g" is introduced for the clean tool, which causes it to remove generator files. Fixes issue #102.
* make CanonicalizePath report an error on empty pathEvan Martin2011-10-061-1/+2
| | | | Fixes part of issue 121, but the fix exposed a further issue.
* Merge pull request #106 from pcc/depfile-vectorEvan Martin2011-09-141-4/+7
|\ | | | | Allocate space in the inputs vector for the depfile implicit deps