| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
RecomputeDirty is the earliest traversal of the build graph complete
with depfile-loaded dependencies. Teach it to detect cycles and fail
immediately. This avoids the need to tolerate cycles in RecomputeDirty
only to diagnose them later. It also enables future simplification of
Plan and Builder logic because they will be able to assume DAG input.
When RecomputeDirty detects a cycle, reject it with an error message
like that previously produced by Plan::CheckDependencyCycle.
Previously we used the stat state of each node to determine whether
we reached it earlier in the walk. Retain this approach for leaf
nodes, but add an explicit walk state mark for each Edge so that
we can have a temporary mark to aid cycle detection.
|
|
|
|
| |
Store a mark in each `Edge` to be updated as it is encountered by a walk.
|
|
|
|
|
|
| |
All call sites have a node on which they call `in_edge()` to call
RecomputeDirty. Simplify call sites by taking the node directly and
calling `in_edge()` internally.
|
|
|
|
| |
The VS compiler complained about possible loss of data (and it was right!)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some build rules produce outputs that are not mentioned on the command
line but that should be part of the build graph. Such outputs should
not be named in the `$out` variable. Extend the build statement syntax
to support specification of implicit outputs using the syntax
`| out1 out2` after the explicit outputs and before the `:`.
For example, compilation of a Fortran source file `foo.f90` that defines
`MODULE FOO` may now be specified as:
rule fc
command = f95 -c $in -o $out
build foo.o | foo.mod: fc foo.f90
The `foo.mod` file is an implicit output generated by the compiler based
on the content of the source file and not mentioned on the command line.
|
| |
|
|
|
|
|
|
| |
In commit v1.1.0^2~15^2~20 (stub out an api and de-constify Pool,
2012-10-03) the Edge "pool_" member was added as a raw pointer but the
initializer was accidentally left out of the constructor. Add it now.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes #830, fixes #904.
In practice, this either happens with 64-bit inodes and a 32-bit
userspace when building without -D_FILE_OFFSET_BITS=64 in CFLAGS, or
when a filename is longer than the system file length limit.
Since DiskInterface::Stat() returns -1 on error, and Node used -1 on
"stat state unknown", not aborting the build lead to ninja stat()ing the
same file over and over again, until it finally ran out of stack. That's
now fixed.
* Change RecomputeOutputsDirty() to return success instead of dirty
state (like RecomputeDirty()) and return the dirty state in a bool
outparam
* Node::Stat()s old return value wasn't used anywhere, change the
function to return success instead and add an |err| outparam
* Node::StatIfNecessary()'s old return value was used only in one place.
Change that place to explicitly check status_known() and make
StatIfNecessary() return success and add an |err| outparam
* Plan::CleanNode() can now fail, make it return bool and add an |err|
outparam
|
|
|
|
|
|
|
|
| |
Ninja didn't support scoping rules through subninja and assumed
a unique rule name in the whole namespace. With this change, this
behavior is changed to allow scoping rules. Two rules can have the
same name if they belong to two different scopes. However, two
rules can NOT have the same name in the same scope.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes #730. This has always been broken, but due to #690 more paths are now
escaped (e.g. paths containing + characters, like file.c++). Also see
discussion in #689.
The approach is to give EdgeEnv an enum deciding on whether or not to escape
file names, and provide functions that evaluate depfile and rspfile with that
set that to kNoEscape. (depfile=$out.d doesn't make sense on edges with
multiple outputs.)
This should be relatively safe, as $in and $out can't be used on edges, only
on rules (#687).
|
|
|
|
|
|
|
| |
This is a pre-defined pool with a depth of 1. It has the special property
that any task in the pool has direct access to the console. This can be
useful for interactive tasks or long-running tasks which produce status
updates on the console (such as test suites).
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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()).
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
The idea here is that it's possible for a build to complete (writing
its output) but then for Ninja to get interrupted before writing out
the updated dependency information. In that case the mtime stored in
the deps log (if any) will match the previous output, and we'll know
we need to rebuild the output just to get the deps updated.
|
| |
|
| |
|
| |
|
|
|
|
| |
WIP
|
| |
|
|
|
|
|
| |
DepsLog is a compact serialization of dependency information.
It can be used to replace depfiles for faster loading.
|
|
|
|
|
| |
Now, a 'build' block can override any special binding like 'command'
or 'description' if it needs to.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
This was temporarily added, and now it can be removed.
|
| |
|
|
|
|
|
|
|
| |
The build log is needed in computing whether an edge is
dirty, so I think it belongs here. (It's a bit weird
that Builder needs to reach into it to record completed
commands, maybe it will become cleaner with more thought.)
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Rather than passing States and DiskInterfaces through all the calls,
put the necessary ambient information in a new DependencyScan object
and move the code accordingly.
Note: I didn't move the source location of the functions to preserve
history, though this does result in a sort of weird order for the
functions in graph.cc.
|
| |
|
|
|
|
|
|
|
| |
- Edge::Dump could crash if called while inputs_ is being extended
- Node::Dump prints Node attributes, in-edge and lists of out-edges
- Dump functions now accept "prefix" parameter, printed along with the object
for easier orientation. For example, edge->Dump("Re-reading deps files").
|
|
|
|
|
|
|
|
| |
This was reported by cpplint as:
python ~/depot_tools/cpplint.py 2>&1 | grep -v "Done processing" | grep explicit
Signed-off-by: Thiago Farina <tfarina@chromium.org>
|
| |
|
| |
|
|\
| |
| | |
Response files
|
| | |
|
| | |
|
|/
|
|
| |
Signed-off-by: Thiago Farina <tfarina@chromium.org>
|
| |
|
|
|
|
| |
Reported by clang++.
|
|
|
|
|
|
|
|
|
| |
- Delete the old "Tokenizer" code.
- Write separate tests for the lexer distinct from the parser.
- Switch the parser to use the new code.
- New lexer error output has file:line numbers so e.g. Emacs can
jump your editor to the syntax error.
- The EvalEnv ($-interpolation) code is now part of the lexer as well.
|
|
|
|
| |
Signed-off-by: Thiago Farina <tfarina@chromium.org>
|
|
|
|
|
|
| |
Move various data members to private section and provide accessors for them.
Signed-off-by: Thiago Farina <tfarina@chromium.org>
|