summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* add -d keeprsp to preserve @rsp files on success on windowsScott Graham2013-09-105-3/+12
|
* Simplify.Nico Weber2013-09-081-3/+2
|
* Fix for build test for BuildWithDepsLogTest.RestatMissingDepfileDepslogRichard Geary2013-09-071-1/+4
|
* Make depslog v1->v3 message less scary.Nico Weber2013-09-061-1/+1
| | | | See the comment 5 lines up for details.
* Simplify.Nico Weber2013-09-021-18/+7
|
* Delete a line I failed to delete in d7a46654a7be1.Nico Weber2013-09-021-1/+0
|
* Fix restat rebuild if deps are missing.Maxim Kalaev2013-09-024-4/+126
| | | | | | | | | | | | Fixes issue #603. Apparently, the problem was caused by my fix r "consider target dirty if depfile is missing" (bcc8ad1), which was not working correctly with restat rules cleaning nodes. Switching to deps only triggered an easily observable issue. Fix by setting a flag in edges with invalid deps, and not cleaning edges with that flag set.
* Share more code between CleanNode() and RecomputeDirty().Maxim Kalaev2013-09-023-25/+23
| | | | | | | | | Move a common loop into the new function RecomputeOutputsDirty(). Simplifies things a bit, and makes it harder for the restat path to have different behavior from the regular path. No dramatic behavior change (the restat path now also calls RestatIfNecessary()).
* Check depslog timestamp in LoadDepsFromLog(), not in RecomputeOutputDirty().Maxim Kalaev2013-09-023-26/+23
| | | | | | | | | | | | RecomputeOutputDirty() is called from two places: 1. RecomputeDirty(), which calls LoadDeps(). 2. CleanNode(), which always passes 0 for the deps mtime. So this is no behavior change in either case. deps_mtime was nonzero only in deps mode, and it got passed all over the place. This makes things simpler.
* Simplify implementation of GetProcessorCount().Benedikt Meurer2013-09-011-22/+2
| | | | | | | | | The current implementation is unnecessarily complex, because: - The BSD derived systems implement sysconf(_SC_NPROCESSORS_ONLN) in terms of sysctl({CTL_HW,HW_NCPU}). - get_nprocs() is a GNU extension, and glibc implements sysconf(_SC_NPROCESSORS_ONLN) in terms of get_nprocs().
* Fix an issue with more than 64k deps, spotted by maximuska.Nico Weber2013-08-282-1/+34
| | | | Also add a test for this case, which would have spotted the issue too.
* document an assumptionNico Weber2013-08-281-0/+1
|
* Deps log format v3Nico Weber2013-08-282-30/+36
| | | | | | | | | | | | | | | This fixes two bugs. 1.) It makes the record size field 4 byte instead of 2, and allows a max record size of 512kB. This fixes #605, ninja "only" supporting 8k dependencies per file -- 512kB have room for 128k dependencies. (If that's still not enough, the current design can support at least 4x that if the constant is tweaked.) 2.) It makes all records 4-byte aligned, which is probably needed to make the `reinterpret_cast<int*>(buf)` work on SPARC (cf issue #481), and it's generally nicer too. (Since there's already one reinterpret_cast, convert a memcpy() to reinterpret_cast in another branch too).
* Suffix depslog path records with their expected index.Nico Weber2013-08-262-7/+34
| | | | | | | | | | | | | | | | | | ninja assumes that numbering path entries in the deps log in order produces valid dense integer ids. If two ninja processes write to the same deps log concurrently, this is not true. Store the expected indices of path records in the log and treat the rest of a deps log as invalid if the dense id of a path record doesn't match the expected id stored in the log. Addresses the rest of issue #595. This requires bumping the deps log file format version. Do not migrate the old version to the new, as the old format did not have this protection, and might hence contain invalid data. (Unlikely, but possible.) Also store the record id as one's complement, to make them look less like regular deps record values. Since each record is written atomically this isn't really necessary, but it makes the format somewhat more robust (and easier to read in a hex editor).
* Minor style fixes, no behavior change.Nico Weber2013-08-235-6/+6
|
* Merge pull request #628 from rnk/wstrNico Weber2013-08-231-1/+6
|\ | | | | Use fwrite in the msvc tool instead of printf
| * Merge branch 'master' into wstrReid Kleckner2013-08-194-4/+28
| |\
| * | Avoid indexing into an empty string.Reid Kleckner2013-08-191-1/+4
| | |
| * | Use fwrite in the msvc tool instead of printfReid Kleckner2013-07-261-1/+3
| | | | | | | | | | | | | | | This allows wide characters from the compiler to propagate through the msvc tool. Similar to ad76e867f782e75e0fed620e7b39f7099af154a9.
* | | Add a test for issue #638.Nico Weber2013-08-221-0/+1
| | |
* | | Fix for incorrect number of total edges in the status messageRichard Geary2013-08-222-5/+2
| |/ |/|
* | Fix for missing "no work to do." message if all build edges are phony rules.Richard Geary2013-08-113-2/+25
| | | | | | | | Added NestedPhonyPrintsDone unit test
* | Fix the browse tool.Tony Chang2013-07-261-2/+3
|/ | | | | | | ReadFlags was altering argv in real_main causing us to pass the wrong value into the NinjaMain constructor. Fix this by storing the ninja command before real_main runs.
* Build log write error checking.Nico Weber2013-07-243-11/+21
| | | | Like f6f00aa40f0c541df06, but for the build log instead of the deps log.
* Merge pull request #612 from maximuska/proposed/deps_log_write_errors_checkingNico Weber2013-07-243-20/+56
|\ | | | | Proposed/deps log write errors checking
| * Adding checks for record overflow in deps_logMaxim Kalaev2013-07-011-6/+21
| |
| * Adding error checking on fwrite/fflush in deps_logMaxim Kalaev2013-07-013-18/+39
| |
* | Add test for correct restat logicChris Hopman2013-07-201-0/+40
| | | | | | | | | | When a single output of an edge is dirty, the restat check should leave all outputs of that edge dirty.
* | Fix restat dirty check logic for edges with multiple outputsChris Hopman2013-07-201-12/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a normal dependency scan (see DependencyScan::RecomputeDirty) we mark all outputs of an Edge as dirty if any of the outputs is dirty. This is the correct behavior because if any output is dirty, we will run the command for that Edge and that can touch any of the outputs of the Edge and so all the outputs should be marked dirty. When updating the dirty state of Node's for a restat check, we were not applying this logic, instead only those outputs that were actually "dirty" were marked dirty. Before this patch, restat edges with multiple outputs caused not all dependent edges to run.
* | minor: removing noop call to MarkDirty(), fixing commentMaxim Kalaev2013-07-201-2/+1
| |
* | Removing a redundant stat() call with 'deps' and 'restat = 1'Maxim Kalaev2013-07-201-1/+1
| |
* | Merge pull request #623 from nico/fixNico Weber2013-07-193-4/+17
|\ \ | | | | | | Fix diagnostic formatting regression caused by adaa91a33eb2cf23b88.
| * | Fix diagnostic formatting regression caused by adaa91a33eb2cf23b88.Nico Weber2013-07-193-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ninja regressed to include a location for every file on the include stack for nested diagnostics, i.e. it would print: input:1: include.ninja:1: expected path Fix this so that it prints only the current file location, like it used to: include.ninja:1: expected path Also add a test for this.
* | | Add test for a manifest ending in the middle of a keyword.Nico Weber2013-07-181-0/+11
|/ /
* | Add back contents.resize(), but with a comment and just 1 instead of 10.Nico Weber2013-07-181-0/+8
| |
* | Let the ".ninja parse" metric include the time to read the toplevel ninja file.Nico Weber2013-07-111-1/+1
| | | | | | | | | | | | Loads of included ninja files were covered by the ".ninja parse" in Parse() further up the stack from the toplevel file, but the load of the toplevel file wasn't counted. Fix that.
* | Reuse ManifestParser::Load() in ManifestParser::ParseFileInclude().Nico Weber2013-07-111-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ParseFileInclude() was doing the work that Load() was doing. Instead, just make it call Load(). Also, remove a FIXME about using ReadPath() in ParseFileInclude() -- it's already being used. (The FIXME was added in the same commit that added the call to ReadPath() -- 8a0c96075786c19 -- it probably should've been deleted before that commit.) Also, remove a `contents.resize(contents.size() + 10);`. It's not clear what it's for, but if it was important then ManifestParser::ParseFileInclude() would have needed that call too, and it didn't have it. No intended behavior change.
* | Merge pull request #616 from nico/recompactEvan Martin2013-07-083-6/+34
|\ \ | | | | | | 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-083-6/+34
| | | | | | | | | | | | This is useful for performance comparisons between two build directories.
* | | Merge pull request #611 from nico/testparseEvan Martin2013-07-082-5/+105
|\ \ \ | | | | | | | | Improve error message for duplicate rules and unknown pools.
| * | | Improve error message for duplicate rules and unknown pools.Nico Weber2013-07-022-5/+105
| |/ / | | | | | | | | | | | | Also add more tests for invalid manifests. According to gcov, these invalid inputs weren't tested before.
* | | Introducing tool 'deps' dumping ninja deps log entriesMaxim Kalaev2013-07-081-0/+42
| | |
* | | Fix murmur hash implementations to work on strict alignmentMatthew Dempsky2013-07-082-13/+16
|/ / | | | | | | architectures like OpenBSD/mips64el and OpenBSD/hppa64.
* | Use fwrite to print whatever the subcommand wroteReid Kleckner2013-07-021-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Subcommands can write things like UTF-16, which some terminals can understand. printf() will interpret the null bytes as the end of the string. In particular, MSVC's assert() will print wide characters by default, and I can't find a way to disable it, leading to clang assertion failures looking like: FAILED: ...clang.exe ... Aninja: build stopped: subcommand failed. With this fix, I get the desired: FAILED: ...clang.exe ... Assertion failed: SymbolMap... ninja: build stopped: subcommand failed.
* | use !defined(NOT_PPOLL)David Hill2013-07-011-2/+2
| |
* | Exclude Windows as wellDavid Hill2013-07-011-2/+2
| |
* | ugh, missing #David Hill2013-06-291-1/+1
| |
* | cleanup based on comments from martineDavid Hill2013-06-292-2/+2
| |
* | support BitrigDavid Hill2013-06-292-5/+5
|/
* Merge pull request #601 from nico/109fixNico Weber2013-06-221-0/+1
|\ | | | | Add stdlib.h include for atol().