| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Fixes main complaint of #1886.
|
|
|
|
| |
header files
|
|
|
|
|
| |
Found with readability-redundant-string-cstr
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Prior to introduction of depfile parser handling of multiple rules,
ninja silently accepted a depfile of the form:
out: in1 in2 in3
other: otherIn1 otherIn2 otherIn3
and incorrectly treated `other` and `otherIn*` as additional inputs to
`out`. Now we prefer to reject this just as we already do for a depfile
specifying multiple outputs on one line. However, this can break
existing cases where such a depfile was silently tolerated.
Add a `-w depfilemulti={err,warn}` option to control this behavior,
and make it just a warning by default.
|
| |
|
|
|
|
|
| |
This reverts commit 6c864097ef11da366fb4070e6ab9f34d6a293766
and fixes the broken Appveyor builds on GitHub.
|
|
|
|
|
|
| |
Make sure that stat on Windows, both with and without cache, returns
"missing file" when running stat on notadir/foo where notadir is a
file.
|
|
|
|
|
| |
subdir/subsubdir/.. seems to get the time of subdir/subsubdir on NTFS
(Windows 7), not the time of subdir.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Return a status so callers can distinguish a missing file from an empty
file. This allows our VirtualFileSystem test infrastructure to report
as missing any file for which it has no entry.
|
|
|
|
|
|
|
|
|
| |
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>
|