summaryrefslogtreecommitdiffstats
path: root/src/ninja.cc
Commit message (Collapse)AuthorAgeFilesLines
* Add 'using namespace std;' to all cc files to prepare for removing it from ↵Michael Jones2020-09-301-0/+2
| | | | header files
* Fix typosDimitris Apostolou2020-07-071-2/+2
|
* restat: No need for loading build.ninjaJan Niklas Hasse2020-01-161-1/+1
| | | | | This results in a huge speed up for large builds (e.g. Chromium). See #1718.
* restat: Accept list of outputs to restat (none means all)Jan Niklas Hasse2020-01-161-1/+19
| | | | | This will become handy when the generator only wants to restat the build.ninja entry in the log. See #1718.
* Merge branch 'master' into clean_dead_outputsJan Niklas Hasse2020-01-041-42/+100
|\
| * Merge pull request #1534 from mathstuf/remove-depslog-restrictionJan Niklas Hasse2020-01-041-15/+3
| |\ | | | | | | manifest_parser: remove multi-output depslog restriction
| | * depfile_parser: remove restriction on multiple outputsBen Boeckel2019-11-201-15/+3
| | |
| * | Merge pull request #1685 from jhasse/restatJan Niklas Hasse2020-01-041-8/+60
| |\ \ | | | | | | | | Add restat tool which recalculates all mtimes in the build log
| | * | Ignore nonexistent .ninja_log/.ninja_deps for restat and recompactJan Niklas Hasse2019-12-231-10/+24
| | | |
| | * | Add restat tool which recalculates all mtimes in the build logJan Niklas Hasse2019-12-231-0/+38
| | |/
| * | Fix logic-error in IsPathDead, see #1432Jan Niklas Hasse2019-12-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The conditional `(!n || !n->in_edge()) && ` was moved up. It now needs to be inversed because there's a `return false;`. See https://github.com/ninja-build/ninja/commit/3beebde51a2089ecb01820f1428efe0263deaeea#diff-78294872cbf9d32f4f972288561fa718R146 and https://github.com/ninja-build/ninja/pull/1432#discussion_r321827528
| * | Fix error handling for getcwdAndreas Kempf2019-12-271-2/+4
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Quoting from the Linux man page for errno, "The value in errno is significant only when the return value of the call indicated an error (i.e., -1 from most system calls; -1 or NULL from most library functions); a function that succeeds is allowed to change errno. The value of errno is never set to zero by any system call or library function." Successful calls to getcwd are allowed to set errno causing the compilation database not to be written. Spurious failures of this nature were observed on AIX. Adjust the error handling for getcwd so that errno is only checked if the call returned NULL.
| * compdb: Dump every rule without any arguments, fix #1377Jan Niklas Hasse2019-08-021-16/+28
| |
| * Improve const-correctness in compdb related methodsJan Niklas Hasse2019-08-021-1/+2
| |
* | Adding a way to clean dead build artifacts that have an entry in the build log,ikifof2019-05-251-3/+8
|/ | | | | | | | | | | | but are no longer produced by the current manifest. For now adding a dedicated "-t cleandead" option, since it should be run after reading the log; ideally it should be part of the build config and done before to start looking for dirty targets so that an incremental build would produce the same end result as a clean build from scratch. But since I am not 100% sure to understand the comment in the NinjaMain::isPathDead(), I opted to make it a tool for now to avoid impacting users who want to keep those files. The option name "cleandead" was selected insteadof something like "reap" to keep the "clean" prefix.
* Resurrect the 'rules' tool.Nicolas Despres2019-05-091-0/+52
| | | | | | | | | This tool is useful for writing shell completion script for tools expecting a rule name as argument. The tool was dropped by 34b46f28c. Fix #1024.
* query: load dyndep files for queried edgesBrad King2019-04-181-0/+7
|
* graph: load dyndep filesBrad King2019-04-181-1/+1
| | | | | | Teach the `-t graph` tool to load dyndep files because they are part of the build graph. Issue a warning when the dyndep file cannot be loaded cleanly. This will help users visualize the complete build graph.
* clean: remove unnecessary Cleaner constructor variantBrad King2019-04-181-1/+1
| | | | | | | | `Cleaner` provides two constructors that are the same except that one constructs a "real" disk interface internally and the other takes a caller-provided disk interface. A real disk interface is already available at the only call site for the former constructor. Use it directly and drop the unnecessary constructor variant.
* Restore depfile toleration of multiple output paths on distinct linesBrad King2018-11-191-1/+18
| | | | | | | | | | | | | | | | Prior to introduction of depfile parser handling of multiple rules, ninja silently accepted a depfile of the form: out: in1 in2 in3 other: otherIn1 otherIn2 otherIn3 and incorrectly treated `other` and `otherIn*` as additional inputs to `out`. Now we prefer to reject this just as we already do for a depfile specifying multiple outputs on one line. However, this can break existing cases where such a depfile was silently tolerated. Add a `-w depfilemulti={err,warn}` option to control this behavior, and make it just a warning by default.
* Fit --help output into 80 columns and move verbose up, fix #1500Jan Niklas Hasse2018-11-161-3/+3
|
* Explain why there's no browse tool, fix #1478Jan Niklas Hasse2018-11-141-3/+6
|
* Make -j 0 run unlimited parallel builds, fix #1309Martell Malone2018-11-141-3/+6
|
* Add --verbose as an alternative spelling for -v, fix #1310Jan Niklas Hasse2018-11-131-1/+2
|
* Misc typo fixes by https://github.com/codespell-project/codespell/Mo Zhou2018-09-061-1/+1
|
* make `-w dupbuild` default to `err`Nico Weber2018-04-051-0/+1
| | | | | | | | | You can still opt out of this by passing `-w dupbuild=warn`. But if you're getting this diagnostic, your build files are incorrect and you should ideally just fix them. This is step 3 on https://github.com/ninja-build/ninja/issues/931 I sent an RfC to ninja-build a few months ago; nobody objected.
* [compdb] Move declarations closer to their use.Asanka Herath2018-04-051-3/+3
|
* [compdb] Expand response files inline based on a switch.Asanka Herath2018-04-051-2/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | References to response files in a clang compile_commands.json file can be tricky to deal with when tooling expects all the command flags to be present in the 'command' field. This change introduces a '-x' option to '-t compdb' that will expand @rspfile style response file invocations inline. E.g. ```sh $ ninja -t compdb cc [ { "directory": "/src/foo", "command": "cc -foo -bar @foo.obj.rsp", "file": "foo.cc" } ] $ ninja -t compdb -x cc [ { "directory": "/src/foo", "command": "cc -foo -bar foo.cc", "file": "foo.cc" } ] ```
* Merge pull request #1386 from jmgao/exitNico Weber2018-04-051-14/+16
|\ | | | | Don't clean up after ourselves when exiting.
| * Don't clean up after ourselves when exiting.Josh Gao2018-02-191-14/+16
| | | | | | | | | | | | Destruction of NinjaMain can be an expensive operation when dealing with stupidly large ninjafiles. exit directly instead of returning out of real_main to avoid doing so.
* | Merge pull request #1373 from BillyDonahue/help_k_zeroNico Weber2018-04-051-1/+1
|\ \ | | | | | | Update Usage to show "-k 0" behavior
| * | Update Usage to show "-k 0" behaviorBilly Donahue2018-01-121-1/+1
| |/ | | | | For "-k N", N==0 is interpreted as infinite. It's useful but not documented in the help, unfortunately.
* | Add 'output' field to compdb outputScott Graham2018-02-071-0/+2
|/
* Merge pull request #1219 from QuLogic/resolutionNico Weber2017-10-201-1/+1
|\ | | | | Use high-resolution timestamps
| * Make TimeStamp 64-bit.Elliott Sales de Andrade2017-09-161-1/+1
| | | | | | | | This prepares it for higher-resolution timestamps.
* | escape usage examplesRefael Ackermann2017-10-191-3/+3
|/
* Restore tolerance of self-referencing phony build statementsBrad King2017-09-081-2/+16
| | | | | | | | | | | | | | | | | | | | Since commit v1.8.0^2~3^2~1 (Teach RecomputeDirty to detect cycles in the build graph, 2015-11-13) we correctly reject self-referencing phony build statements like build a: phony a as cycles. Unfortunately this breaks support for CMake 2.8.12.x and 3.0.x because those versions incorrectly produce edges of this form (that we used to tolerate). In order to preserve compatibility with those CMake versions we need to restore tolerance of these edges. Add a special case to the manifest parser to filter out self-referencing inputs of phony edges of the form produced by those CMake versions. Warn by default, but add a `-w phonycycle={err,warn}` option to make it an error. Fixes: #1322
* Factor ManifestParser options into a structureBrad King2017-09-071-4/+5
| | | | | | This will allow more options to be added without updating everywhere that constructs a ManifestParser. Also extend the AssertParse function to take the options so tests can control them.
* Support restat when rebuilding manifestDan Willemsen2017-02-081-4/+13
| | | | | | | | As a fix for #874, we started reloading the entire manifest even if the manifest was never rebuilt due to a restat rule. But this can be slow, so call State::Reset instead, which also fixes the original crash. Fixes #987
* Merge pull request #1181 from DanielWeber/issue-1161Nico Weber2017-01-241-2/+2
|\ | | | | Allow more path components
| * Allow more path componentsDaniel Weber2016-08-221-2/+2
| | | | | | | | | | | | | | - 60 instead of 30 path components - 64 instead of 32 backslashes in a path (windows only) Issue: 1161
* | teach -t commands to optionally print only the final commandNico Weber2016-11-061-5/+35
|/
* Pass location of build.ninja file to browse scriptColin Cross2016-04-191-27/+27
| | | | | Pass the value of -f to the browse python script so it can be passed back to ninja -t query.
* browse: support --port and --no-browser optionsPeter Wu2016-03-111-5/+1
| | | | | | | Add --port option to override the default port (8000). Add --no-browser option to avoid opening a web browser (useful over SSH). Make the target name optional, using "all" if omitted.
* Fix ambiguous call to set_terminate on Windows platformg4m42016-02-171-1/+1
| | | | | | | On Windows set_terminate() could either be the standard C++ one or (actually the same one but in the global namespace) the CRT one declared in corecrt_terminate.h Hence this ambiguity - this patch solves it. Signed-off-by: g4m4 <misept.dieseneuf@gmail.com>
* Replace ManifestParser::FileReader with general FileReaderBrad King2016-02-031-10/+1
| | | | | | Avoid having two separate filesystem interfaces. Simplify test infrastructure by avoiding custom `ManifestParser::FileReader` implementations.
* Merge pull request #1096 from sgraham/dupe-edge-actionNico Weber2016-01-291-1/+3
|\ | | | | dupe_edge_should_err from bool to enum
| * dupe_edge_should_err from bool to enumScott Graham2016-01-271-1/+3
| |
* | Add -d keepdepfile to preserve depfilesShinichiro Hamaji2016-01-281-5/+10
|/ | | | | This is useful when you are developing a tool which generates GCC-style depfiles.
* Remove unnecessary `std::`Tetsuo Kiso2016-01-101-2/+2
|