summaryrefslogtreecommitdiffstats
path: root/src/state.cc
Commit message (Collapse)AuthorAgeFilesLines
* Use uint64_t for slash_bits consistentlyDaniel Weber2016-09-011-3/+3
| | | | The VS compiler complained about possible loss of data (and it was right!)
* Constify State::RootNodes().Nicolas Despres2016-06-091-4/+5
|
* Move warning emission on dupe edges from State to ManifestParser.Nico Weber2015-03-241-8/+4
| | | | | | | | This will make it easier to optionally make this an error (because ManifestParser has a way of printing errors), and it'll also make it easier to make the tests quiet again. No behavior change.
* Another crash fix for duplicate edges. Fixes #939.Nico Weber2015-03-191-0/+1
| | | | | | | | | | | Patch #933 fixed a crash with duplicate edges by not adding edges to the graph if all the edge's outputs are already built by other edges. However, it added the edge to the out_edges of the edge's input nodes before deleting it, letting inputs refer to dead edges. To fix, move the check for deleting an edge above the code that adds inputs. Expand VerifyGraph() to check that nodes don't refer to edges that aren't present in the state.
* Build self-consistent graphs for dupe edges with multiple outputs.Nico Weber2015-03-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | Fixes #867, both the crashes and "[stuck]" issues. The problem was that a duplicate edge would modify the in_edge of the outputs of the new build rule, but the edge corresponding to the old build rule would still think that the in_edge points to itself. `old_edge->outputs_[0]->in_edge()` would not return `old_edge`, which confused the scan logic. As fix, let `State::AddOut()` reject changing in_edge if it's already set. This changes behavior in a minor way: Previously, if there were multiple edges for a single output, the last edge would be kept. Now, the first edge is kept. This only had mostly-well-defined semantics if all duplicate edges are the same (which is the only case I've seen in practice), and for that case the behavior doesn't change. For testing, add a VerifyGraph() function and call that every time any test graph is parsed. That's a bit more code than just copying the test cases from the bug into build_test.cc, but it also yields better test coverage overall.
* Allow scoping rules through subninjaMohamed Bamakhrama2015-03-011-13/+1
| | | | | | | | Ninja didn't support scoping rules through subninja and assumed a unique rule name in the whole namespace. With this change, this behavior is changed to allow scoping rules. Two rules can have the same name if they belong to two different scopes. However, two rules can NOT have the same name in the same scope.
* Remove an incorrect assert.Nico Weber2015-01-201-1/+0
| | | | | | The assert fires on cyclic manifests (found by afl-fuzz). Since there was explicit error handing for this case already, just remove the assert.
* make all GetNode explicit, add DepsLog canonicalize testScott Graham2014-11-101-7/+0
|
* assert no slashes in default GetNodeScott Graham2014-11-091-0/+3
|
* wip on adding tests at higher level, some not rightScott Graham2014-11-081-5/+9
|
* Introduce the "console" poolPeter Collingbourne2014-02-031-0/+2
| | | | | | | This is a pre-defined pool with a depth of 1. It has the special property that any task in the pool has direct access to the console. This can be useful for interactive tasks or long-running tasks which produce status updates on the console (such as test suites).
* Make BuildLogUser reference constant.Nico Weber2014-01-071-2/+2
|
* adjust the wording in "multiple rules generate X" warningEvan Martin2013-04-191-1/+2
| | | | | | | | | Ideally we'd detect this at build time and only warn if your build was affected, but that's hard to do. (Really we should just abort when this scenario is detected rather than continuing, but now users are relying on it.) Hopefully improves issue #543.
* add DepsLog, a new data structure for dependency informationEvan Martin2013-04-081-2/+3
| | | | | DepsLog is a compact serialization of dependency information. It can be used to replace depfiles for faster loading.
* Fix debug build on linux (type strictness).Robert Iannucci2013-03-231-2/+2
|
* Fix Pool to use a set internallyRobert Iannucci2013-03-181-5/+14
|
* rearrange handling of builtin bindings to make rules simplerEvan Martin2012-12-291-2/+2
| | | | | Now, a 'build' block can override any special binding like 'command' or 'description' if it needs to.
* Fix formattingRobert Iannucci2012-11-301-3/+3
|
* Make edge dump pool name, and skip default poolRobert Iannucci2012-11-101-1/+3
|
* Dump pools with StateRobert Iannucci2012-11-091-2/+20
|
* and some basic implementationRobert Iannucci2012-11-091-0/+27
|
* stub out an api and de-constify PoolRobert Iannucci2012-11-091-6/+6
|
* Pull out base changes to stateRobert Iannucci2012-11-091-1/+16
|
* move BuildLog to DependencyScanEvan Martin2012-09-041-1/+1
| | | | | | | The build log is needed in computing whether an edge is dirty, so I think it belongs here. (It's a bit weird that Builder needs to reach into it to record completed commands, maybe it will become cleaner with more thought.)
* more stringpieceEvan Martin2012-01-091-5/+8
|
* switch node lookup to StringPieceEvan Martin2012-01-091-3/+3
|
* convert ExternalStringHash to use StringPieceEvan Martin2012-01-091-2/+2
|
* Use getter instead of private member.Nicolas Despres2011-12-091-1/+1
| | | | Fix a compilation error.
* make Rule::name_ privateEvan Martin2011-12-071-1/+1
|
* make Node::out_edges_ privateEvan Martin2011-12-071-2/+2
|
* make Node::in_edge_ privateEvan Martin2011-12-071-2/+2
|
* merge StatCache into StateEvan Martin2011-12-071-4/+38
| | | | | | I think I had originally imagined StatCache would contain more state, but at this point it's clear it was just managing a single map, which could just as well be in the already-small State object.
* merge FileStat into NodeEvan Martin2011-12-071-12/+3
| | | | | | 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.
* Add spelling suggestions for four cases:Nico Weber2011-11-161-0/+7
| | | | | | | | | | | 1. For targets, when invoking ninja to build a target. 2. For targets, when doing a "query" command. 3. For command names. 4. For the subcommands of the "targets" command. Also change CmdTargets() to call LookupNode() instead of GetNode() -- since the result was checked for NULL, that's probably what was intended here originally.
* Split Node::dirty_ into two flags: Node::dirty_ and Edge::outputs_ready_Peter Collingbourne2011-10-181-0/+6
| | | | | dirty_ is intended to remain static during the build (unless a restat occurs), while outputs_ready_ reflects the dynamic state of the build.
* Factor out State struct from ninja_jumble.cc into its header/source files.Thiago Farina2011-09-031-0/+108
This was a TODO in src/ninja_jumble.cc. Now this task is completed. Signed-off-by: Thiago Farina <tfarina@chromium.org>