summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| | * | | | 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
| * | | | Merge pull request #1983 from sgraham/masterJan Niklas Hasse2021-08-251-1/+1
| |\ \ \ \ | | | | | | | | | | | | win: Use cl /help to test for /FS requirement
| | * | | | win: Use cl /help to test for /FS requirementScott Graham2021-06-131-1/+1
| | | | | |
| * | | | | Merge pull request #2002 from randomascii/stats_optimizeJan Niklas Hasse2021-08-252-5/+0
| |\ \ \ \ \ | | | | | | | | | | | | | | Optimize ninja -d stats
| | * | | | | Optimize ninja -d statsBruce Dawson2021-07-262-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -d stats enables instrumented profiling of key functions in ninja. However, some of those functions are invoked 6+ million times in a NOP build of Chromium and the cost of measuring those functions dwarfs the cost of the functions. Here is typical -d stats output for a Chromium build: metric count avg (us) total (ms) .ninja parse 6580 4197.5 27619.5 canonicalize str 6240450 0.0 47.3 canonicalize path 6251390 0.0 33.5 lookup node 6339402 0.0 37.2 .ninja_log load 1 176226.0 176.2 .ninja_deps load 1 465407.0 465.4 node stat 168997 8.8 1482.9 depfile load 327 352.7 115.3 99% of the measurements are in three functions. The total measurement cost (per ETW sampled profiling) is 700-1200 ms, which is many times greater than the costs of the functions. With this change typical output looks like this: metric count avg (us) total (ms) .ninja parse 6580 3526.3 23203.2 .ninja_log load 1 227305.0 227.3 .ninja_deps load 1 485693.0 485.7 node stat 168997 9.6 1615.0 depfile load 327 383.1 125.3 This resolves issue #1998.
| * | | | | | Merge pull request #1347 from tzik/revdepJan Niklas Hasse2021-08-124-8/+54
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | Look up header dependencies on the first-output build
| | * | | | | | Look up header dependencies on the first-output buildtzik2017-10-254-8/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ninja has special syntax to specify the first output of the given node. E.g. it builds foo.o for foo.cc^. However, it doesn't work for headers, as headers usually doesn't appear in the regular dependency tree. After this change, Ninja looks up header dependencies from .ninja_deps to pick up a build target, so that it builds foo.o for foo.h^.
| * | | | | | | Merge pull request #1996 from digit-google/cleandead-preserves-inputsJan Niklas Hasse2021-07-292-1/+71
| |\ \ \ \ \ \ \ | | |_|/ / / / / | |/| | | | | | cleandead: Fix the logic to preserve inputs.
| | * | | | | | cleandead: Fix the logic to preserve inputs.David 'Digit' Turner2021-07-212-1/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the rare case when the build log contains an entry for a file path that used to be an output in a previous build, but was moved as an input in the new one, the cleandead tool would incorrectly consider the input file stale and remove it. This patch fixes the logic used in Cleaner::CleanDead to not remove any path that is an input in the build graph.
| * | | | | | | Merge pull request #1994 from afq984/1e408562-f801-4644-b703-46cd9c672400Jan Niklas Hasse2021-07-256-13/+128
| |\ \ \ \ \ \ \ | | |/ / / / / / | |/| | | | | | compdb: escape control characters in JSON strings
| | * | | | | | compdb: escape control characters in JSON stringsLi-Yu Yu2021-07-226-13/+128
| |/ / / / / /
| * | | | | | Merge pull request #1991 from zmodem/filter_filenames_lessNico Weber2021-06-282-1/+14
| |\ \ \ \ \ \ | | |_|/ / / / | |/| | | | | CLParser: Don't filter filename lines after seeing /showIncludes
| | * | | | | CLParser: Don't filter filename lines after seeing /showIncludesHans Wennborg2021-06-252-1/+14
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The /showIncludes output always comes after cl.exe echos the filename, so there is no need to filter out filename lines afterwards. This makes it less likely that CLParser will "over filter" the compiler output. For example, using the -H flag with clang-cl may lead to output lines ending in .cc, which are not supposed to be filtered out.
| * | | | | Merge pull request #1979 from bradking/simplify-CanonicalizePathJan Niklas Hasse2021-06-1013-151/+128
| |\ \ \ \ \ | | | | | | | | | | | | | | util: Remove unnecessary CanonicalizePath error handling
| | * | | | | util: Remove unnecessary CanonicalizePath error handlingBrad King2021-06-0413-151/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 86f606fe (Remove path component limit from input of CanonicalizePath in windows, 2017-08-30, v1.8.0^2~2^2), the only failure case in the `CanonicalizePath` implementation is the "empty path" error. All call sites have been updated to ensure `CanonicalizePath` is never called with an empty path. Remove error handling from the signature to simplify call sites.
| | * | | | | Add explicit "empty path" errors before calling CanonicalizePathBrad King2021-06-044-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update call sites that might have empty paths to explicitly check for them before calling CanonicalizePath. Note that the depfile parser ensures all parsed outs and deps are non-empty.
| * | | | | | Make output_test.py executable again (mistake thanks to WSL)Jan Niklas Hasse2021-06-101-0/+0
| | | | | | |
| * | | | | | Put Info output back on stdout instead of stderrJan Niklas Hasse2021-06-102-3/+8
| | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | See comment in #1899. Also adds two tests to output_test.py which check this behaviour by relying on Python's suprocess.check_output not piping stderr.
| * | | | | Merge pull request #1977 from mathstuf/cross-compilation-browseJan Niklas Hasse2021-06-041-5/+10
| |\ \ \ \ \ | | |/ / / / | |/| | | | cmake: use `check_symbol_exists` for browse support
| | * | | | cmake: use `check_symbol_exists` for browse supportBen Boeckel2021-06-021-5/+10
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | Just because `unistd.h` exists does not mean it has the APIs that are needed. This occurs when cross-compiling using Fedora's packaged MinGW toolchain.
| * | | | Merge pull request #1970 from lurch/patch-2Jan Niklas Hasse2021-05-181-4/+4
| |\ \ \ \ | | | | | | | | | | | | Attempt to fix Linux CI build
| | * | | | Attempt to fix Linux CI buildAndrew Scheller2021-05-161-4/+4
| |/ / / /
| * | | | Merge pull request #1968 from EliRibble/pull-1818Jan Niklas Hasse2021-05-084-4/+29
| |\ \ \ \ | | | | | | | | | | | | Add --quiet option that suppresses status updates. (rework pull 1818)
| | * | | | Add test for status suppression under '--quiet'.Eli Ribble2021-05-061-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | This just tests that the flag works.
| | * | | | Add jhasse's suggestion to suppress output on '--quiet'.Eli Ribble2021-05-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This just ensures that we also don't get the "Entering directory..." message when the new '--quiet' flag is added.
| | * | | | Update help description for --quietHenner Zeller2021-05-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Henner Zeller <h.zeller@acm.org>
| | * | | | Add --quiet option that suppresses status updates.Henner Zeller2021-05-063-3/+10
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | Refined pull request after discussion in #1816 Signed-off-by: Henner Zeller <h.zeller@acm.org>
| * | | | Avoid implicit cast LoadStatus -> boolJan Niklas Hasse2021-04-091-3/+2
| | | | |
| * | | | Fix misleading usage of return type of Open*LogJan Niklas Hasse2021-04-091-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | In an earlier version of 791c887e22046e5e7a2d05ecb5ff27701d56895d those functions returned LoadStatus, too, but it was changed back to bool.
| * | | | Merge pull request #1944 from EwoutH/patch-1Jan Niklas Hasse2021-03-291-1/+0
| |\ \ \ \ | | | | | | | | | | | | CI: macOS: Unfix Xcode version to use the latest stable one
| | * | | | CI: macOS: Unfix Xcode version to use the latest stable oneEwout ter Hoeven2021-03-281-1/+0
| |/ / / / | | | | | | | | | | Removes the selection of a fixed Xcode version added in 242b7dd which assured Xcode version 12.2 was used when the default was still 12.1. The GitHub default is now 12.4 and newer versions will be made the default a few weeks after the stable release. This commit ensures an up to date Xcode version is used in the CI.
| * | | | Merge pull request #1937 from bradking/dyndep-out-depfile-inJan Niklas Hasse2021-03-285-5/+86
| |\ \ \ \ | | | | | | | | | | | | dyndep: reconcile dyndep-specified outputs with depfile-specified inputs
| | * | | | dyndep: reconcile dyndep-specified outputs with depfile-specified inputsBrad King2021-03-244-5/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a path loaded from a depfile does not have a node, we create a new node with a phony edge producing it. If we later load a dyndep file that specifies the same node as an output of a known edge, we previously failed with a "multiple rules generate ..." error. Instead, since the conflicting edge was internally generated, replace the node's input edge with the now-known real edge that produces it.
| | * | | | dyndep: add dedicated test for dyndep-discovered implicit dependenciesBrad King2021-03-241-0/+31
| |/ / / / | | | | | | | | | | | | | | | Previously this was covered only as part of more complex tests.
| * | | | Merge pull request #1935 from jdrouhard/revert_input_mtimeJan Niklas Hasse2021-03-246-223/+257
| |\ \ \ \ | | | | | | | | | | | | Revert #1753 and add additional tests to expose previously untested behavior
| | * | | | Add some regression tests for additional test casesJohn Drouhard2021-03-241-0/+186
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These expose some behavior related to implicit deps unknown to ninja and timestamps with generating them as part of a rule. See discussions in #1932 and #1933.
| | * | | | Revert "Change build log to always log the most recent input mtime"John Drouhard2021-03-246-226/+74
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 67fbbeeec91ec171da7d4e297b8f9b319f3424c8. There were a few missing test cases exposed by CMake's test suite that need slight adjustments. Better to revert the original attempt, add the test cases, and then re-land the change with the fixes. Fixes #1932
| * | | | Remove `-w dupbuild` from error message and help outputJan Niklas Hasse2021-03-203-10/+7
| | | | | | | | | | | | | | | | | | | | This is step 4 on #931.
| * | | | Merge pull request #1753 from jdrouhard/log_input_mtimeJan Niklas Hasse2021-03-206-74/+226
| |\ \ \ \ | | | | | | | | | | | | Change build log to always log the most recent input mtime
| | * | | | Change build log to always log the most recent input mtimeJohn Drouhard2021-03-166-74/+226
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If an edge's output files' mtimes are compared to the most recent input's mtime, edges might be calculated as clean even if they are actually dirty. While an edge's command is running its rule to produce its outputs and an input to the edge is updated before the outputs are written to disk, then subsequent runs will think that the outputs are newer than the inputs, even though the inputs have actually been updated and may be different than what were used to produce those outputs. Ninja will now restat all inputs just prior to running an edge's command and remember the most recent input mtime. When the command completes, it will stat any discovered dependencies from dep files (if necessary), recalculate the most recent input mtime, and log it to the build log file. On subsequent runs, ninja will use this value to compare to the edge's most recent input's mtime to determine whether the outputs are dirty. This extends the methodology used by restat rules to work in all cases. Restat rules are still unique in that they will clean the edge's output nodes recursively if the edge's command did not change the output, but in all cases, the mtime recorded in the log file is now the most recent input mtime. See the new tests for more clarification.
| * | | | Merge pull request #1907 from aDotInTheVoid/patch-1Jan Niklas Hasse2021-03-051-2/+3
| |\ \ \ \ | | | | | | | | | | | | Clarify purpose for implicit dependencies
| | * | | | Clarify purpose for implicit dependenciesNixon Enraght-Moony2021-01-291-2/+3
| | | | | |
| * | | | | Merge pull request #1921 from bradking/windows-code-page-utf8Jan Niklas Hasse2021-03-042-10/+13
| |\ \ \ \ \ | | | | | | | | | | | | | | wincodepage: minimize to indicate UTF-8 or not
| | * | | | | wincodepage: minimize to indicate UTF-8 or notBrad King2021-03-012-10/+13
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ANSI code page identifier is more information than generator programs actually need. The encoding of `build.ninja` is always either UTF-8 or the system-wide ANSI code page. Reduce the output to provide no more information than the generator programs need. The Console code page can be obtained in other ways, so drop it.
| * | | | | Merge pull request #1918 from bradking/windows-code-pageJan Niklas Hasse2021-02-262-2/+31
| |\ \ \ \ \ | | | | | | | | | | | | | | Add tool to print code page information on Windows
| | * | | | | Add tool to print code page information on WindowsBrad King2021-02-262-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 00459e2b (Use UTF-8 on Windows 10 Version 1903, fix #1195, 2021-02-17), `ninja` does not always expect `build.ninja` to be encoded in the system's ANSI code page. The expected encoding now depends on how `ninja` is built and the version of Windows on which it is running. Add a `-t wincodepage` tool that generators can use to ask `ninja` what encoding it expects. Issue: #1195
| | * | | | | doc: fix format of 'missingdeps' documentationBrad King2021-02-261-2/+2
| |/ / / / / | | | | | | | | | | | | | | | | | | Group all the paragraphs together in the definition list entry.
| * | | | | Merge pull request #1916 from scivision/check_msgJan Niklas Hasse2021-02-231-0/+8
| |\ \ \ \ \ | | | | | | | | | | | | | | cmake: add browse check status
| | * | | | | cmake: add browse check statusMichael Hirsch2021-02-231-0/+8
| |/ / / / /
| * | | | | Merge pull request #1331 from ilor/missingdeps3Jan Niklas Hasse2021-02-239-5/+497
| |\ \ \ \ \ | | | | | | | | | | | | | | missingdeps tool, take 2