| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|\ |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* 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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| | |
|
| |\
| | |
| | | |
Support cpu limit in docker
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
AddTarget cannot add edges to the ready queue before the critical time
has been computed.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
|\ \ \
| |/ / |
|
| |\ \
| | | |
| | | | |
Fix ReadFile() handle leak on read error on Windows.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| |\ \
| | | |
| | | | |
Add 'inputs' tool to print out all inputs for a set of targets
|
| | | | |
|
| |\ \ \
| | | | |
| | | | | |
Filter lines ending with ".c++" in clparser
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Projects like cap n proto uses c++ extensions and generates a lot of
status noise when running ninja.
|
| |\ \ \ \
| | |/ / /
| |/| | | |
Suggest possible cause for hitting cycle limit
|
| | | | | |
|
| |\ \ \ \
| | | | | |
| | | | | | |
disk_interface: Improve the stat cache handling for case sensitive folders on Windows
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
One in ninja_test usage text, the other in a unit test comment.
|
| |\ \ \ \ \
| | |_|/ / /
| |/| | | | |
Add validation nodes to ninja
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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
|
| | | |_|/
| | |/| |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
| | | | | |
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
% [`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
```
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| |\ \ \
| | | | |
| | | | | |
Set output mtime of phony edges to the latest inputs
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
1. Move EdgePriorityQueue to graph.h and inherit from priority_queue
2. Add comment about edge->critical_time()
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|