summaryrefslogtreecommitdiffstats
path: root/src/build.h
Commit message (Collapse)AuthorAgeFilesLines
* simplify & inlineScott Graham2015-04-271-6/+1
|
* avoid calling ResumeDelayedJobs insteadScott Graham2015-04-241-1/+1
|
* Cleanup: Make stack a const ref now that it's no longer modified.Nico Weber2015-04-011-1/+2
|
* Make failing stat() calls abort the build.Nico Weber2015-03-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Minor style fixes. No functionality change.Nico Weber2013-10-191-2/+3
|
* add deps_prefix for localized /showIncludes' output parsingPeter Kümmel2013-10-181-1/+1
|
* Minor style fixes, no behavior change.Nico Weber2013-08-231-1/+1
|
* Fix for incorrect number of total edges in the status messageRichard Geary2013-08-221-1/+1
|
* Fix for missing "no work to do." message if all build edges are phony rules.Richard Geary2013-08-111-1/+1
| | | | Added NestedPhonyPrintsDone unit test
* Adding error checking on fwrite/fflush in deps_logMaxim Kalaev2013-07-011-1/+4
|
* drop std:: qualifiers on more stl datatypesEvan Martin2013-04-181-2/+1
| | | | We "using namespace std" anywhere we need a std::string or a std::vector.
* always use output timestamp for depsEvan Martin2013-04-101-2/+1
| | | | | | | | Using the timestamp of the .d file was wrong. It can be written at a different time than the output, and it is immediately deleted after parsing; only the output remains for subsequent timestamp comparison purposes, so always use the output's timestamp. (This is how the code worked on Windows already.)
* fix testScott Graham2013-04-091-4/+0
|
* Merge branch 'dep-pipeless'Evan Martin2013-04-091-4/+19
|\ | | | | | | | | This merges a new mechanism for tracking "depfile" dependencies that is faster on all platforms but dramatically so on Windows.
| * add a straightforward deps log test, fix the other oneEvan Martin2013-04-091-1/+2
| | | | | | | | | | | | The first test I wrote was wrong; write a simpler test that exercises the "no failures" code paths, then fix the second test and the bugs it exposed.
| * hook up depslog writing into build processEvan Martin2013-04-081-3/+4
| |
| * refactor build-time deps-extractionEvan Martin2013-04-081-0/+3
| |
| * plumb DepsLog load through BuilderEvan Martin2013-04-081-1/+2
| |
| * pass command results via a structEvan Martin2013-04-081-2/+11
| | | | | | | | | | WaitForCommand now passes all command output via a struct. This will allow adding more output in a future change.
* | move single-line printing to new classNico Weber2013-04-091-4/+3
|/
* NINJA_STATUS now takes %e for elapsed time.Avinash Baliga2013-03-041-0/+1
|
* Merge pull request #461 from riannucci/global_sectionEvan Martin2012-12-131-3/+13
|\ | | | | Resource pools for ninja
| * Doc improvementsRobert Iannucci2012-11-301-0/+8
| |
| * stub out an api and de-constify PoolRobert Iannucci2012-11-091-3/+5
| |
* | Fix a doxygen bug found by clang's -Wdocumentation.Nico Weber2012-11-081-1/+1
|/ | | | | (That found one more issue, but I think that might be a bug in -Wdocumentation, http://llvm.org/PR14295.)
* Fix subtile buffer size errorPeter Kümmel2012-09-181-4/+4
| | | | | The deduced type was char* with size 4 and not char[32] with size 32. This removes strange output characters on Windows.
* remove some code duplicationPeter Kümmel2012-09-181-16/+12
|
* Change rate measurement code.Nico Weber2012-09-141-18/+40
| | | | | | | | | | | For %o, remove a superfluous + 0.5: snprintf("%f") rounds already. Remove some unnecessary code. For %c, fix a TODO to add a sliding window and update after every completed edge. Else, with -j50 and several files that take 3s to compile each, this number would only update every 150s. Also give the number one decimal place so that this can measure steps slower than 1s.
* move BuildLog to DependencyScanEvan Martin2012-09-041-2/+6
| | | | | | | 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.)
* split out dirty recomputation logic from Edge classEvan Martin2012-09-021-1/+3
| | | | | | | | | | Rather than passing States and DiskInterfaces through all the calls, put the necessary ambient information in a new DependencyScan object and move the code accordingly. Note: I didn't move the source location of the functions to preserve history, though this does result in a sort of weird order for the functions in graph.cc.
* use DiskInterface to create the build directoryEvan Martin2012-08-071-2/+4
| | | | | | | | | | Fixes issue #392 (didn't handle creating nested build dirs right). Moves MakeDir out of util.h; all code should go through DiskInterface to simplify testing. Moves ownership of the DiskInterface into the client of the Builder, which also allows removing some code that reached inside the object as well as a minor leak.
* GCC 4.7 needs cstdioPeter Kümmel2012-07-151-1/+1
|
* print edges per secondPeter Kuemmel2012-07-151-0/+35
| | | | | | | | | | | prints the rate of finished edges per second to the console, for instance with NINJA_STATUS="[%s/%t %o(%c)/s] ": [132/1922 16.1(14)/s] 16.1 is the average for all processed files (here 132 since start) 14 is the average of the last n files while n is the number specifies by -j (or its default)
* Merge pull request #316 from tfarina/structEvan Martin2012-06-171-4/+5
|\ | | | | No need to write 'struct' before type name when declaraing variables in ...
| * No need to write 'struct' before type name when declaraing variables in C++.Thiago Farina2012-05-231-4/+5
| | | | | | | | Signed-off-by: Thiago Farina <tfarina@chromium.org>
* | Remove unused variable last_update_millis_.Nico Weber2012-06-011-2/+0
|/
* views: Mark single-argument constructors as explicit.Thiago Farina2012-05-061-1/+1
| | | | | | | | This was reported by cpplint as: python ~/depot_tools/cpplint.py 2>&1 | grep -v "Done processing" | grep explicit Signed-off-by: Thiago Farina <tfarina@chromium.org>
* Fix Windows build.Nico Weber2012-04-301-1/+1
|
* Merge pull request #274 from polrop/max_load_averageEvan Martin2012-04-281-1/+4
|\ | | | | Max load average
| * Add -l N option to limit the load average.Nicolas Despres2012-04-191-1/+4
| | | | | | | | | | | | | | This is similar to GNU make -l/--load-average option. It limits the number of job started if the load average exceed the given value. It can be very useful when running ninja on a continuous integration server where we want to use parallelism as much as possible without overloading the server.
* | reduce custom ninja status patch in minor waysEvan Martin2012-04-261-15/+2
| | | | | | | | | | Elsewhere in the code I avoid sstream and manual buffer management, so switch this code to behave similarly. Sorry for being OCD.
* | Refactor and test progress status formatting.Nicolas Despres2012-04-241-0/+58
|/
* Be more selective about deleting output files when interruptedPeter Collingbourne2012-03-011-0/+3
| | | | | | | Specifically, only delete if the file was modified or if the rule uses a depfile. Fixes issue #226.
* If a command fails, wait for all running commands to terminate before we doPeter Collingbourne2012-02-041-2/+2
| | | | | | | | | | | | | | | | | | Previously, if a command fails, the fate of the other child processes running in parallel was inadequately controlled. On POSIX platforms, the processes were orphaned. Normally they would run to completion, but were liable to being killed by a SIGPIPE. On Windows, the child processes would terminate with the parent. The cleanup-on-interrupt patch caused the SubprocessSet and Builder destructors to clean up after themselves by killing any running child processes and deleting their output files, making the behaviour more predictable and consistent across platforms. If the build is interrupted by the user, this is correct behaviour. But in the case where the build is stopped by a failed command, this would be inconsistent with user expectations. In the latter case, we now let any remaining child processes run to completion before leaving the main loop in Builder::Build.
* Implement cleanup-on-interruptPeter Collingbourne2012-02-041-2/+13
| | | | | | | | This causes us to clean up by deleting any output files belonging to currently-running commands before we quit if we are interrupted (either by Ctrl-C or by a command failing). Fixes issue #110.
* Implement restat rulesPeter Collingbourne2011-10-241-0/+4
| | | | | | | | | | | | | | | | | A restat rule is a rule which is capable of pruning the build tree depending on the timestamps of its outputs before and after a build. After a restat rule is rebuilt, Ninja will re-stat each output file to obtain its current timestamp. If the timestamp is unchanged from when Ninja initially stat'ed the file before starting the build, Ninja will mark that output file as clean, and recursively for each reverse dependency of the output file, recompute its dirty status. Ninja then stores the most recent timestamp of any input file in the build log entry associated with the output file. This timestamp will be treated by future invocations of Ninja as the output file's modification time instead of the output file's actual modification time for the purpose of deciding whether it is dirty (but not whether its reverse dependencies are dirty).
* Split Node::dirty_ into two flags: Node::dirty_ and Edge::outputs_ready_Peter Collingbourne2011-10-181-2/+12
| | | | | dirty_ is intended to remain static during the build (unless a restat occurs), while outputs_ready_ reflects the dynamic state of the build.
* fix redundant manifest rebuildEvan Martin2011-09-081-0/+9
| | | | | | | Don't rebuild the manifest when it's already up to date. The underlying problem was that Builder::Build has a confusing API; split the API so it's more clear for callers what the return values mean.
* simplify CommandRunner, simplifying users tooEvan Martin2011-05-171-4/+2
| | | | | After much staring at this I think I found the more clear way to express what it's doing.
* refactor status printing into BuildStatusEvan Martin2011-05-141-2/+2
| | | | | | Centralizing printing allows being more careful about what is output. 1) Always include the [2/15] prefix on commands. 2) Make the header command match the error output command.