| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are a number of stdlib.h uses in these files without including
stdlib.h:
hash_collision_bench.cc: rand, RAND_MAX, srand
manifest_parser_perftest.cc: system, exit
ninja_test.cc: EXIT_SUCCESS, EXIT_FAILURE
test.cc: getenv, mkdtemp, system
This works on a Ubuntu g++/libstdc++ build, as the <algorithm> header
pulls in stdlib.h, and on a OSX clang++/libc++ build the <map> and
<string> headers pull in stdlib.h. But a Ubuntu clang++/libc++ build
does not pull in stdlib.h with any of these other headers.
$ apt-get install clang-3.6 libc++-dev
$ CXX=clang++-3.6 CFLAGS=-stdlib=libc++ LDFLAGS=-stdlib=libc++ \
./configure.py
$ ninja ninja_test hash_collision_bench manifest_parser_perftest
This was originally discovered using the host toolchain provided with
Android, but the Ubuntu version is much easier to reproduce.
|
|
|
|
|
| |
Pass the value of -f to the browse python script so it can be passed
back to ninja -t query.
|
|
|
|
|
|
|
| |
Use an enumeration instead of a boolean to clarify the purpose of
arguments at call sites.
Suggested-by: Nico Weber <nicolasweber@gmx.de>
|
|\
| |
| | |
Release the pool slot held by an edge whether it succeeds or fails
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
With this build file:
pool failpool
depth = 1
rule fail
command = fail
pool = failpool
build out1: fail
build out2: fail
build out3: fail
build final: phony out1 out2 out3
Running `ninja -k 0` should run out1..3 sequentially before failing, but
until recently we would fail after just running out1. Add a test
covering this case.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When an edge finishes building, it should be release from its pool.
Make sure that this also is the case when an edge fails to build.
The bug can be shown with a pool has size N, then `ninja -k N+1` will
still stop after N failing commands for that pool, even if there are
many more jobs to be done for that pool:
pool mypool
depth = 1
rule bad_rule
command = false
pool = mypool
build a : bad_rule
build b : bad_rule
Current behaviour:
$ ninja -k 0
[1/2] false
FAILED: false
ninja: build stopped: cannot make progress due to previous errors.
Expected behaviour:
$ ninja -k 0
[1/2] false
FAILED: false
[2/2] false
FAILED: false
ninja: build stopped: cannot make progress due to previous errors.
Signed-off-by: Fredrik Medley <fredrik.medley@gmail.com>
|
|\ \
| | |
| | | |
ninja_test: Fix Visual C++ 2015 warnings/errors about name hiding.
|
| |/
| |
| |
| |
| |
| |
| |
| |
| | |
Visual C++ 2015 warns if a local variable hides visibility of another variable
in a higher scope. Since this project declares warnings as errors, ninja_test
simply won't build on Visual C++ 2015.
The variables have been renamed and scope limited as appropriate, so that
ninja_test will build without error now on Visual C++ 2015.
|
|\ \
| |/
|/| |
Avoid double-scheduling build edges in another case
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The change in commit v1.2.0~3^2~3^2~3 (Fix duplicate edge Pool crash in
the minimally invasive way, 2013-03-18) avoids double-scheduling in a
case involving duplicate out edges. However, double-scheduling may also
occur on a consistent graph when an edge and one of its dependencies
share an order-only input:
$ cat build.ninja
...
build c: touch
build b: touch || c
build a: touch | b || c
$ ninja a
$ rm a c
$ ninja a
In this case 'c' will build first. When NodeFinished('c') loops over
the out edges it will find AllInputsReady is true for 'b' and call
EdgeFinished('b') since it is not wanted (up to date). This will
call NodeFinished('b') which will loop over its out edges, find
AllInputsReady is true for 'a', and call ScheduleEdge('a'). When
we eventually return to the loop in NodeFinished('c') it will move
on to its second output and find that AllInputsReady is true for
'a' and call ScheduleEdge('a') again.
Teach ScheduleEdge to tolerate duplicate calls for an edge that has
already been scheduled. Avoid calling EdgeScheduled more than once
for the same edge.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This makes it possible to run most of the clparser tests on non-Windows,
and is potentially useful for cross-compiling on non-Windows hosts.
Also, the manual didn't document this as Windows-only previously.
If you use this on non-Windows, please let me know, else I might undo
this change again in the future.
|
|\ \
| | |
| | | |
Use posix_spawn() instead of fork()/exec().
|
| | |
| | |
| | |
| | |
| | | |
posix_spawn() is a syscall on OS X and Solaris and a bit faster. It's
also easier emulate for cygwin, and the code is a bit simpler.
|
|\ \ \
| |/ /
|/| | |
browse tool: Allow customization of port number, Py3 fix
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Add --port option to override the default port (8000).
Add --no-browser option to avoid opening a web browser (useful over
SSH).
Make the target name optional, using "all" if omitted.
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The change caused some issues (it makes it impossible ot use
posix_spawn() and makes it harder to suspend children on ctrl-z). After
discussing with jln: Since it fixes a corner case that can be fixed by
explicitly running commands that need it in a wrapper that setsid()s
them, let's try reverting it for a while. Please shout if this is a
problem for you.
See also #1097.
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The call to StatIfNecessary in DependencyScan::RecomputeOutputsDirty was
added by commit v1.4.0^2~7^2~1 (Share more code between CleanNode() and
RecomputeDirty(), 2013-09-02) while consolidating code paths. However,
it was needed only when called from RecomputeDirty because prior to
refactoring the CleanNode code path did not call it.
Later commit v1.6.0^2~46^2 (Let DependencyScan::RecomputeDirty() work
correclty with cyclic graphs, 2014-12-07) added back to RecomputeDirty a
loop over outputs that calls StatIfNecessary. Therefore
RecomputeOutputsDirty no longer needs to call StatIfNecessary for either
of its own callers.
|
|/
|
|
|
|
|
| |
On Windows set_terminate() could either be the standard C++ one or (actually the same one but in the global namespace) the CRT one declared in corecrt_terminate.h
Hence this ambiguity - this patch solves it.
Signed-off-by: g4m4 <misept.dieseneuf@gmail.com>
|
|\
| |
| | |
Print output file on failure
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Modify the FAILED: output to provide the output files that failed to
build, followed by the failed command on the next line. This makes the
failure much easier to read, as you can immediately see much shorter
name of the file that failed instead of trying to parse a very long
command line. It also makes manually re-running the failed command much
easier because you can copy the whole line without ending up with the
FAILED: prefix.
|
|\ \
| | |
| | | |
Add support for build statement implicit outputs
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Some build rules produce outputs that are not mentioned on the command
line but that should be part of the build graph. Such outputs should
not be named in the `$out` variable. Extend the build statement syntax
to support specification of implicit outputs using the syntax
`| out1 out2` after the explicit outputs and before the `:`.
For example, compilation of a Fortran source file `foo.f90` that defines
`MODULE FOO` may now be specified as:
rule fc
command = f95 -c $in -o $out
build foo.o | foo.mod: fc foo.f90
The `foo.mod` file is an implicit output generated by the compiler based
on the content of the source file and not mentioned on the command line.
|
|\ \ \
| | | |
| | | | |
Deduplicate disk abstraction infrastructure
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Avoid having two separate filesystem interfaces. Simplify test
infrastructure by avoiding custom `ManifestParser::FileReader`
implementations.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Some clients will need only the ability to read files, so provide this
as a more narrow interface than the full disk interface.
|
|\ \ \ \
| |/ / /
| | / /
| |/ /
|/| | |
perftest: fix compilation after dupe_edge_should_err change
|
| | |
| | |
| | |
| | |
| | | |
Fix some ManifestParser constructor calls missed by commit 56bab441b7
(dupe_edge_should_err from bool to enum, 2016-01-27).
|
|\ \ \
| |/ /
|/| | |
Canonicalize "." to "."
|
| | |
| | |
| | |
| | |
| | | |
"." is a legal path, if the string is empty after canonicalization
return ".".
|
|\ \ \
| | | |
| | | | |
dupe_edge_should_err from bool to enum
|
| | | | |
|
|/ / /
| | |
| | |
| | |
| | | |
This is useful when you are developing a tool which generates
GCC-style depfiles.
|
| | | |
|
| | | |
|
| | | |
|
|\ \ \
| | | |
| | | | |
make use of Bindings typedef
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | | |
Looks like we declared this typedef but never used it.
It seems we just forgot to use it so this patch makes uses of it now.
Otherwise we could just delete it.
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| | |
fixes the error about an unexpected variable for a rule that
declares the msvc_deps_prefix. The manual suggests that this
should work since Ninja 1.5
(https://ninja-build.org/manual.html#ref_rule).
Closes #1043
|
|\ \
| | |
| | | |
Support for AIX
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
AIX supplies getopt but not getopt_long.
We can't use the embedded getopt implementation, since the constness of its
arguments doesn't match the AIX system routine.
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
On AIX, inttypes.h gets indirectly included by build_log.h.
It's easiest just to ask for the printf format macros right away.
|
| | |
| | |
| | |
| | | |
/bin/od on Solaris and AIX both generate tabs.
|
|\ \ \
| | | |
| | | | |
Print status when edge finishes on dumb terminals
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
On smart terminals ninja prints the status line both before
and after running a command, reusing the same line if possible.
On a dumb terminal that doesn't support reusing the line, it
only prints the status before starting the command, but prints
the output of the command when the command finishes, by which
point other commands may have started and printed their status
line. This makes it impossible to determine what command
produced a line of output.
Modify BuildEdgeStarted to only print the status line if the
command is going to lock the console, or if ninja is running
on a smart terminal. Modify BuildEdgeFinished to always
print the status line unless the command locked the console,
in which case the status was already printed and no other
command can have printed any lines.
The end result will be dumb terminal output that much more
closely matches smart terminal output. One disadvantage is
that dumb terminals won't show anything when starting a
command, making it harder to tell what commands are currently
running, but I expect most interactive uses of ninja will use
a smart terminal.
|
|\ \ \ \
| | | | |
| | | | | |
Cleanup build on SIGHUP.
|
| | |_|/
| |/| |
| | | |
| | | |
| | | | |
SIGHUP is sent when the connection hang up (i.e. when the terminal
window is closed or the ssh connection is closed).
|