| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.)
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Fixes #417.
|
|
|
|
| |
This is a prerequisite for fixing #417.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ninja currently uses googletest for testing. That makes building
ninja_test somewhat annoying since it requires that one passes
--with-gtest PATH to configure. It turns out just implementing the bits
of googletest that ninja uses needs about the same amount of code than
making the --with-gtest flag in configure.py work and making googletest
print test results in a way we want (!)
In addition to making configuration simpler, this also makes compiling
tests much faster: On my system, touching src/build_test.cc (the slowest
file to build in ninja) and rebuilding ninja_tests is twice as fast than
without this patch. Building all is noticeably faster too: 5.6s with
this patch, 9.1s without this patch (38% faster).
The most noticeable things missing: EXPECT_* and ASSERT_* don't support
streaming notes to them with operator<<, and for failing tests the lhs
and rhs are not printed. That's so that this header does not have to
include sstream, which slows down building ninja_test almost 20%.
If this turns out to be annoying, we can maybe add it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
| |
When a single output of an edge is dirty, the restat check should
leave all outputs of that edge dirty.
|
|
|
|
|
|
| |
Removing the `CreatePhonyInEdge(node);` line in
`ImplicitDepLoader::LoadDepsFromLog()` made no tests fail before this change.
The new test is a port to depsmode of the existing DepFileOK test.
|
|
|
|
| |
No functionality change. Related to issue #590.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
in deps mode.
`ImplicitDepLoader::LoadDepFile()` already adds a depfile edge from every file
mentioned in a depfile to the depfile's output.
`ImplicitDepLoader::LoadDepsFromLog()` didn't do this yet, so add it. Else,
if a restat rule clears a generated .h file, this wouldn't propagate to cc files
depending on that .h file through a depfile.
Fixues issue #590.
|
|
|
|
|
|
|
| |
At any phase in the test where multiple edges are ready
simultaneously, acquire all edges and sort them into a predictable
order. This allows the test to execute deterministically regardless
of the order of edge allocation.
|
|
|
|
|
|
|
| |
deps_log() is NULL during dry runs, so this fixes a crash. It also
matches ninja 1.2.0's behavior as far as I can tell.
Fixes issue #551.
|
|\
| |
| | |
try again on vs2012 build fixes
|
| | |
|
|/
|
|
|
| |
I intentionally changed the semantics of the code that affected this
test, but didn't update the test. Oops.
|
|
|
|
|
|
| |
The first test I wrote was wrong; write a simpler test that exercises
the "no failures" code paths, then fix the second test and the bugs it
exposed.
|
|
|
|
|
|
|
|
|
|
|
|
| |
When I first played with depslog, I accidentally removed the depfile attribute
on my cc edges, which had the effect of ninja silently ignoring all depfiles.
Instead, let ninja complain about edges that have deps set to gcc and depfile
set to nothing.
This is done at edge build time, instead of at mainfest load time, because
adding this check to ParseEdge() regressed empty build time for target 'chrome'
by 30ms. The check is only useful for generator authors, regular users should
never see this.
|
|
|
|
| |
It touched the various remaining XXXes in the code, hooray.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
WaitForCommand now passes all command output via a struct.
This will allow adding more output in a future change.
|
|
|
|
| |
Separating concerns to make a subsequent refactoring easier.
|
|
|
|
| |
It's the only piece that cares about the current time.
|
| |
|
| |
|
| |
|
|
|
|
| |
This reverts commit 9b196dc806e57cefd88bbbacd12286447dbf9ad9.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
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.)
|