summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Another crash fix for duplicate edges. Fixes #939.Nico Weber2015-03-194-14/+38
| | | | | | | | | | | 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.
* Merge pull request #938 from nico/aflclangNico Weber2015-03-1918-0/+51
|\ | | | | Add notes on using afl-fuzz to HACKING.
| * Add notes on using afl-fuzz to HACKING.Nico Weber2015-03-1918-0/+51
|/
* Merge pull request #937 from nico/statfixNico Weber2015-03-196-40/+88
|\ | | | | Make failing stat() calls abort the build.
| * Make failing stat() calls abort the build.Nico Weber2015-03-196-40/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #830, fixes #904. In practice, this either happens with 64-bit inodes and a 32-bit userspace when building without -D_FILE_OFFSET_BITS=64 in CFLAGS, or when a filename is longer than the system file length limit. Since DiskInterface::Stat() returns -1 on error, and Node used -1 on "stat state unknown", not aborting the build lead to ninja stat()ing the same file over and over again, until it finally ran out of stack. That's now fixed. * Change RecomputeOutputsDirty() to return success instead of dirty state (like RecomputeDirty()) and return the dirty state in a bool outparam * Node::Stat()s old return value wasn't used anywhere, change the function to return success instead and add an |err| outparam * Node::StatIfNecessary()'s old return value was used only in one place. Change that place to explicitly check status_known() and make StatIfNecessary() return success and add an |err| outparam * Plan::CleanNode() can now fail, make it return bool and add an |err| outparam
* | Merge pull request #936 from nico/cleanupNico Weber2015-03-193-10/+4
|\ \ | |/ | | Minor cleanups. No behavior change.
| * Add a missing &. (No behavior change, only used in tests.)Nico Weber2015-03-182-2/+2
| |
| * Env should only be about variables. No behavior change.Nico Weber2015-03-182-8/+2
|/
* Merge pull request #930 from nico/depcolonNico Weber2015-03-175-6/+31
|\ | | | | On unexpected output in a .d file, rebuild instead erroring.
| * On unexpected output in a .d file, rebuild instead erroring.Nico Weber2015-03-122-3/+21
| | | | | | | | Fixes #417.
| * Reject depfiles that don't contain a : after the target name.Nico Weber2015-03-124-3/+10
| | | | | | | | This is a prerequisite for fixing #417.
* | Merge pull request #933 from nico/dupeedgefixNico Weber2015-03-155-1/+46
|\ \ | | | | | | Build self-consistent graphs for dupe edges with multiple outputs.
| * | Build self-consistent graphs for dupe edges with multiple outputs.Nico Weber2015-03-155-1/+46
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge pull request #928 from nico/novarEvan Martin2015-03-101-1/+0
|\ \ | |/ |/| Remove option no longer needed now that we don't use gtest.
| * Remove option no longer needed now that we don't use gtest.Nico Weber2015-03-101-1/+0
|/
* Simplify. No behavior change.Nico Weber2015-03-101-2/+1
|
* Merge pull request #917 from pinotree/rlimitNico Weber2015-03-091-2/+2
|\ | | | | subprocess_test: gracefully handle rlim.rlim_cur < kNumProcs
| * subprocess_test: gracefully handle rlim.rlim_cur < kNumProcsPino Toscano2015-02-281-2/+2
| | | | | | | | | | | | Instead of expecting that the number of open files is well above kNumProcs, simply "skip" the test in that case, still printing the message about the test limit (adding the current system limit too).
* | Merge pull request #910 from jlnt/masterNico Weber2015-03-092-5/+33
|\ \ | | | | | | POSIX: detach background subprocesses from terminal.
| * | POSIX: detach background subprocesses from terminal.Julien Tinnes2015-01-292-5/+33
| | | | | | | | | | | | | | | | | | | | | | | | Put background subprocesses (i.e. subprocesses with no access to the console) in their own session and detach them from the terminal. This fixes martine/ninja#909.
* | | Merge pull request #927 from nico/colorgccNico Weber2015-03-091-3/+6
|\ \ \ | | | | | | | | Make diagnostics colored with new gccs (4.9+) too.
| * | | Make diagnostics colored with new gccs (4.9+) too.Nico Weber2015-03-091-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | Both clang and gcc understand -fdiagnostics-color, so use that flag name. (This will disable colored diagnostics for clangs older than LLVM 3.3, but that is several years old by now.)
* | | | Merge pull request #926 from nico/fixlibcppNico Weber2015-03-091-29/+29
|\ \ \ \ | |/ / / |/| | | Fix build with libc++ after #921.
| * | | Fix build with libc++ after #921.Nico Weber2015-03-091-29/+29
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | It failed with error: field has incomplete type 'EvalString' note: in instantiation of exception specification for 'map' requested here explicit Rule(const string& name) : name_(name) {} ^
* | | Merge pull request #921 from mohamed/masterNico Weber2015-03-0910-87/+117
|\ \ \ | | | | | | | | Allow scoping rules through subninja
| * | | Added a new test to illustrate scoped rulesMohamed Bamakhrama2015-03-081-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | The new test shows the added value of scoped rules by demonstrating a multi-level build where a single rules file gets included at all the levels. By scoping rules, this is possible.
| * | | Allow scoping rules through subninjaMohamed Bamakhrama2015-03-0110-87/+104
| | |/ | |/| | | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #925 from kirbyfan64/masterNico Weber2015-03-091-2/+6
|\ \ \ | | | | | | | | Test for Clang by checking --version
| * | | Test for Clang by checking --versionRyan Gonzalez2015-03-091-2/+6
|/ / /
* | | Merge pull request #923 from HeisSpiter/masterNico Weber2015-03-081-1/+1
|\ \ \ | |/ / |/| | Directly pass the string instead of char * to Truncate util function. It...
| * | Directly pass the string instead of char * to Truncate util function. It ↵Pierre Schweitzer2015-03-071-1/+1
|/ / | | | | | | will prevent useless conversions.
* | Merge pull request #914 from tzik/typo_fixNico Weber2015-02-071-1/+1
|\ \ | | | | | | Typo fix in graph.cc
| * | Typo fix in graph.cctzik2015-02-061-1/+1
|/ /
* | Merge pull request #908 from colincross/multipassNico Weber2015-02-031-14/+13
|\ \ | |/ |/| Allow manifest rebuild to loop up to 100 times
| * Allow manifest rebuild to loop up to 100 timesColin Cross2015-02-031-14/+13
|/ | | | | | | | | Ninja generators that bootstrap themselves with Ninja may need to rebuild build.ninja multiple times. Replace the 2 cycle loop with a 100 cycle loop, and print the pass number each time it restarts. Original-author: Jamie Gennis <jgennis@gmail.com>
* Merge pull request #897 from tzik/pendingNico Weber2015-01-241-0/+21
|\ | | | | Check pending SIGINT after ppoll/pselect
| * Check pending SIGINT after ppoll/pselectTaiju Tsuiki2015-01-191-0/+21
| | | | | | | | | | | | | | | | | | ppoll/pselect prioritizes file descriptor events over a signal delivery. So a flood of events prevents ninja from reacting keyboard interruption by the user. This CL adds a check for pending keyboard interruptions after file descriptor events.
* | Merge pull request #903 from nico/gcovNico Weber2015-01-211-0/+16
|\ \ | | | | | | Document how to run gcov on ninja.
| * | Document how to run gcov on ninja.Nico Weber2015-01-211-0/+16
|/ /
* | Merge pull request #901 from nico/assertlessNico Weber2015-01-202-1/+10
|\ \ | | | | | | Remove an incorrect assert.
| * | Remove an incorrect assert.Nico Weber2015-01-202-1/+10
|/ / | | | | | | | | | | The assert fires on cyclic manifests (found by afl-fuzz). Since there was explicit error handing for this case already, just remove the assert.
* | Merge pull request #894 from tfarina/has-indentNico Weber2015-01-141-4/+4
|\ \ | |/ |/| Cleanup: Fix 'hasIdent' variable name/style.
| * Cleanup: Fix 'hasIdent' variable name/style.Thiago Farina2015-01-101-4/+4
| | | | | | | | | | | | | | Seems more correct to name it has_indent_token and to use the unix_hacker style. Signed-off-by: Thiago Farina <tfarina@chromium.org>
* | Merge pull request #889 from nico/del2Nico Weber2015-01-041-3/+3
|\ \ | | | | | | Try to simplify d1e6a29 a bit.
| * | Try to simplify d1e6a29 a bit.Nico Weber2015-01-041-3/+3
|/ /
* | Merge pull request #888 from nico/delNico Weber2015-01-041-9/+0
|\ \ | | | | | | Remove unused hash<std::string>.
| * | Remove unused hash<std::string>.Nico Weber2015-01-041-9/+0
|/ / | | | | | | | | ExternalStringHashMap used to store std::strings long ago. Since it doesn't anymore, this specialization isn't needed. No behavior change.
* | Merge pull request #887 from berenm/masterNico Weber2015-01-043-4/+23
|\ \ | |/ |/| Fix compilation errors on Visual Studio 2015 (_MSC_VER 1900)
| * Fix compilation errors on Visual Studio 2015 (_MSC_VER 1900).Beren Minor2014-12-313-4/+23
|/
* Merge pull request #884 from nico/sshhNico Weber2014-12-256-13/+2
|\ | | | | Remove 'Recompacting...' messages.