summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Simplify scheduler to not use build log/execution timePeter Bell2022-08-105-235/+51
|
* Merge remote-tracking branch 'upstream/master' into cpsched-2Peter Bell2022-08-1017-164/+706
|\
| * Make IsDepsEntryLiveFor static and add const to parameter (#2141)Igor [hyperxor]2022-06-203-3/+3
| |
| * Build ninja with C++11 (#2089)Bruce Dawson2022-06-164-62/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Build ninja with C++11 In order to allow future use of std::chrono to make the stats code portable it is desirable to compile with C++11. Doing so also allows use of std::unordered_map, and reduces the number of #ifdefs in the ninja source code. Switching to C++11 requires modifying both CMakeLists.txt and configure.py, for MSVC and for other build systems. For MSVC the required change is adding /Zc:__cplusplus to tell the compiler to give a more accurate value for the __cplusplus macro. For other platforms the change is to add -std=c++11 or the CMake equivalent. This change makes some progress towards resolving issue #2004. * Delete code and instructions C++11 guarantees that string::data() gives null-terminated pointers, so explicitly adding a null terminator is no longer needed. The Google C++ Style Guide already recommends avoiding unnecessary use of C++14 and C++17 so repeating this in CONTRIBUTING.md is not critical. These changes both came from PR-review suggestions. * Only set cxx_std_11 if standard is 98 * Return to unconditional target_compile_features use After much discussion it sounds like using target_compile_features unconditionally is best.
| * Introduce mechanism to provide resiliency for inputs changing while the ↵John Drouhard2022-06-108-80/+396
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | build runs When an edge starts to run, create a temporary lock file in the build directory, stat it, and cache its mtime. When the command finishes, use the temporary lock file's mtime from when the edge started running as the mtime that is recorded in the build log for each of the edge's output(s). Subsequent runs will use that as the mtime for the output(s). This provides robustness against inputs changing while the command itself is running. If an input is changed, the subsequent run will detect the output as dirty since its recorded mtime reflects when the build command began, not when the output was actually written to disk. Generator and restat rules are exempt from this and will continue to record their actual mtime on disk at the time the command finished in the build log (unless the restat rule cleans the output). This avoids potential infinite loops when the generator rule touches input dependencies of the output(s) or a restat rule intentionally changes implicit dependencies of its output.
| * chore: fix build warningGregor Jasny2022-05-171-1/+1
| |
| * mark this 1.11.0.gitJan Niklas Hasse2022-05-151-1/+1
| |
| * Merge pull request #1827 from okhowang/cpu-limitJan Niklas Hasse2022-04-302-5/+197
| |\ | | | | | | Support cpu limit in docker
| | * feat: don't detect cpu if -j setokhowang(王沛文)2021-11-011-1/+20
| | |
| | * feat: support cpu limit by cgroups on linuxokhowang(王沛文)2021-11-011-2/+161
| | |
| | * feat: support cpu limit by job api on windowsokhowang(王沛文)2021-11-011-2/+16
| | |
| * | Make the output of `ninja -t inputs` deterministicDavid 'Digit' Turner2022-03-214-6/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | This sorts the output of `ninja -t inputs` to make it deterministic and remove duplicates, and adds a regression test in output_test.py + Ensure all inputs are listed, not only explicit ones. + Document the `inputs` tool in doc/manual.asciidoc.
| * | Ensure the `msvc` tool is built in all Win32 Ninja binaries.David 'Digit' Turner2022-03-111-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | It was only previously available when Ninja was built when `_MSVC` is defined (i.e. when compiling with the Microsoft compiler of with `clang-cl`). + Tag the tool as DEPRECATED
* | | Clarify the purpose of active_edges in back-propagationPeter Bell2022-03-081-3/+5
| | |
* | | Rename critical_time to critical_time_msPeter Bell2022-03-084-24/+24
| | |
* | | Pool: sort equally-weighted edges by priorityPeter Bell2022-03-082-4/+14
| | |
* | | Add test and fix priority bugPeter Bell2022-03-083-37/+231
| | | | | | | | | | | | | | | AddTarget cannot add edges to the ready queue before the critical time has been computed.
* | | Add run_time_ms accessors and more commentsPeter Bell2022-03-082-14/+22
| | |
* | | Improve comments and retrieve edges into ready_queue directlyPeter Bell2022-03-076-31/+28
| | |
* | | Add simple test for EdgeQueuePeter Bell2022-03-072-1/+54
| | |
* | | Remove unnecessary whitespacePeter Bell2022-03-072-2/+0
| | |
* | | Merge remote-tracking branch 'upstream/master' into cpschedPeter Bell2022-03-0725-194/+955
|\ \ \ | |/ /
| * | Merge pull request #2088 from digit-google/fix-ReadFile-handle-leakJan Niklas Hasse2022-02-231-1/+2
| |\ \ | | | | | | | | Fix ReadFile() handle leak on read error on Windows.
| | * | Fix ReadFile() handle leak on read error on Windows.David 'Digit' Turner2022-02-181-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Small change to fix a file handle leak in case of error. Also return -EIO instead of -1 to signal read errors, since it is more consistent with what is happening here.
| * | | Don't disable stdout buffering on WindowsBruce Dawson2022-02-171-11/+0
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Long ago ninja disabled stdout buffering. Since then much has changed and this appears to no longer be needed, while also being actively harmful. Disabling of stdout buffering is not needed because printing is done (in LinePrinter::Print) either with WriteConsoleOutput (which is unaffected by stdout buffering) or by printf followed by fflush. Meanwhile, the unbuffered printing in the printf case causes dramatic slowdowns which are most visible in dry-run builds, as documented in issue #2084. This fixes issue #2084, finishing off the incomplete buffering fix done in pull request #2031.
| * | Merge pull request #1730 from naarcini/masterJan Niklas Hasse2022-02-021-1/+33
| |\ \ | | | | | | | | Add 'inputs' tool to print out all inputs for a set of targets
| | * | Add 'inputs' tool to print out all inputs for a set of targetsNicolas Arciniega2020-02-031-1/+33
| | | |
| * | | Merge pull request #2074 from gunechristensen/masterJan Niklas Hasse2022-02-021-1/+2
| |\ \ \ | | | | | | | | | | Filter lines ending with ".c++" in clparser
| | * | | Filter lines ending with ".c++" in clparserDESKTOP-8CNEPM9\sune2022-01-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Projects like cap n proto uses c++ extensions and generates a lot of status noise when running ninja.
| * | | | Merge pull request #2055 from swills/still-dirty-timeJan Niklas Hasse2022-01-281-1/+1
| |\ \ \ \ | | |/ / / | |/| | | Suggest possible cause for hitting cycle limit
| | * | | Suggest possible cause for hitting cycle limitSteve Wills2021-11-231-1/+1
| | | | |
| * | | | Merge pull request #1901 from MartinBP/windows_case_sensitive_foldersJan Niklas Hasse2022-01-201-3/+4
| |\ \ \ \ | | | | | | | | | | | | disk_interface: Improve the stat cache handling for case sensitive folders on Windows
| | * | | | disk_interface: Improve the stat cache handling for case sensitive folders ↵Martin Boye Petersen2021-01-021-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | on Windows The path used as argument to FindFirstFileExA is no longer being converted to lowercase. By not converting the path to lower case, case sensitive folders will now be handled correctly. Case insensitive folders still works as expected because casing doesn't matter on those. All entries in the stat cache remains lowercase to avoid potential cache misses.
| * | | | | Disable re2c from embedding the version number in the source fileMarc-Antoine Ruel2021-12-312-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The checked in sources (depfile_parser.cc and lexer.cc) have the re2c version embedded in it. The output didn't change since re2c 1.3, except for the different version number. A reproducible build would use a pinned version of re2c anyway, so there is no need to hardcode its value in the checked in generated files.
| * | | | | Fix two typosMarc-Antoine Ruel2021-12-282-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | One in ninja_test usage text, the other in a unit test comment.
| * | | | | Merge pull request #1800 from colincross/validationsJan Niklas Hasse2021-12-2115-165/+649
| |\ \ \ \ \ | | |_|/ / / | |/| | | | Add validation nodes to ninja
| | * | | | Add validation nodes to ninjaColin Cross2021-10-1215-160/+636
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A common problem in the Android build is inserting rules that perform some sort of error checking that doesn't produce any artifacts needed by the build, for example static analysis tools. There are a few patterns currently used, both of which have downsides. The first is to have a rule that depends on all of the static analysis results. This ensures they run, but requires running static analysis over everything, and not just the active parts of the build graph. The second is to insert the static analysis rule into the build graph between the artifact producing rule and anything that depends on it, often copying the artifact as the output of the static analysis rule. This increases the critical path of the build, often reducing parallelism. In the case of copying the artifact, it also wastes disk space. This patch adds "validation nodes" to edges in Ninja. A build statement can specify validation nodes using "|@" in the edge inputs. The validation nodes are not used as an input to the edge (the edge can run before the validation node is ready), but are added to the initial nodes of the build graph whenever the edge is part of the build graph. The edge that outputs the validation node can depend on the output of the edge that is being validated if desired. Test: ninja_test Change-Id: Ife27086c50c1b257a26509373199664680b2b247
| | * | | | Remove early return from Builder::AddTargetColin Cross2021-10-122-5/+13
| | | |_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor Builder::AddTarget to remove an early return in a non-error case. The next CL will add code that needs to be executed even if the node is clean. Change-Id: I953dc54b60b635dd75d75f8f3931970faefc5ecf
| * | | | Fix crash when FakeCommandRunner is deleted twiceJan Niklas Hasse2021-11-161-0/+1
| | | | |
| * | | | Fix typos discovered by codespell (#2047)Christian Clauss2021-11-125-5/+5
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | % [`codespell --count --ignore-words-list=fo .`](https://pypi.org/project/codespell/) ``` ./ninja/src/missing_deps.cc:119: dependecy ==> dependency ./ninja/src/includes_normalize-win32.cc:51: funcation ==> function ./ninja/src/eval_env.h:58: invokable ==> invocable ./ninja/src/missing_deps_test.cc:155: beacuse ==> because ./ninja/src/deps_log_test.cc:393: unparseable ==> unparsable ```
| * | | Disable stdout buffering in real_mainBruce Dawson2021-10-012-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously stdout buffering was disabled in the LinePrinter constructor. This worked for a long time but ultimately this side-effect caused a performance bug (issue #2018) in tools such as -t deps. Moving the disabling of buffering into real_main and only disabling buffering when a tool is not used makes the desired semantics clearer and restores the lost performance. This fixes issue #2018. It has been tested and a 10x speedup was seen relative to the tip-of-tree version.
| * | | Merge pull request #1964 from rascani/fix-phony-edgesNico Weber2021-10-014-6/+227
| |\ \ \ | | | | | | | | | | Set output mtime of phony edges to the latest inputs
| | * | | Set output mtime of phony edges to the latest inputsRichard Geary2021-08-024-6/+227
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit fixes issue #478. Observed: Real edges depending on a phony edge will not be marked as dirty or rebuilt if the phony's (real) inputs are updated. Expected: An edge should always be rebuilt if its inputs or transitive inputs are newer than the output's mtime. Change: Node::mtime_ was overloaded, 0 represented "does not exist". This change disambiguates it by adding Node::exists_. Then to fix the observed behaviour, Node::UpdatePhonyMtime was added to update the mtime if the node does not exist. Add tests BuildTest.PhonyUseCase# GraphTest.PhonyDepsMtimes. Unit tests will also test for always-dirty behaviour if a phony rule has no inputs.
| * | | | Fix ninja -t clean for directories on WindowsMischa Jonker2021-09-132-7/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | remove() deletes both files and directories. On Windows we have to select the correct function (DeleteFile will yield Permission Denied when used on a directory) This fixes the behavior of ninja -t clean in some cases https://github.com/ninja-build/ninja/issues/828
* | | | | Address review commentsPeter Bell2022-03-073-48/+39
| | | | | | | | | | | | | | | | | | | | | | | | | 1. Move EdgePriorityQueue to graph.h and inherit from priority_queue 2. Add comment about edge->critical_time()
* | | | | Remove redundant includePeter Bell2021-10-081-1/+0
| | | | |
* | | | | Improve heuristic for unknown cost edgesPeter Bell2021-08-272-38/+77
| | | | |
* | | | | Address review commentsPeter Bell2021-08-271-8/+5
| | | | |
* | | | | Fix total_time computationPeter Bell2021-08-271-1/+3
| | | | |
* | | | | Address review commentsPeter Bell2021-08-273-29/+25
| | | | |