summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Write subprocess output to stdout in binary modeColin D Bennett2016-05-121-0/+15
| | | | | | | | Set stdout to binary mode while writing subprocess output, so that the CR in a CR LF sequence is not replaced with CR LF itself, which would result in CR CR LF. Based on patch posted by nico in issue #773 comment.
* Merge pull request #1150 from KiYugadgeter/python3_measureNico Weber2016-05-041-5/+7
|\ | | | | Make misc/measure.py compatible with python3
| * Make misc/measure.py compatible with python3KiYugadgeter2016-05-041-5/+7
|/
* Merge pull request #1147 from colincross/elapsed_statusNico Weber2016-04-293-15/+31
|\ | | | | Fix NINJA_STATUS %e and %r on dumb terminals
| * Fix NINJA_STATUS %r on dumb terminalsColin Cross2016-04-293-11/+25
| | | | | | | | | | | | | | | | | | | | | | | | PR #999 made dumb terminals only output when edges finish. PrintStatus is called after finished_edges_ is incremented, which means the calculation for running edges will always return 1 less than the real number of running processes. This happens on smart terminals too, but ninja will immediately print the status for the next edge with starting_edges_ incremented, so the incorrect value is never visible. Pass a boolean specifying whether the status is being printed on an edge finishing, and if so count the edge that just finished as being running.
| * Fix NINJA_STATUS %e on dumb terminalsColin Cross2016-04-281-4/+6
|/ | | | | | | | | | | | | PR #999 made dumb terminals only output when edges finish. BuildStatus::overall_rate_ stopwatch is only initialized to the current time when PrintStatus is called with finished_edges_ == 0, but on a dumb terminal it will be called for the first time when finished_edge_ = 1, which results in very long elapsed times: NINJA_STATUS="[%r processes, %f/%t @ %o/s : %es ] " [0 processes, 2/2 @ 0.0/s : 1461869902.367s ] Reset the stopwatches in BuildEdgeFinished before finshed_edges_ is incremented instead.
* mark this 1.7.1.gitNico Weber2016-04-281-1/+1
|
* Merge pull request #1144 from nico/statustweaksNico Weber2016-04-281-1/+1
|\ | | | | Update %p to use finished edges after #1143.
| * Update %p to use finished edges after #1143.Nico Weber2016-04-281-1/+1
|/
* Merge pull request #1143 from colincross/statusNico Weber2016-04-282-2/+2
|\ | | | | Change default NINJA_STATUS to [%f/%t]
| * Change default NINJA_STATUS to [%f/%t]Colin Cross2016-04-282-2/+2
|/ | | | | | | | | | | | | | | | | | PR #999 changed the status line to be printed when edges finish on dumb teerminals, but the default status message includes the number of started edges, resulting in sequential status lines with identical edge counts. Change the default status to show the number of finished edges, which will keep the count incrementing on every line. This will slightly change the output on smart terminals. Previously a build that was just starting would show a count equal to the number of concurrent jobs, and a build waiting for the final jobs to finish would show a count equal to the total number of edges. Now a starting build will show 0, and build waiting for the final jobs will show a count less than the total number of edges by the number of remaining jobs. Fixes: #1142
* fix path after moving github pages to ninja-build repoNico Weber2016-04-271-1/+1
|
* mark this 1.7.0.gitNico Weber2016-04-271-1/+1
|
* Merge pull request #1137 from nico/crashfixNico Weber2016-04-272-7/+35
|\ | | | | Fix crash with duplicate implicit outputs.
| * Fix crash with duplicate implicit outputs.Nico Weber2016-04-272-7/+35
|/ | | | | | | | Sadly, duplicate outputs aren't an error by default in Ninja (see also a new edge has no effect. Remember to decrement the "number of implicit outputs" counter for the new edge when this happens. Fixes #1136.
* Merge pull request #1134 from danw/ubuntu-libc++Nico Weber2016-04-214-0/+4
|\ | | | | Add <stdlib.h> includes for clang++/libc++ on Ubuntu
| * Add <stdlib.h> includes for clang++/libc++ on UbuntuDan Willemsen2016-04-214-0/+4
|/ | | | | | | | | | | | | | | | | | | | | | | There are a number of stdlib.h uses in these files without including stdlib.h: hash_collision_bench.cc: rand, RAND_MAX, srand manifest_parser_perftest.cc: system, exit ninja_test.cc: EXIT_SUCCESS, EXIT_FAILURE test.cc: getenv, mkdtemp, system This works on a Ubuntu g++/libstdc++ build, as the <algorithm> header pulls in stdlib.h, and on a OSX clang++/libc++ build the <map> and <string> headers pull in stdlib.h. But a Ubuntu clang++/libc++ build does not pull in stdlib.h with any of these other headers. $ apt-get install clang-3.6 libc++-dev $ CXX=clang++-3.6 CFLAGS=-stdlib=libc++ LDFLAGS=-stdlib=libc++ \ ./configure.py $ ninja ninja_test hash_collision_bench manifest_parser_perftest This was originally discovered using the host toolchain provided with Android, but the Ubuntu version is much easier to reproduce.
* Merge pull request #1116 from colincross/browseNico Weber2016-04-194-31/+35
|\ | | | | Pass location of build.ninja file to browse script
| * Pass location of build.ninja file to browse scriptColin Cross2016-04-194-31/+35
|/ | | | | Pass the value of -f to the browse python script so it can be passed back to ninja -t query.
* Merge pull request #1131 from bradking/improve-EdgeFinished-signatureNico Weber2016-04-193-33/+38
|\ | | | | Improve Plan::EdgeFinished signature
| * Improve Plan::EdgeFinished signatureBrad King2016-04-193-33/+38
|/ | | | | | | Use an enumeration instead of a boolean to clarify the purpose of arguments at call sites. Suggested-by: Nico Weber <nicolasweber@gmx.de>
* Merge pull request #1126 from bradking/pool-release-on-failNico Weber2016-04-193-36/+108
|\ | | | | Release the pool slot held by an edge whether it succeeds or fails
| * Add another test case covering pool release on edge failureDavid Emett2016-04-061-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this build file: pool failpool depth = 1 rule fail command = fail pool = failpool build out1: fail build out2: fail build out3: fail build final: phony out1 out2 out3 Running `ninja -k 0` should run out1..3 sequentially before failing, but until recently we would fail after just running out1. Add a test covering this case.
| * Release the pool slot held by an edge whether it succeeds or failsFredrik Medley2016-04-063-36/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an edge finishes building, it should be release from its pool. Make sure that this also is the case when an edge fails to build. The bug can be shown with a pool has size N, then `ninja -k N+1` will still stop after N failing commands for that pool, even if there are many more jobs to be done for that pool: pool mypool depth = 1 rule bad_rule command = false pool = mypool build a : bad_rule build b : bad_rule Current behaviour: $ ninja -k 0 [1/2] false FAILED: false ninja: build stopped: cannot make progress due to previous errors. Expected behaviour: $ ninja -k 0 [1/2] false FAILED: false [2/2] false FAILED: false ninja: build stopped: cannot make progress due to previous errors. Signed-off-by: Fredrik Medley <fredrik.medley@gmail.com>
* | Merge pull request #1130 from JohnstonJ/fix-tests-on-vs2015Nico Weber2016-04-194-97/+101
|\ \ | | | | | | ninja_test: Fix Visual C++ 2015 warnings/errors about name hiding.
| * | ninja_test: Fix Visual C++ 2015 warnings/errors about name hiding.James Johnston2016-04-184-97/+101
| |/ | | | | | | | | | | | | | | | | Visual C++ 2015 warns if a local variable hides visibility of another variable in a higher scope. Since this project declares warnings as errors, ninja_test simply won't build on Visual C++ 2015. The variables have been renamed and scope limited as appropriate, so that ninja_test will build without error now on Visual C++ 2015.
* | Merge pull request #1059 from bradking/avoid-double-scheduling-edgeNico Weber2016-04-192-7/+33
|\ \ | |/ |/| Avoid double-scheduling build edges in another case
| * Avoid double-scheduling build edges in another caseBrad King2016-02-032-7/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The change in commit v1.2.0~3^2~3^2~3 (Fix duplicate edge Pool crash in the minimally invasive way, 2013-03-18) avoids double-scheduling in a case involving duplicate out edges. However, double-scheduling may also occur on a consistent graph when an edge and one of its dependencies share an order-only input: $ cat build.ninja ... build c: touch build b: touch || c build a: touch | b || c $ ninja a $ rm a c $ ninja a In this case 'c' will build first. When NodeFinished('c') loops over the out edges it will find AllInputsReady is true for 'b' and call EdgeFinished('b') since it is not wanted (up to date). This will call NodeFinished('b') which will loop over its out edges, find AllInputsReady is true for 'a', and call ScheduleEdge('a'). When we eventually return to the loop in NodeFinished('c') it will move on to its second output and find that AllInputsReady is true for 'a' and call ScheduleEdge('a') again. Teach ScheduleEdge to tolerate duplicate calls for an edge that has already been scheduled. Avoid calling EdgeScheduled more than once for the same edge.
* | Merge pull request #1125 from nico/wintoolsNico Weber2016-04-069-211/+290
|\ \ | | | | | | Make deps=msvc experimentally available on non-Windows.
| * | Make deps=msvc experimentally available on non-Windows.Nico Weber2016-04-069-211/+290
|/ / | | | | | | | | | | | | | | | | This makes it possible to run most of the clparser tests on non-Windows, and is potentially useful for cross-compiling on non-Windows hosts. Also, the manual didn't document this as Windows-only previously. If you use this on non-Windows, please let me know, else I might undo this change again in the future.
* | Merge pull request #1118 from nico/posixspawn2Nico Weber2016-04-052-54/+56
|\ \ | | | | | | Use posix_spawn() instead of fork()/exec().
| * | Use posix_spawn() instead of fork()/exec().Nico Weber2016-03-212-54/+56
| | | | | | | | | | | | | | | posix_spawn() is a syscall on OS X and Solaris and a bit faster. It's also easier emulate for cygwin, and the code is a bit simpler.
* | | Merge pull request #1112 from Lekensteyn/browse-tool-fixesNico Weber2016-04-045-21/+46
|\ \ \ | |/ / |/| | browse tool: Allow customization of port number, Py3 fix
| * | browse: support --port and --no-browser optionsPeter Wu2016-03-115-20/+41
| | | | | | | | | | | | | | | | | | | | | Add --port option to override the default port (8000). Add --no-browser option to avoid opening a web browser (useful over SSH). Make the target name optional, using "all" if omitted.
| * | browse.py: Python 3 compatibilityPeter Wu2016-03-111-2/+5
| | |
| * | browse.py: allow port override via environment variablePeter Wu2016-02-252-2/+3
| | |
* | | Merge pull request #1113 from nico/nosetsidNico Weber2016-03-052-31/+3
|\ \ \ | | | | | | | | Revert #910.
| * | | Revert #910.Nico Weber2016-03-052-31/+3
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The change caused some issues (it makes it impossible ot use posix_spawn() and makes it harder to suspend children on ctrl-z). After discussing with jln: Since it fixes a corner case that can be fixed by explicitly running commands that need it in a wrapper that setsid()s them, let's try reverting it for a while. Please shout if this is a problem for you. See also #1097.
* | | Merge pull request #1102 from bradking/remove-unnecessary-StatIfNecessaryNico Weber2016-03-051-2/+1
|\ \ \ | |/ / |/| | Remove StatIfNecessary call that is never necessary
| * | Remove StatIfNecessary call that is never necessaryBrad King2016-02-251-2/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | The call to StatIfNecessary in DependencyScan::RecomputeOutputsDirty was added by commit v1.4.0^2~7^2~1 (Share more code between CleanNode() and RecomputeDirty(), 2013-09-02) while consolidating code paths. However, it was needed only when called from RecomputeDirty because prior to refactoring the CleanNode code path did not call it. Later commit v1.6.0^2~46^2 (Let DependencyScan::RecomputeDirty() work correclty with cyclic graphs, 2014-12-07) added back to RecomputeDirty a loop over outputs that calls StatIfNecessary. Therefore RecomputeOutputsDirty no longer needs to call StatIfNecessary for either of its own callers.
* | Merge pull request #1110 from G4m4/explicit_std_prefixNico Weber2016-02-171-1/+1
|\ \ | | | | | | Fix ambiguous call to set_terminate on Windows platform
| * | Fix ambiguous call to set_terminate on Windows platformg4m42016-02-171-1/+1
|/ / | | | | | | | | | | | | On Windows set_terminate() could either be the standard C++ one or (actually the same one but in the global namespace) the CRT one declared in corecrt_terminate.h Hence this ambiguity - this patch solves it. Signed-off-by: g4m4 <misept.dieseneuf@gmail.com>
* | Merge pull request #1107 from nicolasdespres/ninja_syntax_implicit_outputsNico Weber2016-02-072-1/+13
|\ \ | | | | | | Add support for implicit outputs in ninja_syntax.py.
| * | Add support for implicit outputs in ninja_syntax.py.Nicolas Despres2016-02-062-1/+13
| | |
* | | Merge pull request #1108 from edbaunton/patch-1Nico Weber2016-02-071-2/+2
|\ \ \ | |/ / |/| | Add link to mailing list
| * | Add link to mailing listEd Baunton2016-02-061-2/+2
|/ / | | | | As a convenience to new users, provide a link to the mailing list.
* | Merge pull request #1106 from nico/winfixNico Weber2016-02-051-5/+3
|\ \ | | | | | | win: Only drop /showIncludes in bootstrap builds.
| * | win: Only drop /showIncludes in bootstrap builds.Nico Weber2016-02-051-5/+3
| | | | | | | | | | | | Fixes #1103.
* | | Merge pull request #1101 from fbenkstein/vs2010Nico Weber2016-02-051-0/+2
|\ \ \ | | | | | | | | disable warning about conditional expressions
| * | | MSVC: disable warning about constant conditional expressionsFrank Benkstein2016-02-051-0/+2
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The standard headers for Visual Studio 2008 generate a warning about constant conditional expressions when compiled with exception support disabled. This is caused by the _CATCH_ALL macro in xstddef which is defined thusly: #ifdef _HAS_EXCEPTIONS #define _CATCH_ALL } catch (...) { #else #define _CATCH_ALL } if (0) { #endif