summaryrefslogtreecommitdiffstats
path: root/src/build_log.cc
Commit message (Collapse)AuthorAgeFilesLines
* Add NINJA_FALLTHROUGH macroStefan Becker2018-04-111-0/+6
| | | | | | | | Borrow macro implementation from OpenSSL code. Add the macro after each fallthrough switch case to indicate our intention to the compiler. This silences GCC -Wimplicit-fallthrough warnings, which is implied by GCC 7.x -Wextra.
* Flush changes into .ninja_log right away.Pawel Pluciennik2017-11-241-0/+3
|
* Use strtoll when reading mtime from build log.Elliott Sales de Andrade2017-09-161-1/+1
| | | | This prevents overflow on Windows where 'long' is not 64-bit.
* Make TimeStamp 64-bit.Elliott Sales de Andrade2017-09-161-1/+1
| | | | This prepares it for higher-resolution timestamps.
* Always rebuild on errorsColin Cross2017-05-221-5/+5
| | | | | | | | | | 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.
* Fix AIX compilation error related to printf macrosMike Seplowitz2015-08-191-3/+8
| | | | | On AIX, inttypes.h gets indirectly included by build_log.h. It's easiest just to ask for the printf format macros right away.
* Make sure not to re-define __STDC_FORMAT_MACROS.Lindley French2015-07-311-0/+2
|
* Remove 'Recompacting...' messages.Nico Weber2014-12-181-3/+1
| | | | | | | | | | Recompacting the build log used to be slow, so it made sense to print this message. We then made recompaction much faster, but didn't remove this message back then. The deps log only has it because the build log had it. Since both steps are effectively instant in practice, remove these log messages.
* Don't print "Recompacting..." message from tests.Nico Weber2014-09-191-2/+3
| | | | Now tests don't print anything. Non-test behavior is unchanged.
* Make BuildLogUser reference constant.Nico Weber2014-01-071-2/+3
|
* Rename "IsDead" to "BuildLogUser".Nico Weber2014-01-041-4/+5
|
* Remove dead entries in .ninja_log and .ninja_deps while recompacting.Nico Weber2014-01-021-3/+12
| | | | | | | | | | For .ninja_deps, remove objects that have no in-edges or whose in-edges do not have a "deps" attribute. (This matches the behaviour of `-t deps`). BuildLog doesn't know about state, so let its recompact method take delegate that decides is a path is life or not, and implement it in NinjaMain.
* Minor style fixes, no behavior change.Nico Weber2013-08-231-1/+1
|
* Build log write error checking.Nico Weber2013-07-241-7/+14
| | | | Like f6f00aa40f0c541df06, but for the build log instead of the deps log.
* Merge pull request #616 from nico/recompactEvan Martin2013-07-081-1/+1
|\ | | | | Add a 'recompact' tool, which forces recompaction of the build and deps ...
| * Add a 'recompact' tool, which forces recompaction of the build and deps logs.Nico Weber2013-07-081-1/+1
| | | | | | | | This is useful for performance comparisons between two build directories.
* | Fix murmur hash implementations to work on strict alignmentMatthew Dempsky2013-07-081-12/+13
|/ | | | architectures like OpenBSD/mips64el and OpenBSD/hppa64.
* fix all "class" -> "struct"Evan Martin2012-12-291-2/+1
|
* Fix formattingRobert Iannucci2012-11-301-2/+2
|
* build log: fixing parameter namesMaxim Kalaev2012-10-151-6/+6
|
* build log: mini-refactoring to use constructors to initialize entriesMaxim Kalaev2012-10-121-4/+11
|
* build log: moving HashCommand() calculation out of targets loopMaxim Kalaev2012-10-121-1/+2
|
* Add metric for log recompactingPetr Wolf2012-10-041-0/+1
|
* remove config from BuildLog, rename membersEvan Martin2012-09-021-13/+10
|
* make it more explicit that a bad build log causes us to rebuildEvan Martin2012-08-171-3/+6
| | | | | (Committing this on top of b56fe80 since they're related, but I may end up reverting both.)
* windows: fix size_t<->int conversions in ninja.exeEvan Martin2012-08-101-6/+6
|
* Revert "Make StringPiece data members private."Nico Weber2012-07-281-2/+2
| | | | | | This reverts commit 904c9610fe66c4f4bd63a07d6f057c8603d24394. The commit caused issue #380, this revert fixes it. The revert also makes the test from the previous commit pass.
* Merge pull request #352 from tfarina/string-piece-privateEvan Martin2012-07-271-2/+2
|\ | | | | Make StringPiece data members private.
| * Make StringPiece data members private.Thiago Farina2012-06-301-2/+2
| | | | | | | | Signed-off-by: Thiago Farina <tfarina@chromium.org>
* | Minor: zero log buffer before reading data/parsing itMaxim Kalaev2012-07-271-1/+3
| | | | | | | | Not a real problem, mainly to make valgrind happy
* | don't leak file handle on fail-to-upgrade caseScott Graham2012-06-191-0/+1
|/
* switch build log to print hashes as hexEvan Martin2012-06-191-2/+2
| | | | | | Nico convinced me that it's safe to do this without revving the build log format: the old decimal values will still parse as hex (just as different numbers) and cause a superfluous rebuild.
* drop support of log formats < 4Evan Martin2012-06-181-10/+15
| | | | | Log format 4 was introduced in January. There's been plenty of time to migrate.
* use PRIu64 for printing 64-bit in, %d for printing intEvan Martin2012-06-181-2/+4
| | | | Fixes a warning.
* no recompacting needed when log file is emptyPeter Kuemmel2012-06-181-3/+7
|
* Only store command hashes in the build log.Nico Weber2012-06-151-5/+59
| | | | | | | | | | | | | | .build_log load time 350ms -> 17ms, filesize 197MB -> 1.6MB on Mac. On Windows, it's 500ms -> 20ms. Makes the build log a lot less useful for scripts, but there could be a tool for use cases that need log information. A prototype of such a tool is in https://github.com/nico/ninja/commit/1b243d311 The hash function is 64bit murmurhash2. Assuming that that different commands get the same hash only by chance, it's is very unlikely for two different commands to hash to the same value with a 64bit hash.
* Switch LineReader from fgets() to just fread().Nico Weber2012-05-101-5/+33
| | | | | | | | | | | | | | | | | | | | | fgets() needs to search for a \n in the input, and LineReader's strstr() did the same work again. By using fread() directly, this duplicate work can be saved. (I tried using readline() / fgetln() for the same saving, but those functions are not standard, and were slower than the code in this CL.) Results from running build_log_perftest, on OS X: Before: min 369ms max 372ms avg 370.4ms After: min 243ms max 247ms avg 244.8ms On Windows: Before: min 796ms max 904ms avg 858.0ms After: min 359ms max 375ms avg 371.4ms On Linux: Before: min 161ms max 169ms avg 164.8ms Before: min 130ms max 137ms avg 132.6ms
* Pull BuildLog line reading into its own class. No performance or behavior ↵Nico Weber2012-05-101-11/+36
| | | | change.
* Don't write ninja log header to log on every build on Windows.Nico Weber2012-05-081-0/+4
|
* Merge pull request #290 from nico/metricsEvan Martin2012-05-021-0/+2
|\ | | | | Add .ninja_log load time to metrics.
| * Add .ninja_log load time to metrics.Nico Weber2012-05-011-0/+2
| | | | | | | | On my system, it takes 22% of the empty build time for chrome.
* | Fix Windows build.Nico Weber2012-04-301-0/+3
|/
* Include unistd.h where neededBen Boeckel2012-03-281-0/+1
|
* Fix resources leaksPierre Schweitzer2012-03-131-0/+1
|
* Response filesunknown2012-02-091-1/+1
|
* Fix cygwin build by including stdio.h hereokuoku2012-01-251-1/+0
|
* BuildLog: Use Log::insert(Log::value_type()) to avoid invalid strings.Evan Jones2012-01-131-2/+2
| | | | | | | The MSVC std::string implementation copies strings, so using make_pair resulted in a pointer to invalid memory. This ensures the insert uses a StringPiece without an intermediate std::string copy, so the correct pointer ends up in the hash_map.
* convert ExternalStringHash to use StringPieceEvan Martin2012-01-091-4/+4
|
* convert all time_t to a new TimeStamp typeEvan Martin2012-01-051-2/+2
|
* make my last change actually workEvan Martin2012-01-051-2/+2
|