| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Add a flag to temporarily suppress error output.
Fixes issue #281.
|
| |
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Signed-off-by: Thiago Farina <tfarina@chromium.org>
|
|
|
|
|
|
|
| |
The StatBadPath test expects both Windows and Linux to reject a
path name with 512 characters. However, it seems that such path
is actually acceptable to Windows 7. The change constructs a
different path name that is invalid on Windows.
|
|
|
|
|
|
|
|
| |
Some people like to construct phony target names by appending a
"/something" suffix to an existing target "foo". But if "foo" is an
existing file, stat will report ENOTDIR for this path, causing ninja
to spew errors. Fix this by treating ENOTDIR in the same way as we
do ENOENT -- as a non-existent path.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
From Frances <frances.buontempo@gmail.com>.
|
|
|
|
|
|
|
|
|
| |
From a Hacker News comment:
"Recent finding, that sped up our systems from 15->3sec on 300,000+ files
filestamp check was to move from _stat to GetFileAttributesEx."
I do recall reading that calls to stat() on Windows were one of the
potential reasons Subversion is so slow on Windows...
|
| |
|
| |
|
|
|
|
|
|
| |
The two were always one-to-one anyway. I started adding accessors
to FileStat and then realized most users wanted them on Node and
that forwarding them through was silly.
|
|
|
|
| |
It was firing too often, and hadn't uncovered any bugs.
|
| |
|
|
|
|
| |
Signed-off-by: Thiago Farina <tfarina@chromium.org>
|
|
|
|
|
|
| |
disk_interface_test.cc
Signed-off-by: Thiago Farina <tfarina@chromium.org>
|
|
TEST=ninja_test --gtest_filter=DiskInterface*
Signed-off-by: Thiago Farina <tfarina@chromium.org>
|