summaryrefslogtreecommitdiffstats
path: root/src/build.h
Commit message (Collapse)AuthorAgeFilesLines
* Drop unnecessary cycle detection in Plan::AddTargetBrad King2017-06-191-3/+1
| | | | | We now detect and reject cycles in DependencyScan::RecomputeDirty before Plan::AddTarget is called so we can assume DAG input to the Plan.
* Add a test that fails if a rule updates it output file but failsColin Cross2017-05-221-0/+3
| | | | | | | | 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.
* Tidy up rate snprintf'ing helperScott Graham2016-10-071-5/+7
|
* Fixed not initialized elapsed time.gkistanova2016-07-141-0/+1
|
* Fix NINJA_STATUS %r on dumb terminalsColin Cross2016-04-291-2/+9
| | | | | | | | | | | | 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.
* Improve Plan::EdgeFinished signatureBrad King2016-04-191-1/+6
| | | | | | | Use an enumeration instead of a boolean to clarify the purpose of arguments at call sites. Suggested-by: Nico Weber <nicolasweber@gmx.de>
* Release the pool slot held by an edge whether it succeeds or failsFredrik Medley2016-04-061-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* 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.