summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Add string_piece_utilTakuto Ikuta2017-04-264-0/+251
| | | | | | | | | | | | | Following functions are implemented for further performance optimization. * JoinStringPiece * SplitStringPiece * EqualsCaseInsensitiveASCII * ToLowerASCII To improve performance of CLParser, I will introduce above functions into include_normalize-win32.cc.
* use usTakuto Ikuta2017-04-121-2/+2
|
* remove util.hTakuto Ikuta2017-04-121-1/+0
|
* Add clparser_perftestTakuto Ikuta2017-04-121-0/+158
|
* browse: Bind to localhost by defaultTej Chajed2017-03-091-2/+6
| | | | | | | | | Previously the browse server would bind to "", which is translated to 0.0.0.0 (all interfaces), and then the hostname as retrieved by socket.gethostname() was presented to the user. The hostname is now "localhost" by default and is configurable, so the original behavior is achieved with `ninja -t browse -a ""`.
* Merge pull request #1232 from nicolasdespres/fix-canon_perftestNico Weber2017-02-101-1/+1
|\ | | | | Fix compilation error in canon_perftest.
| * Fix compilation error in canon_perftest.Nicolas Despres2017-02-021-1/+1
| | | | | | | | Introduced by 1cc730ddc27df52.
* | Support restat when rebuilding manifestDan Willemsen2017-02-081-4/+13
|/ | | | | | | | As a fix for #874, we started reloading the entire manifest even if the manifest was never rebuilt due to a restat rule. But this can be slow, so call State::Reset instead, which also fixes the original crash. Fixes #987
* Merge pull request #1181 from DanielWeber/issue-1161Nico Weber2017-01-2412-48/+57
|\ | | | | Allow more path components
| * Use uint64_t for slash_bits consistentlyDaniel Weber2016-09-015-14/+15
| | | | | | | | The VS compiler complained about possible loss of data (and it was right!)
| * Allow more path componentsDaniel Weber2016-08-229-36/+44
| | | | | | | | | | | | | | - 60 instead of 30 path components - 64 instead of 32 backslashes in a path (windows only) Issue: 1161
* | Close original pipe fd in subprocessesColin Cross2017-01-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Non-console subprocesses have the write end of a pipe connected to fds 1 and 2 for stdout and stderr, but they also have the it connected to whatever fd was assigned in the ninja process when the pipe was created. Add a call to posix_spawn_file_actions_addclose after the posix_spawn_file_actions_adddup2 calls to close the original fd once it has been dup'd to stdout and stderr. This fixes an issue seen in the Android build, where one of the subprocesses is used to start a background helper process. The background process attempts to close any inherited fds, but if ninja used a very large fd number due to a high parallelism count the background process would not close the fd and ninja would never consider the subprocess finished.
* | Fix build with uclibcPawel Hajdan, Jr2017-01-021-0/+7
| | | | | | | | | | | | | | | | Resolves #985 This is based on musl implementation, http://git.musl-libc.org/cgit/musl/commit/?id=20cbd607759038dca57f84ef7e7b5d44a3088574 (thanks to jbergstroem@ for reference)
* | windows: replace deprecated GetVersionEx with recommended replacementNico Weber2016-11-081-12/+7
| | | | | | | | | | | | | | | | The recommended replacement VerifyVersionInfo should work with the same SDKs that GetVersionEx worked with (while the wrappers in VersionHelpers.h require a recent SDK). This patch should not change behavior, and it's not supposed to increase build requirements. If this makes things harder to build, please let me know.
* | Merge pull request #1205 from nico/clangclformatNico Weber2016-11-081-1/+1
|\ \ | | | | | | fix a clang-cl -Wformat warning
| * | fix a clang-cl -Wformat warningNico Weber2016-11-081-1/+1
| | |
* | | Merge pull request #1194 from ilor/depfile-empty-pathNico Weber2016-11-081-1/+3
|\ \ \ | | | | | | | | Improve error message when a depfile contains a bad path
| * | | Improve error message when a depfile contains a bad pathTomasz Ĺšniatowski2016-10-121-1/+3
| | | | | | | | | | | | | | | | | | | | Debugging "ninja: error: empty path" is not fun, so make the error message mention the depfile name.
* | | | Merge pull request #1182 from moosotc/masterNico Weber2016-11-081-2/+3
|\ \ \ \ | | | | | | | | | | Use POSIX_SPAWN_USEVFORK if available
| * | | | Use POSIX_SPAWN_USEVFORK if availablemalc2016-08-261-2/+3
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | Existing comments were alluding to it's usage and it makes building ninja itself go a litle bit faster (i.e. taking less wall clock time). FWIW FreeBSD even uses vfork by default c.f. https://www.freebsd.org/cgi/man.cgi?query=posix_spawn
* | | | Merge pull request #1201 from nico/singlecommandNico Weber2016-11-071-5/+35
|\ \ \ \ | | | | | | | | | | teach -t commands to optionally print only the final command
| * | | | teach -t commands to optionally print only the final commandNico Weber2016-11-061-5/+35
| | | | |
* | | | | mark this 1.7.2.gitNico Weber2016-11-071-1/+1
| | | | |
* | | | | Only run SubprocessTest.SetWithLots on FreeBSD when ppoll() exists.Nico Weber2016-11-073-10/+9
| | | | | | | | | | | | | | | | | | | | Should fix #1189 after #1185.
* | | | | Tidy up rate snprintf'ing helperScott Graham2016-10-072-7/+9
| |_|/ / |/| | |
* | | | Disable ppoll(2) on FreeBSD < 10.2Pietro Cerutti2016-09-201-0/+7
| |/ / |/| |
* | | Fixed not initialized elapsed time.gkistanova2016-07-142-5/+9
| | |
* | | Regression test for not initialized elapsed time bug.gkistanova2016-07-141-0/+8
| | |
* | | Constify State::RootNodes().Nicolas Despres2016-06-092-6/+7
| | |
* | | Merge pull request #1157 from colincross/browseNico Weber2016-05-301-6/+10
|\ \ \ | | | | | | | | Escape ninja output inserted into HTML
| * | | Escape ninja output inserted into HTMLColin Cross2016-05-271-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | Ninja query or error output may contain characters that need to be escaped when being inserted into HTML. Replace &, ", <, and > with their & equivalent.
* | | | Parser accepts no explicit outputs.Nicolas Despres2016-05-253-9/+45
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a class of commands that take an output directory where they create their output files. Among them are cp(1), tar(1) to name a few. These commands have one or more implicit outputs but no explicit output. With this patch, Ninja's parser accepts build edge with an empty list of explicit outputs.
* | | 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
| | |
* | | Update %p to use finished edges after #1143.Nico Weber2016-04-281-1/+1
| | |
* | | Change default NINJA_STATUS to [%f/%t]Colin Cross2016-04-281-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | mark this 1.7.0.gitNico Weber2016-04-271-1/+1
| |
* | 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.
* | 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.
* 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.
* 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.
* | Make deps=msvc experimentally available on non-Windows.Nico Weber2016-04-068-211/+288
| | | | | | | | | | | | | | | | | | 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.