| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
Detect build graph cycles as early as possible
|
| |
| |
| |
| |
| | |
We now detect and reject cycles in DependencyScan::RecomputeDirty before
Plan::AddTarget is called so we can assume DAG input to the Plan.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
RecomputeDirty is the earliest traversal of the build graph complete
with depfile-loaded dependencies. Teach it to detect cycles and fail
immediately. This avoids the need to tolerate cycles in RecomputeDirty
only to diagnose them later. It also enables future simplification of
Plan and Builder logic because they will be able to assume DAG input.
When RecomputeDirty detects a cycle, reject it with an error message
like that previously produced by Plan::CheckDependencyCycle.
Previously we used the stat state of each node to determine whether
we reached it earlier in the walk. Retain this approach for leaf
nodes, but add an explicit walk state mark for each Edge so that
we can have a temporary mark to aid cycle detection.
|
| |
| |
| |
| | |
Store a mark in each `Edge` to be updated as it is encountered by a walk.
|
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| | |
Remove a dependency cycle from the test case, as cycles are covered by
other tests. Ensure this case covers stat failure on a valid graph.
|
|/ |
|
|
|
|
|
|
|
|
| |
PR #1281 added a deference of most_recent_input without checking
for NULL, which can occur if a build rule has no inputs.
Check it for null before dereferencing, and add a test.
Fixes #1290.
|
|\
| |
| | |
Write subprocess output to stdout in binary mode
|
| |
| |
| |
| |
| |
| |
| |
| | |
Set stdout to binary mode while writing subprocess output, so that the
CR in a CR LF sequence is not replaced with CR LF itself, which would
result in CR CR LF.
Based on patch posted by nico in issue #773 comment.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
https://groups.google.com/forum/#!msg/ninja-build/YQuGNrECI-4/ti-lAs9SPv8J
discusses a case where an rule updates its output file and then
fails. The next run of ninja considers the ouptut file clean
and doesn't rebuild it. Always stat output files after they are
built, and write the mtime into .ninja_log. Consider output files
dirty if the recorded mtime is older than the most recent input
file.
|
| |
| |
| |
| |
| |
| |
| |
| | |
https://groups.google.com/forum/#!msg/ninja-build/YQuGNrECI-4/ti-lAs9SPv8J
discusses a case where an rule updates its output file and then
fails. The next run of ninja considers the ouptut file clean
and doesn't rebuild it. Add a test for this case, which currently
fails.
|
| |
| |
| |
| |
| |
| |
| | |
Stat is not always used through Node::Stat, it is often used directly
through DiskInterface. THe next patches will cause it to be called
even more often through DiskInterface, so move the metrics to
DiskInterface.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This patch improves perfromance of clparser.
* Reduce the number of calling GetFullPathName.
* Use StringPiece for Split and Join.
* Add EqualsCaseInsensitive for StringPiece not to generate new string
instance.
* Add some utility member in StringPiece class.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Following functions are implemented for further performance
optimization.
* JoinStringPiece
* SplitStringPiece
* EqualsCaseInsensitiveASCII
* ToLowerASCII
To improve performance of CLParser, I will introduce above functions
into include_normalize-win32.cc.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously the browse server would bind to "", which is translated to
0.0.0.0 (all interfaces), and then the hostname as retrieved by
socket.gethostname() was presented to the user.
The hostname is now "localhost" by default and is configurable, so the
original behavior is achieved with `ninja -t browse -a ""`.
|
|\ \
| | |
| | | |
Fix compilation error in canon_perftest.
|
| | |
| | |
| | |
| | | |
Introduced by 1cc730ddc27df52.
|
|/ /
| |
| |
| |
| |
| |
| |
| | |
As a fix for #874, we started reloading the entire manifest even if the
manifest was never rebuilt due to a restat rule. But this can be slow,
so call State::Reset instead, which also fixes the original crash.
Fixes #987
|
|\ \
| | |
| | | |
Allow more path components
|
| | |
| | |
| | |
| | | |
The VS compiler complained about possible loss of data (and it was right!)
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- 60 instead of 30 path components
- 64 instead of 32 backslashes in a path (windows only)
Issue: 1161
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Non-console subprocesses have the write end of a pipe connected to fds
1 and 2 for stdout and stderr, but they also have the it connected to
whatever fd was assigned in the ninja process when the pipe was
created. Add a call to posix_spawn_file_actions_addclose after
the posix_spawn_file_actions_adddup2 calls to close the original fd
once it has been dup'd to stdout and stderr.
This fixes an issue seen in the Android build, where one of the
subprocesses is used to start a background helper process. The
background process attempts to close any inherited fds, but if ninja
used a very large fd number due to a high parallelism count the
background process would not close the fd and ninja would never
consider the subprocess finished.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Resolves #985
This is based on musl implementation,
http://git.musl-libc.org/cgit/musl/commit/?id=20cbd607759038dca57f84ef7e7b5d44a3088574
(thanks to jbergstroem@ for reference)
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The recommended replacement VerifyVersionInfo should work with the same
SDKs that GetVersionEx worked with (while the wrappers in
VersionHelpers.h require a recent SDK). This patch should not change
behavior, and it's not supposed to increase build requirements. If
this makes things harder to build, please let me know.
|
|\ \ \
| | | |
| | | | |
fix a clang-cl -Wformat warning
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Improve error message when a depfile contains a bad path
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Debugging "ninja: error: empty path" is not fun, so make the error
message mention the depfile name.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Use POSIX_SPAWN_USEVFORK if available
|
| | |_|/ /
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Existing comments were alluding to it's usage and it makes building
ninja itself go a litle bit faster (i.e. taking less wall clock time).
FWIW FreeBSD even uses vfork by default c.f.
https://www.freebsd.org/cgi/man.cgi?query=posix_spawn
|
|\ \ \ \ \
| | | | | |
| | | | | | |
teach -t commands to optionally print only the final command
|
| | | | | | |
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Should fix #1189 after #1185.
|
| |_|/ / /
|/| | | | |
|
| |/ / /
|/| | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Escape ninja output inserted into HTML
|