summaryrefslogtreecommitdiffstats
path: root/src/build.cc
Commit message (Collapse)AuthorAgeFilesLines
* build metrics: StartEdge and EndEdgeMaxim Kalaev2012-10-121-0/+2
| | | | | | | Total build time is also relevant. The costs of StartEdge and EndEdge turned out to be quite surprising. Especially if multiple targets are specified on edges. (I've tried declaring depfiles targets explicitly)
* Move DryRunCommandRunner into a unnamed namespace.Thiago Farina2012-10-021-24/+39
| | | | | | No functional change. Signed-off-by: Thiago Farina <tfarina@chromium.org>
* build with msvc2012Peter Kümmel2012-09-181-1/+1
|
* remove some code duplicationPeter Kümmel2012-09-181-2/+3
|
* Change rate measurement code.Nico Weber2012-09-141-15/+9
| | | | | | | | | | | 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.
* include termios for solarisAlex Caudill2012-09-071-0/+4
|
* move BuildLog to DependencyScanEvan Martin2012-09-041-5/+4
| | | | | | | 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.)
* remove a redundant arg to RecomputeOutputDirtyEvan Martin2012-09-021-5/+6
|
* split out dirty recomputation logic from Edge classEvan Martin2012-09-021-7/+8
| | | | | | | | | | 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-3/+3
| | | | | | | | | | 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.
* Re-factor elide code and test it.Nicolas Despres2012-07-311-13/+2
|
* fix a warning and leak in windows-specific console output codeEvan Martin2012-07-271-2/+2
|
* Merge pull request #351 from syntheticpp/rateEvan Martin2012-07-271-1/+27
|\ | | | | print edges per second
| * print edges per secondPeter Kuemmel2012-07-151-1/+27
| | | | | | | | | | | | | | | | | | | | | | 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)
* | windows: use WriteConsoleOutput instead of printf to avoid moving cursorScott Graham2012-07-191-6/+20
|/
* Efficiently check for emptinessPierre Schweitzer2012-07-141-1/+1
|
* Merge pull request #313 from wolfp/restat_missing_inputEvan Martin2012-07-031-7/+1
|\ | | | | Do not reset restat_mtime if an input is missing
| * Do not reset restat_mtime if an input is missing (issue #295)wolfp2012-06-271-7/+1
| |
* | Remove code that was never executed.Nico Weber2012-06-021-9/+1
| | | | | | | | | | total_time was always -1, because it computed a pointer difference, not a time difference (should've been |*end_time - *start_time|).
* | Merge pull request #320 from nico/cleanupEvan Martin2012-06-021-2/+0
|\ \ | | | | | | Remove unused variable last_update_millis_.
| * | Remove unused variable last_update_millis_.Nico Weber2012-06-011-2/+0
| |/
* | Missing header file for "getenv".Jonathan Sternberg2012-05-311-0/+1
| |
* | Removing unused sys/termios.h header.Jonathan Sternberg2012-05-301-1/+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>
* Merge pull request #274 from polrop/max_load_averageEvan Martin2012-04-281-1/+3
|\ | | | | Max load average
| * Add -l N option to limit the load average.Nicolas Despres2012-04-191-1/+3
| | | | | | | | | | | | | | 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.
| * Remove trailing white spaces.Nicolas Despres2012-04-191-6/+6
| |
* | reduce custom ninja status patch in minor waysEvan Martin2012-04-261-82/+49
| | | | | | | | | | Elsewhere in the code I avoid sstream and manual buffer management, so switch this code to behave similarly. Sorry for being OCD.
* | Merge branch 'custom_ninja_status' of git://github.com/polrop/ninjaEvan Martin2012-04-261-43/+98
|\ \
| * | Refactor and test progress status formatting.Nicolas Despres2012-04-241-68/+46
| | |
| * | Introduce NINJA_STATUS env var for customization.Nicolas Despres2012-04-241-2/+79
| | | | | | | | | | | | | | | | | | Some people may want to display different relevant information about the progress of the build. Also it can be usefull to debug jobs allocation.
| * | Remove trailing white spaces.Nicolas Despres2012-04-241-6/+6
| |/
* | Merge pull request #269 from sgraham/explainEvan Martin2012-04-261-1/+1
|\ \ | | | | | | add support for -d explain to help debug why rules are running
| * | add support for -d explain to help debug why rules are runningScott Graham2012-04-131-1/+1
| |/
* | Merge pull request #228 from pcc/lazily-create-commandrunnerEvan Martin2012-04-261-4/+8
|\ \ | |/ |/| Lazily create the CommandRunner in Builder::Build
| * Lazily create the CommandRunner in Builder::BuildPeter Collingbourne2012-02-271-4/+8
| | | | | | | | | | This allows the user to interrupt the build (i.e. using Ctrl-C) while the build plan is being computed.
* | Include unistd.h where neededBen Boeckel2012-03-281-0/+1
| |
* | Be more selective about deleting output files when interruptedPeter Collingbourne2012-03-011-3/+18
| | | | | | | | | | | | | | Specifically, only delete if the file was modified or if the rule uses a depfile. Fixes issue #226.
* | [win32] Overprint the previous line if we're attached to a consoleScott Graham2012-02-271-5/+38
|/
* Merge pull request #217 from PetrWolf/masterEvan Martin2012-02-231-2/+13
|\ | | | | Response files
| * Response filesunknown2012-02-091-2/+13
| |
* | fix depfile_ accessThiago Farina2012-02-161-1/+1
| |
* | Merge pull request #176 from pcc/exit-cleanupEvan Martin2012-02-141-37/+92
|\ \ | |/ |/| Implement cleanup-on-interrupt
| * If a command fails, wait for all running commands to terminate before we doPeter Collingbourne2012-02-041-14/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-17/+59
| | | | | | | | | | | | | | | | 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.
| * Clean up how the build line is managed at the end of the buildPeter Collingbourne2012-02-041-6/+20
| |
* | compute command twice only in case of an errorPeter Kuemmel2012-02-041-3/+2
|/
* windows: use _WIN32 define everywhereEvan Martin2012-01-221-2/+2
| | | | Rather than mixing use of WIN32 and _WIN32.
* Strip ansi escape sequences from subcommand output when not writing to a ↵Nico Weber2012-01-191-2/+20
| | | | smart terminal.
* Add a test that dry run shows all commands that could be run (noneFrances Buontempo2012-01-161-1/+1
| | | | cleaned) and a fix for this