summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Drop unnecessary cycle detection in Plan::AddTargetBrad King2017-06-194-100/+55
| | | | | We now detect and reject cycles in DependencyScan::RecomputeDirty before Plan::AddTarget is called so we can assume DAG input to the Plan.
* Teach RecomputeDirty to detect cycles in the build graphBrad King2017-06-193-20/+73
| | | | | | | | | | | | | | | | RecomputeDirty is the earliest traversal of the build graph complete with depfile-loaded dependencies. Teach it to detect cycles and fail immediately. This avoids the need to tolerate cycles in RecomputeDirty only to diagnose them later. It also enables future simplification of Plan and Builder logic because they will be able to assume DAG input. When RecomputeDirty detects a cycle, reject it with an error message like that previously produced by Plan::CheckDependencyCycle. Previously we used the stat state of each node to determine whether we reached it earlier in the walk. Retain this approach for leaf nodes, but add an explicit walk state mark for each Edge so that we can have a temporary mark to aid cycle detection.
* Add infrastructure for efficient walks through the `Edge` graphBrad King2017-06-192-2/+11
| | | | Store a mark in each `Edge` to be updated as it is encountered by a walk.
* Refactor RecomputeDirty to take a node instead of an edgeBrad King2017-06-195-47/+39
| | | | | | All call sites have a node on which they call `in_edge()` to call RecomputeDirty. Simplify call sites by taking the node directly and calling `in_edge()` internally.
* Simplify BuildTest.StatFailureAbortsBuild test caseBrad King2017-06-191-2/+2
| | | | | Remove a dependency cycle from the test case, as cycles are covered by other tests. Ensure this case covers stat failure on a valid graph.
* Fix segfault on edge with no inputsColin Cross2017-06-162-1/+32
| | | | | | | | PR #1281 added a deference of most_recent_input without checking for NULL, which can occur if a build rule has no inputs. Check it for null before dereferencing, and add a test. Fixes #1290.
* Merge pull request #1156 from cdbennett/windows-binary-mode-outputNico Weber2017-06-141-0/+15
|\ | | | | Write subprocess output to stdout in binary mode
| * 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.
* | Always rebuild on errorsColin Cross2017-05-227-27/+45
| | | | | | | | | | | | | | | | | | | | https://groups.google.com/forum/#!msg/ninja-build/YQuGNrECI-4/ti-lAs9SPv8J discusses a case where an rule updates its output file and then fails. The next run of ninja considers the ouptut file clean and doesn't rebuild it. Always stat output files after they are built, and write the mtime into .ninja_log. Consider output files dirty if the recorded mtime is older than the most recent input file.
* | Add a test that fails if a rule updates it output file but failsColin Cross2017-05-223-2/+59
| | | | | | | | | | | | | | | | https://groups.google.com/forum/#!msg/ninja-build/YQuGNrECI-4/ti-lAs9SPv8J discusses a case where an rule updates its output file and then fails. The next run of ninja considers the ouptut file clean and doesn't rebuild it. Add a test for this case, which currently fails.
* | Move stat metric to DiskInterfaceColin Cross2017-05-222-1/+2
| | | | | | | | | | | | | | Stat is not always used through Node::Stat, it is often used directly through DiskInterface. THe next patches will cause it to be called even more often through DiskInterface, so move the metrics to DiskInterface.
* | Reduce GetFullPathName callsTakuto Ikuta2017-05-091-2/+4
| |
* | Fix for reviewTakuto Ikuta2017-05-095-20/+20
| |
* | Make clparser fastertikuta2017-05-086-79/+130
| | | | | | | | | | | | | | | | | | | | This patch improves perfromance of clparser. * Reduce the number of calling GetFullPathName. * Use StringPiece for Split and Join. * Add EqualsCaseInsensitive for StringPiece not to generate new string instance. * Add some utility member in StringPiece class.
* | 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
| | |