| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes #867, both the crashes and "[stuck]" issues.
The problem was that a duplicate edge would modify the in_edge of the
outputs of the new build rule, but the edge corresponding to the old
build rule would still think that the in_edge points to itself.
`old_edge->outputs_[0]->in_edge()` would not return `old_edge`, which
confused the scan logic.
As fix, let `State::AddOut()` reject changing in_edge if it's already
set. This changes behavior in a minor way: Previously, if there were
multiple edges for a single output, the last edge would be kept. Now,
the first edge is kept. This only had mostly-well-defined semantics if
all duplicate edges are the same (which is the only case I've seen in
practice), and for that case the behavior doesn't change.
For testing, add a VerifyGraph() function and call that every time any
test graph is parsed. That's a bit more code than just copying the test
cases from the bug into build_test.cc, but it also yields better test
coverage overall.
|
|\
| |
| | |
subprocess_test: gracefully handle rlim.rlim_cur < kNumProcs
|
| |
| |
| |
| |
| |
| | |
Instead of expecting that the number of open files is well above
kNumProcs, simply "skip" the test in that case, still printing the
message about the test limit (adding the current system limit too).
|
|\ \
| | |
| | | |
POSIX: detach background subprocesses from terminal.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Put background subprocesses (i.e. subprocesses with no access
to the console) in their own session and detach them from the
terminal.
This fixes martine/ninja#909.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
It failed with
error: field has incomplete type 'EvalString'
note: in instantiation of exception specification for 'map' requested here
explicit Rule(const string& name) : name_(name) {}
^
|
|\ \ \
| | | |
| | | | |
Allow scoping rules through subninja
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The new test shows the added value of scoped rules by demonstrating
a multi-level build where a single rules file gets included at all
the levels. By scoping rules, this is possible.
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|/ /
| |
| |
| | |
will prevent useless conversions.
|
| | |
|
|/
|
|
|
|
|
|
|
| |
Ninja generators that bootstrap themselves with Ninja may need
to rebuild build.ninja multiple times. Replace the 2 cycle loop
with a 100 cycle loop, and print the pass number each time it
restarts.
Original-author: Jamie Gennis <jgennis@gmail.com>
|
|\
| |
| | |
Check pending SIGINT after ppoll/pselect
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
ppoll/pselect prioritizes file descriptor events over
a signal delivery. So a flood of events prevents ninja
from reacting keyboard interruption by the user.
This CL adds a check for pending keyboard interruptions after
file descriptor events.
|
| |
| |
| |
| |
| |
| | |
The assert fires on cyclic manifests (found by afl-fuzz). Since there
was explicit error handing for this case already, just remove the
assert.
|
|\ \
| |/
|/| |
Cleanup: Fix 'hasIdent' variable name/style.
|
| |
| |
| |
| |
| |
| |
| | |
Seems more correct to name it has_indent_token and to use the
unix_hacker style.
Signed-off-by: Thiago Farina <tfarina@chromium.org>
|
| | |
|
| |
| |
| |
| |
| | |
ExternalStringHashMap used to store std::strings long ago. Since it
doesn't anymore, this specialization isn't needed. No behavior change.
|
|/ |
|
|
|
|
|
|
|
|
|
|
| |
Recompacting the build log used to be slow, so it made sense to print this
message. We then made recompaction much faster, but didn't remove this
message back then.
The deps log only has it because the build log had it.
Since both steps are effectively instant in practice, remove these log messages.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
RecomputDirty(edge) currently works roughly like this:
RecomputeDirty(edge):
LoadDeps(edge)
for in in edge.inputs:
if in.StatIfNecessary():
RecomputeDirty(in.in_edge) # recurse into inputs
for out in edge.outputs:
out.StatIfNecessary() # mark outputs as visited
It uses the stat state of each node to mark nodes as visited and doesn't
traverse across nodes that have been visited already. For cyclic graphs
with an edge with multiple outputs on the cycle, nothing prevents an
edge to be visited more than once if the cycle is entered through an
output that isn't on the cycle. In other words, RecomputeDirty() for
the same edge can be on the call stack more than once. This is bad for
at least two reasons:
1. Deps are added multiple times, making the graph confusing to reason
about.
2. LoadDeps() will insert into the inputs_ of an edge that's iterated
over in a callframe higher up. This can invalidate the iterator,
which causes a crash when the callframe with the loop over the
now-invalidated iterator resumes.
To fix this, let RecomputeDirty() mark all outputs of an edge as visited
as the first thing it does. This way, even if the edge is on a cycle
with several outputs, each output is already marked and no edge will
have its deps loaded more than once.
Fixes the crashes in #875. (In practice, it turns the crashes into
"stuck [this is a bug]" messages for now, due to the example without
duplicate rules in #867)
|
|
|
|
|
|
|
|
|
| |
It confused me that the iterator iterating over `outputs_` was called
`i` -- this always made me think of "input", not "iterator".
Call iterators over edge outputs "o", iterators over edge inputs "i",
iterators over node input edges "oe", and general iterators over edges
"e".
|
| |
|
|\
| |
| | |
Fixed cygwin compatibility (issue #806)
|
| |
| |
| |
| | |
Fixed platform specific issues causing cygwin build to fail.
|
| |
| |
| |
| |
| | |
All other counting variables are called foo_count, not num_foos.
No behavior change.
|
| |
| |
| |
| |
| |
| |
| |
| | |
No test since there's still no good way to test code in ninja.cc. Going
forward, either move NinjaMain to its own file with tests, or create a
system that makes it possible to run integration tests on the ninja
binary. Instead, add a comment that explains why the restat
optimization isn't done.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The original overprinting code, added in 7b3d8c8e, used printf for printing
the status. printf needs one column for the cursor, so the status message
could only take up `width - 1` columns. fc554c22 changed Windows from printf
to WriteConsoleOutput which doesn't move the cursor, so keeping one column
empty is no longer needed. So stop doing that.
Also remove a duplicate call to GetConsoleScreenBufferInfo.
|
| |
| |
| |
| | |
No behavior change. Based on a patch from gmisocpp@gmail.com!
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In cmd.exe, hitting the "Pause" key or Ctrl-S will pause
programs until a key is pressed. This is apparently
implemented when stdout is writing to, so use printf
instead of Console functions to reset the cursor to
the start of the line. Also happens to simplify the code.
(This already worked in -v mode since that already
prints using printf.)
Based on a patch from gmisocpp@gmail.com!
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
No behavior change on most platforms. On solaris, -t browse was compiled in
in ninja.cc but browse.cc wasn't compiled in, which probably means that building
on Solaris didn't work. It might be better now.
This also makes browse.cc automatically not included in bootstrap builds;
previously this was done manually through the NINJA_BOOTSTRAP check.
|
|\ \
| | |
| | | |
whitespace/comment/wrap fixes, no intended functionality change
|
| | | |
|
|/ / |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|