Nico Weber [Sun, 15 Mar 2015 23:49:24 +0000 (16:49 -0700)]
Merge pull request #933 from nico/dupeedgefix
Build self-consistent graphs for dupe edges with multiple outputs.
Nico Weber [Sun, 15 Mar 2015 23:34:03 +0000 (19:34 -0400)]
Build self-consistent graphs for dupe edges with multiple outputs.
Fixes #867, both the crashes and "[stuck]" issues.
The problem was that a duplicate edge would modify the in_edge of the
outputs of the new build rule, but the edge corresponding to the old
build rule would still think that the in_edge points to itself.
`old_edge->outputs_[0]->in_edge()` would not return `old_edge`, which
confused the scan logic.
As fix, let `State::AddOut()` reject changing in_edge if it's already
set. This changes behavior in a minor way: Previously, if there were
multiple edges for a single output, the last edge would be kept. Now,
the first edge is kept. This only had mostly-well-defined semantics if
all duplicate edges are the same (which is the only case I've seen in
practice), and for that case the behavior doesn't change.
For testing, add a VerifyGraph() function and call that every time any
test graph is parsed. That's a bit more code than just copying the test
cases from the bug into build_test.cc, but it also yields better test
coverage overall.
Evan Martin [Tue, 10 Mar 2015 23:47:44 +0000 (16:47 -0700)]
Merge pull request #928 from nico/novar
Remove option no longer needed now that we don't use gtest.
Nico Weber [Tue, 10 Mar 2015 20:45:17 +0000 (13:45 -0700)]
Remove option no longer needed now that we don't use gtest.
Nico Weber [Tue, 10 Mar 2015 16:09:49 +0000 (09:09 -0700)]
Simplify. No behavior change.
Nico Weber [Mon, 9 Mar 2015 22:50:30 +0000 (15:50 -0700)]
Merge pull request #917 from pinotree/rlimit
subprocess_test: gracefully handle rlim.rlim_cur < kNumProcs
Nico Weber [Mon, 9 Mar 2015 18:32:25 +0000 (11:32 -0700)]
Merge pull request #910 from jlnt/master
POSIX: detach background subprocesses from terminal.
Nico Weber [Mon, 9 Mar 2015 17:34:08 +0000 (10:34 -0700)]
Merge pull request #927 from nico/colorgcc
Make diagnostics colored with new gccs (4.9+) too.
Nico Weber [Mon, 9 Mar 2015 17:24:41 +0000 (10:24 -0700)]
Make diagnostics colored with new gccs (4.9+) too.
Both clang and gcc understand -fdiagnostics-color, so use that flag name.
(This will disable colored diagnostics for clangs older than LLVM 3.3,
but that is several years old by now.)
Nico Weber [Mon, 9 Mar 2015 04:49:37 +0000 (21:49 -0700)]
Merge pull request #926 from nico/fixlibcpp
Fix build with libc++ after #921.
Nico Weber [Mon, 9 Mar 2015 04:46:34 +0000 (21:46 -0700)]
Fix build with libc++ after #921.
It failed with
error: field has incomplete type 'EvalString'
note: in instantiation of exception specification for 'map' requested here
explicit Rule(const string& name) : name_(name) {}
^
Nico Weber [Mon, 9 Mar 2015 04:44:41 +0000 (21:44 -0700)]
Merge pull request #921 from mohamed/master
Allow scoping rules through subninja
Nico Weber [Mon, 9 Mar 2015 04:42:41 +0000 (21:42 -0700)]
Merge pull request #925 from kirbyfan64/master
Test for Clang by checking --version
Ryan Gonzalez [Mon, 9 Mar 2015 00:09:01 +0000 (19:09 -0500)]
Test for Clang by checking --version
Nico Weber [Sun, 8 Mar 2015 23:20:37 +0000 (16:20 -0700)]
Merge pull request #923 from HeisSpiter/master
Directly pass the string instead of char * to Truncate util function. It...
Mohamed Bamakhrama [Sun, 8 Mar 2015 03:13:12 +0000 (04:13 +0100)]
Added a new test to illustrate scoped rules
The new test shows the added value of scoped rules by demonstrating
a multi-level build where a single rules file gets included at all
the levels. By scoping rules, this is possible.
Pierre Schweitzer [Sat, 7 Mar 2015 13:23:41 +0000 (14:23 +0100)]
Directly pass the string instead of char * to Truncate util function. It will prevent useless conversions.
Mohamed Bamakhrama [Sun, 1 Mar 2015 23:57:33 +0000 (00:57 +0100)]
Allow scoping rules through subninja
Ninja didn't support scoping rules through subninja and assumed
a unique rule name in the whole namespace. With this change, this
behavior is changed to allow scoping rules. Two rules can have the
same name if they belong to two different scopes. However, two
rules can NOT have the same name in the same scope.
Pino Toscano [Sat, 28 Feb 2015 10:04:09 +0000 (11:04 +0100)]
subprocess_test: gracefully handle rlim.rlim_cur < kNumProcs
Instead of expecting that the number of open files is well above
kNumProcs, simply "skip" the test in that case, still printing the
message about the test limit (adding the current system limit too).
Nico Weber [Sat, 7 Feb 2015 07:25:42 +0000 (23:25 -0800)]
Merge pull request #914 from tzik/typo_fix
Typo fix in graph.cc
tzik [Fri, 6 Feb 2015 10:45:42 +0000 (19:45 +0900)]
Typo fix in graph.cc
Nico Weber [Tue, 3 Feb 2015 21:01:28 +0000 (13:01 -0800)]
Merge pull request #908 from colincross/multipass
Allow manifest rebuild to loop up to 100 times
Colin Cross [Mon, 26 Jan 2015 21:52:20 +0000 (13:52 -0800)]
Allow manifest rebuild to loop up to 100 times
Ninja generators that bootstrap themselves with Ninja may need
to rebuild build.ninja multiple times. Replace the 2 cycle loop
with a 100 cycle loop, and print the pass number each time it
restarts.
Original-author: Jamie Gennis <jgennis@gmail.com>
Julien Tinnes [Thu, 29 Jan 2015 19:33:35 +0000 (11:33 -0800)]
POSIX: detach background subprocesses from terminal.
Put background subprocesses (i.e. subprocesses with no access
to the console) in their own session and detach them from the
terminal.
This fixes martine/ninja#909.
Nico Weber [Sat, 24 Jan 2015 06:18:34 +0000 (22:18 -0800)]
Merge pull request #897 from tzik/pending
Check pending SIGINT after ppoll/pselect
Nico Weber [Wed, 21 Jan 2015 01:40:34 +0000 (17:40 -0800)]
Merge pull request #903 from nico/gcov
Document how to run gcov on ninja.
Nico Weber [Wed, 21 Jan 2015 01:39:27 +0000 (17:39 -0800)]
Document how to run gcov on ninja.
Nico Weber [Tue, 20 Jan 2015 05:23:36 +0000 (21:23 -0800)]
Merge pull request #901 from nico/assertless
Remove an incorrect assert.
Nico Weber [Tue, 20 Jan 2015 05:20:15 +0000 (21:20 -0800)]
Remove an incorrect assert.
The assert fires on cyclic manifests (found by afl-fuzz). Since there
was explicit error handing for this case already, just remove the
assert.
Taiju Tsuiki [Fri, 9 Jan 2015 22:19:11 +0000 (07:19 +0900)]
Check pending SIGINT after ppoll/pselect
ppoll/pselect prioritizes file descriptor events over
a signal delivery. So a flood of events prevents ninja
from reacting keyboard interruption by the user.
This CL adds a check for pending keyboard interruptions after
file descriptor events.
Nico Weber [Wed, 14 Jan 2015 16:28:58 +0000 (08:28 -0800)]
Merge pull request #894 from tfarina/has-indent
Cleanup: Fix 'hasIdent' variable name/style.
Thiago Farina [Sat, 10 Jan 2015 22:00:43 +0000 (20:00 -0200)]
Cleanup: Fix 'hasIdent' variable name/style.
Seems more correct to name it has_indent_token and to use the
unix_hacker style.
Signed-off-by: Thiago Farina <tfarina@chromium.org>
Nico Weber [Sun, 4 Jan 2015 18:23:17 +0000 (10:23 -0800)]
Merge pull request #889 from nico/del2
Try to simplify d1e6a29 a bit.
Nico Weber [Sun, 4 Jan 2015 02:50:32 +0000 (18:50 -0800)]
Try to simplify d1e6a29 a bit.
Nico Weber [Sun, 4 Jan 2015 02:01:20 +0000 (18:01 -0800)]
Merge pull request #888 from nico/del
Remove unused hash<std::string>.
Nico Weber [Sun, 4 Jan 2015 01:58:15 +0000 (17:58 -0800)]
Remove unused hash<std::string>.
ExternalStringHashMap used to store std::strings long ago. Since it
doesn't anymore, this specialization isn't needed. No behavior change.
Nico Weber [Sun, 4 Jan 2015 01:53:57 +0000 (17:53 -0800)]
Merge pull request #887 from berenm/master
Fix compilation errors on Visual Studio 2015 (_MSC_VER 1900)
Beren Minor [Wed, 31 Dec 2014 11:17:21 +0000 (12:17 +0100)]
Fix compilation errors on Visual Studio 2015 (_MSC_VER 1900).
Nico Weber [Thu, 25 Dec 2014 21:36:16 +0000 (13:36 -0800)]
Merge pull request #884 from nico/sshh
Remove 'Recompacting...' messages.
Nico Weber [Mon, 22 Dec 2014 18:42:15 +0000 (10:42 -0800)]
Merge pull request #885 from frasercrmck/zsh_comp_modes
zsh-completion: remove use of 'head' with negative offset
Fraser Cormack [Sat, 20 Dec 2014 00:12:52 +0000 (00:12 +0000)]
zsh-completion: remove use of 'head' with negative offset
Some systems - like OSX - don't come with a version of head that
supports a negative value for the -n flag. Such systems get a message
such as this when tab-completing ninja's -d flag:
ninja -dhead: illegal line count -- -1
Using sed instead should be more universally supported.
Nico Weber [Thu, 18 Dec 2014 19:04:14 +0000 (11:04 -0800)]
Remove 'Recompacting...' messages.
Recompacting the build log used to be slow, so it made sense to print this
message. We then made recompaction much faster, but didn't remove this
message back then.
The deps log only has it because the build log had it.
Since both steps are effectively instant in practice, remove these log messages.
Nico Weber [Thu, 11 Dec 2014 05:11:32 +0000 (21:11 -0800)]
Merge pull request #882 from mathstuf/verbose-configure
configure: add a verbose mode
Ben Boeckel [Thu, 11 Dec 2014 04:09:38 +0000 (23:09 -0500)]
configure: add a verbose mode
Required for Fedora infrastructure so that the commands used to build
ninja are logged.
Nico Weber [Tue, 9 Dec 2014 20:26:41 +0000 (12:26 -0800)]
Merge pull request #881 from nico/depscancycles
Let DependencyScan::RecomputeDirty() work correclty with cyclic graphs.
Nico Weber [Mon, 8 Dec 2014 00:02:35 +0000 (16:02 -0800)]
Let DependencyScan::RecomputeDirty() work correclty with cyclic graphs.
RecomputDirty(edge) currently works roughly like this:
RecomputeDirty(edge):
LoadDeps(edge)
for in in edge.inputs:
if in.StatIfNecessary():
RecomputeDirty(in.in_edge) # recurse into inputs
for out in edge.outputs:
out.StatIfNecessary() # mark outputs as visited
It uses the stat state of each node to mark nodes as visited and doesn't
traverse across nodes that have been visited already. For cyclic graphs
with an edge with multiple outputs on the cycle, nothing prevents an
edge to be visited more than once if the cycle is entered through an
output that isn't on the cycle. In other words, RecomputeDirty() for
the same edge can be on the call stack more than once. This is bad for
at least two reasons:
1. Deps are added multiple times, making the graph confusing to reason
about.
2. LoadDeps() will insert into the inputs_ of an edge that's iterated
over in a callframe higher up. This can invalidate the iterator,
which causes a crash when the callframe with the loop over the
now-invalidated iterator resumes.
To fix this, let RecomputeDirty() mark all outputs of an edge as visited
as the first thing it does. This way, even if the edge is on a cycle
with several outputs, each output is already marked and no edge will
have its deps loaded more than once.
Fixes the crashes in #875. (In practice, it turns the crashes into
"stuck [this is a bug]" messages for now, due to the example without
duplicate rules in #867)
Nico Weber [Sun, 7 Dec 2014 22:49:49 +0000 (14:49 -0800)]
Rename a few iterators. No behavior change.
It confused me that the iterator iterating over `outputs_` was called
`i` -- this always made me think of "input", not "iterator".
Call iterators over edge outputs "o", iterators over edge inputs "i",
iterators over node input edges "oe", and general iterators over edges
"e".
Nico Weber [Sun, 7 Dec 2014 22:42:12 +0000 (14:42 -0800)]
remove two unneeded `explicit`s
Nico Weber [Thu, 4 Dec 2014 18:05:44 +0000 (10:05 -0800)]
Merge pull request #703 from ovinn/master
Added *.obj ignore rule
Nico Weber [Thu, 4 Dec 2014 18:03:49 +0000 (10:03 -0800)]
Merge pull request #835 from rainlabs-eu/fix-cygwin-compatibility
Fixed cygwin compatibility (issue #806)
Nico Weber [Thu, 4 Dec 2014 17:04:15 +0000 (09:04 -0800)]
Rename num_collisions to collision_count.
All other counting variables are called foo_count, not num_foos.
No behavior change.
Nico Weber [Thu, 4 Dec 2014 05:59:27 +0000 (21:59 -0800)]
Merge pull request #868 from Fanael/ninja-mode.el-refactor
Remove unneeded save-excursion.
Nico Weber [Thu, 4 Dec 2014 05:32:51 +0000 (21:32 -0800)]
Merge pull request #809 from andrey-malets/doc-for-first-output
Document target^ syntax.
Nico Weber [Thu, 4 Dec 2014 02:17:27 +0000 (18:17 -0800)]
Merge pull request #879 from nico/rev
Revert #223, fixes #874.
Nico Weber [Thu, 4 Dec 2014 02:04:26 +0000 (18:04 -0800)]
Revert #223, fixes #874.
No test since there's still no good way to test code in ninja.cc. Going
forward, either move NinjaMain to its own file with tests, or create a
system that makes it possible to run integration tests on the ninja
binary. Instead, add a comment that explains why the restat
optimization isn't done.
Nico Weber [Wed, 3 Dec 2014 16:16:32 +0000 (08:16 -0800)]
Merge pull request #878 from nico/py3
Make configure.py work with Python. Fixes issue #877.
Nico Weber [Wed, 3 Dec 2014 16:10:44 +0000 (08:10 -0800)]
Make configure.py work with Python. Fixes issue #877.
Patch from @TheOneRing!
Nico Weber [Tue, 2 Dec 2014 06:27:06 +0000 (22:27 -0800)]
Merge pull request #873 from nico/full
win: Use full console width for status messages.
Nico Weber [Tue, 2 Dec 2014 06:21:54 +0000 (22:21 -0800)]
win: Use full console width for status messages.
The original overprinting code, added in
7b3d8c8e, used printf for printing
the status. printf needs one column for the cursor, so the status message
could only take up `width - 1` columns.
fc554c22 changed Windows from printf
to WriteConsoleOutput which doesn't move the cursor, so keeping one column
empty is no longer needed. So stop doing that.
Also remove a duplicate call to GetConsoleScreenBufferInfo.
Nico Weber [Tue, 2 Dec 2014 06:15:50 +0000 (22:15 -0800)]
Merge pull request #872 from nico/vec
win/lineprinter: Use a vector instead of manual memory management.
Nico Weber [Tue, 2 Dec 2014 06:14:25 +0000 (22:14 -0800)]
win/lineprinter: Use a vector instead of manual memory management.
No behavior change. Based on a patch from gmisocpp@gmail.com!
Nico Weber [Tue, 2 Dec 2014 05:30:06 +0000 (21:30 -0800)]
Merge pull request #871 from nico/ctrls
win: Let the "Pause" key or Ctrl-S pause output.
Nico Weber [Tue, 2 Dec 2014 05:05:23 +0000 (21:05 -0800)]
win: Let the "Pause" key or Ctrl-S pause output.
In cmd.exe, hitting the "Pause" key or Ctrl-S will pause
programs until a key is pressed. This is apparently
implemented when stdout is writing to, so use printf
instead of Console functions to reset the cursor to
the start of the line. Also happens to simplify the code.
(This already worked in -v mode since that already
prints using printf.)
\vBased on a patch from gmisocpp@gmail.com!
Fanael Linithien [Mon, 24 Nov 2014 18:09:33 +0000 (19:09 +0100)]
Remove unneeded save-excursion.
syntax-propertize-function is allowed to move the point and mark.
Nico Weber [Mon, 24 Nov 2014 17:33:39 +0000 (09:33 -0800)]
mark this 1.5.3.git
Evan Martin [Mon, 24 Nov 2014 05:36:08 +0000 (21:36 -0800)]
Merge pull request #864 from Fanael/ninja-mode.el-refactor
Ninja mode.el refactor
Fanael Linithien [Sun, 23 Nov 2014 21:29:49 +0000 (22:29 +0100)]
Use lexical-binding.
There's no reason not to use lexical-binding when supporting only
Emacs 24+. Its semantics are just that much saner.
Fanael Linithien [Sun, 23 Nov 2014 21:26:54 +0000 (22:26 +0100)]
Add a Emacs 24 requirement.
Only Emacs >= 24 has prog-mode.
Fanael Linithien [Sun, 23 Nov 2014 15:05:48 +0000 (16:05 +0100)]
Correctly recognize a comment if the previous line is a comment ending in $.
Fanael Linithien [Sat, 22 Nov 2014 18:25:43 +0000 (19:25 +0100)]
Avoid putting properties past the end of the buffer.
Fanael Linithien [Sat, 22 Nov 2014 18:03:23 +0000 (19:03 +0100)]
Don't use dotted list syntax unless necessary.
Fanael Linithien [Sat, 22 Nov 2014 17:59:53 +0000 (18:59 +0100)]
Remove unnecessary regexp group.
Fanael Linithien [Sat, 22 Nov 2014 17:57:31 +0000 (18:57 +0100)]
Correctly recognize comments.
Fanael Linithien [Sat, 22 Nov 2014 17:35:46 +0000 (18:35 +0100)]
Set up a proper syntax table for ninja-mode.
Since quotes are not meant to be treated as string delimiters,
the syntax table is the place to tell Emacs so.
This also means syntactic fontification can be reenabled and the
font-lock keyword entry for comments removed.
Fanael Linithien [Sat, 22 Nov 2014 17:23:01 +0000 (18:23 +0100)]
Set comment-start buffer-locally, not globally.
Fanael Linithien [Sat, 22 Nov 2014 17:22:11 +0000 (18:22 +0100)]
Use quasi-quoting instead of list+cons.
Fanael Linithien [Sat, 22 Nov 2014 17:15:46 +0000 (18:15 +0100)]
Reindent ninja-mode.el using Emacs.
Emacs knows best how to indent Emacs Lisp.
Fanael Linithien [Sat, 22 Nov 2014 17:17:39 +0000 (18:17 +0100)]
Use double semicolon comments.
Fanael Linithien [Sat, 22 Nov 2014 17:15:09 +0000 (18:15 +0100)]
Don't leave lone closing parens.
Elan Ruusamäe [Tue, 21 Jan 2014 22:33:08 +0000 (00:33 +0200)]
no subshell
don't need subshell to send stderr to /dev/null
Evan Martin [Sun, 23 Nov 2014 20:14:02 +0000 (12:14 -0800)]
Merge pull request #772 from drbo/syntax_bugfix
Added highlighting in Emacs for ${...} variables
Nico Weber [Sat, 22 Nov 2014 19:45:18 +0000 (11:45 -0800)]
Merge pull request #866 from nico/winfix
Fix Windows build after #862. Thanks to @harig for the report.
Nico Weber [Sat, 22 Nov 2014 19:43:33 +0000 (11:43 -0800)]
Fix Windows build after #862. Thanks to @harig for the report.
Nico Weber [Sat, 22 Nov 2014 02:24:03 +0000 (18:24 -0800)]
Merge pull request #862 from nico/browse
Make browse detection consistent with other platform checks.
Nico Weber [Sat, 22 Nov 2014 02:23:07 +0000 (18:23 -0800)]
Merge pull request #863 from nico/nopthread
Stop linking pthread.
Nico Weber [Sat, 22 Nov 2014 02:18:30 +0000 (18:18 -0800)]
Remove now-unused variable test_libs.
Nico Weber [Sat, 22 Nov 2014 02:13:48 +0000 (18:13 -0800)]
Stop linking pthread.
It was only needed by gtest, which is no longer used.
(Intesting note: I checked when the -lpthread flag was added, and it's
been around since the first revision of build.ninja, which used to be
checked in before configure.py existed. Back then, it looks like '@' was
used to dereference built-in variables, and build outputs were also
prefixed by '@'!).
Nico Weber [Fri, 21 Nov 2014 00:56:17 +0000 (16:56 -0800)]
Make browse detection consistent with other platform checks.
Nico Weber [Fri, 21 Nov 2014 00:49:52 +0000 (16:49 -0800)]
Merge pull request #861 from nico/nosub
Remove duplicate import. No behavior change.
Nico Weber [Fri, 21 Nov 2014 00:46:52 +0000 (16:46 -0800)]
Remove duplicate import. No behavior change.
Evan Martin [Tue, 18 Nov 2014 19:50:09 +0000 (11:50 -0800)]
Merge pull request #859 from martine/platform-helper
merge platform_helper into configure script
Evan Martin [Tue, 18 Nov 2014 18:09:07 +0000 (10:09 -0800)]
merge platform_helper into configure script
With this code all in one place, it's easier to spot unused code and
simplification opportunities.
Evan Martin [Tue, 18 Nov 2014 17:58:45 +0000 (09:58 -0800)]
drop leftover references to bootstrap.py
Evan Martin [Tue, 18 Nov 2014 17:51:08 +0000 (09:51 -0800)]
Merge pull request #858 from martine/travis-bootstrap
switch travis to use new --bootstrap mode for building
Evan Martin [Tue, 18 Nov 2014 17:44:38 +0000 (09:44 -0800)]
Merge pull request #813 from cdlm/emacs-mode-require-newline
Emacs mode: inherit from prog-mode
Evan Martin [Tue, 18 Nov 2014 17:44:14 +0000 (09:44 -0800)]
Merge pull request #836 from nocnokneo/patch-1
Mention optional files in installation instructions
Evan Martin [Tue, 18 Nov 2014 17:07:43 +0000 (09:07 -0800)]
switch travis to use new --bootstrap mode for building
Evan Martin [Tue, 18 Nov 2014 17:06:48 +0000 (09:06 -0800)]
Merge pull request #854 from martine/bootstrap
add a --bootstrap mode for configure.py
Evan Martin [Tue, 18 Nov 2014 16:04:23 +0000 (08:04 -0800)]
drop NINJA_BOOTSTRAP define
Evan Martin [Tue, 18 Nov 2014 16:48:39 +0000 (08:48 -0800)]
Merge pull request #857 from martine/travis-python-test
also test ninja_syntax.py in travis