| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|\
| |
| | |
Fix pool use count going unbalanced
|
| | |
|
| | |
|
| | |
|
| | |
|
|\ \
| |/
|/| |
Handle SIGTERM properly.
|
| | |
|
|/
|
|
|
| |
Default signal sent by many other programs (mainly kill(1)) to gently
terminates another one is SIGTERM.
|
|\
| |
| | |
Run more than 34 processes on Win32 if we have 32+ cores.
|
|/
|
|
|
|
|
|
| |
For compatiblity reason, dwNumberOfProcessors in Win32 is capped at 32.
So even if your machine has more than 32 cores, Ninja spawns at most 34
subprocesses. This patch fixes the issue by using GetNativeSystemInfo,
which returns the system info from Wow64 point of view, instead of
GetSystemInfo.
|
|\
| |
| | |
Fix an assert (and tests in --debug mode) after #921.
|
| | |
|
|\ \
| |/
|/| |
Fix backslashes in graphviz causing incorrect rendering on windows.
|
|/ |
|
|\
| |
| | |
Don't get stuck on cyclic graphs where one edge has multiple outputs.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes #934. Plan::AddSubTarget() tracks in want_ if each edge has been
visited and visits every edge only once. But Plan::CheckDependencyCycle()
worked on nodes however, so if a cycle was entered through an edge with
multiple outputs, ninja would fail to detect that cycle.
Move cycle detection to look for duplicate edges instead of nodes to fix
this. The extra jump makes CheckDependencyCycle() a bit slower: for a
synthetic build file with 10000 serial build steps, `ninja -n` now takes
0.32s instead of 0.26s before on my laptop. In practice, projects have
a dependency change length on the order of 50, so there shouldn't be a
noticeable slowdown in practice. (If this does end up being a problem:
CheckDependencyCycle() currently does O(n) work and is called O(m) times
from AddSubTarget(), so I think cycle checking is O(n^2) in the build
depth. So instead of worrying about constant overhead, we could use
a set<> instead of a stack<>. But it doesn't seem to be a problem in
practice.)
|
|\
| |
| | |
Simplify Plan's cycle detection code. No behavior change.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The common case is that there is no cycle. In that case,
CheckDependencyCycle() searched the stack for a dupe from the back,
wouldn't find one, and return false.
If there was a cycle, it would then search again from the front
(probably because the push_back() that used to be here would invalidate
the ri iterator).
Since the push_back() is gone, just search from the front once. No
intended behavior change.
|
| | |
|
|/ |
|
|\
| |
| | |
Let Stat() have an err outparam instead of writing to stderr.
|
|/
|
|
|
|
|
|
|
| |
Also check for Stat() failure in a few more places.
This way, ninja doesn't print two "ninja: error: " lines if stat() fails
during a build. It also makes it easier to keep the stat tests quiet.
Every caller of Stat() needs to explicitly log the error string if
that's desired.
|
|\
| |
| | |
make notes on how to update docs more detailed
|
|/ |
|
|\
| |
| | |
Add an opt-in flag to make duplicate edges an error (`-w dupbuild=err`).
|
| |
| |
| |
| |
| | |
This is step 1 on #931. Duplicated edges will become an error by default in
the future.
|
|/ |
|
|\
| |
| | |
Make tests quiet again, and prepare for making duplicate build edges an error.
|
| | |
|
|/
|
|
|
|
|
|
| |
This will make it easier to optionally make this an error (because
ManifestParser has a way of printing errors), and it'll also make
it easier to make the tests quiet again.
No behavior change.
|
|\
| |
| | |
Don't crash on cyclic references between rule bindings.
|
| | |
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes #902.
This dynamically detects cycles. I like this approach less than
detecting them statically when parsing rules [1], but it has the
advantage that it doesn't break existing ninja manifest files.
It has the disadvantage that it slows down manifest_parser_perftest by
3.9%.
1: https://github.com/martine/ninja/commit/cc6f54d6d436047
|
|\
| |
| | |
Another crash fix for duplicate edges. Fixes #939.
|
|/
|
|
|
|
|
|
|
|
|
| |
Patch #933 fixed a crash with duplicate edges by not adding edges to the
graph if all the edge's outputs are already built by other edges.
However, it added the edge to the out_edges of the edge's input nodes
before deleting it, letting inputs refer to dead edges.
To fix, move the check for deleting an edge above the code that adds
inputs. Expand VerifyGraph() to check that nodes don't refer to edges
that aren't present in the state.
|
|\
| |
| | |
Add notes on using afl-fuzz to HACKING.
|
|/ |
|
|\
| |
| | |
Make failing stat() calls abort the build.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|\ \
| |/
| | |
Minor cleanups. No behavior change.
|
| | |
|
|/ |
|
|\
| |
| | |
On unexpected output in a .d file, rebuild instead erroring.
|
| |
| |
| |
| | |
Fixes #417.
|
| |
| |
| |
| | |
This is a prerequisite for fixing #417.
|
|\ \
| | |
| | | |
Build self-consistent graphs for dupe edges with multiple outputs.
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\ \
| |/
|/| |
Remove option no longer needed now that we don't use gtest.
|
|/ |
|