Nico Weber [Wed, 24 Jul 2013 20:30:29 +0000 (13:30 -0700)]
Merge pull request #612 from maximuska/proposed/deps_log_write_errors_checking
Proposed/deps log write errors checking
Nico Weber [Sat, 20 Jul 2013 19:14:07 +0000 (12:14 -0700)]
Merge pull request #625 from nico/land
Merge pull request #617.
Chris Hopman [Tue, 16 Jul 2013 23:00:28 +0000 (16:00 -0700)]
Add test for correct restat logic
When a single output of an edge is dirty, the restat check should
leave all outputs of that edge dirty.
Chris Hopman [Wed, 3 Jul 2013 21:26:25 +0000 (14:26 -0700)]
Fix restat dirty check logic for edges with multiple outputs
In a normal dependency scan (see DependencyScan::RecomputeDirty) we mark
all outputs of an Edge as dirty if any of the outputs is dirty. This is
the correct behavior because if any output is dirty, we will run the
command for that Edge and that can touch any of the outputs of the Edge
and so all the outputs should be marked dirty.
When updating the dirty state of Node's for a restat check, we were not
applying this logic, instead only those outputs that were actually
"dirty" were marked dirty.
Before this patch, restat edges with multiple outputs caused not all
dependent edges to run.
Nico Weber [Sat, 20 Jul 2013 04:47:00 +0000 (21:47 -0700)]
Merge pull request #624 from nico/landmaxim
Land the first two commits of pull request #608.
Maxim Kalaev [Fri, 28 Jun 2013 17:48:30 +0000 (20:48 +0300)]
minor: removing noop call to MarkDirty(), fixing comment
Maxim Kalaev [Thu, 27 Jun 2013 18:55:38 +0000 (21:55 +0300)]
Removing a redundant stat() call with 'deps' and 'restat = 1'
Nico Weber [Fri, 19 Jul 2013 00:54:33 +0000 (17:54 -0700)]
Merge pull request #623 from nico/fix
Fix diagnostic formatting regression caused by
adaa91a33eb2cf23b88.
Nico Weber [Fri, 19 Jul 2013 00:51:10 +0000 (17:51 -0700)]
Fix diagnostic formatting regression caused by
adaa91a33eb2cf23b88.
Ninja regressed to include a location for every file on the include stack for
nested diagnostics, i.e. it would print:
input:1: include.ninja:1: expected path
Fix this so that it prints only the current file location, like it used to:
include.ninja:1: expected path
Also add a test for this.
Nico Weber [Thu, 18 Jul 2013 21:41:16 +0000 (14:41 -0700)]
Merge pull request #622 from nico/test
Add test for a manifest ending in the middle of a keyword.
Nico Weber [Thu, 18 Jul 2013 21:39:41 +0000 (14:39 -0700)]
Add test for a manifest ending in the middle of a keyword.
Evan Martin [Thu, 18 Jul 2013 20:36:58 +0000 (13:36 -0700)]
Merge pull request #621 from nico/ninjaload
Reuse ManifestParser::Load() in ManifestParser::ParseFileInclude().
Nico Weber [Thu, 18 Jul 2013 00:55:36 +0000 (17:55 -0700)]
Add back contents.resize(), but with a comment and just 1 instead of 10.
Nico Weber [Thu, 11 Jul 2013 00:43:29 +0000 (17:43 -0700)]
Let the ".ninja parse" metric include the time to read the toplevel ninja file.
Loads of included ninja files were covered by the ".ninja parse" in Parse()
further up the stack from the toplevel file, but the load of the toplevel
file wasn't counted. Fix that.
Nico Weber [Thu, 11 Jul 2013 00:30:16 +0000 (17:30 -0700)]
Reuse ManifestParser::Load() in ManifestParser::ParseFileInclude().
ParseFileInclude() was doing the work that Load() was doing. Instead, just
make it call Load().
Also, remove a FIXME about using ReadPath() in ParseFileInclude() -- it's
already being used. (The FIXME was added in the same commit that added the
call to ReadPath() --
8a0c96075786c19 -- it probably should've been deleted
before that commit.)
Also, remove a `contents.resize(contents.size() + 10);`. It's not clear what
it's for, but if it was important then ManifestParser::ParseFileInclude()
would have needed that call too, and it didn't have it.
No intended behavior change.
Evan Martin [Mon, 8 Jul 2013 20:55:23 +0000 (13:55 -0700)]
Merge pull request #616 from nico/recompact
Add a 'recompact' tool, which forces recompaction of the build and deps ...
Evan Martin [Mon, 8 Jul 2013 20:53:22 +0000 (13:53 -0700)]
Merge pull request #614 from nico/pooldoc
Mention pools in the discussion of ninja's toplevel declarations.
Evan Martin [Mon, 8 Jul 2013 20:53:04 +0000 (13:53 -0700)]
Merge pull request #611 from nico/testparse
Improve error message for duplicate rules and unknown pools.
Maxim Kalaev [Sun, 30 Jun 2013 19:59:54 +0000 (22:59 +0300)]
Introducing tool 'deps' dumping ninja deps log entries
Nico Weber [Mon, 8 Jul 2013 19:34:46 +0000 (12:34 -0700)]
Add a 'recompact' tool, which forces recompaction of the build and deps logs.
This is useful for performance comparisons between two build directories.
Nico Weber [Mon, 8 Jul 2013 18:58:18 +0000 (11:58 -0700)]
Merge pull request #615 from mdempsky/strict-murmur
Fix murmur hash implementations to work on strict alignment architectures
Matthew Dempsky [Mon, 8 Jul 2013 17:47:57 +0000 (10:47 -0700)]
Fix murmur hash implementations to work on strict alignment
architectures like OpenBSD/mips64el and OpenBSD/hppa64.
Nico Weber [Sun, 7 Jul 2013 19:22:38 +0000 (12:22 -0700)]
Mention pools in the discussion of ninja's toplevel declarations.
Nico Weber [Tue, 2 Jul 2013 22:43:40 +0000 (15:43 -0700)]
Improve error message for duplicate rules and unknown pools.
Also add more tests for invalid manifests. According to gcov, these invalid
inputs weren't tested before.
Nico Weber [Tue, 2 Jul 2013 18:13:00 +0000 (11:13 -0700)]
Merge pull request #610 from rnk/wstr
Use fwrite to print whatever the subcommand wrote
Reid Kleckner [Tue, 2 Jul 2013 06:00:22 +0000 (02:00 -0400)]
Use fwrite to print whatever the subcommand wrote
Subcommands can write things like UTF-16, which some terminals can
understand. printf() will interpret the null bytes as the end of the
string.
In particular, MSVC's assert() will print wide characters by default,
and I can't find a way to disable it, leading to clang assertion
failures looking like:
FAILED: ...clang.exe ...
Aninja: build stopped: subcommand failed.
With this fix, I get the desired:
FAILED: ...clang.exe ...
Assertion failed: SymbolMap...
ninja: build stopped: subcommand failed.
Nico Weber [Mon, 1 Jul 2013 21:34:05 +0000 (14:34 -0700)]
Merge pull request #607 from dajohi/master
Support Bitrig
Maxim Kalaev [Mon, 1 Jul 2013 21:09:43 +0000 (00:09 +0300)]
Adding checks for record overflow in deps_log
David Hill [Mon, 1 Jul 2013 20:05:30 +0000 (16:05 -0400)]
use !defined(NOT_PPOLL)
Maxim Kalaev [Mon, 1 Jul 2013 18:33:12 +0000 (21:33 +0300)]
Adding error checking on fwrite/fflush in deps_log
David Hill [Mon, 1 Jul 2013 18:11:05 +0000 (14:11 -0400)]
Exclude Windows as well
David Hill [Sat, 29 Jun 2013 23:21:15 +0000 (19:21 -0400)]
ugh, missing #
David Hill [Sat, 29 Jun 2013 23:16:51 +0000 (19:16 -0400)]
cleanup based on comments from martine
David Hill [Sat, 29 Jun 2013 21:34:51 +0000 (17:34 -0400)]
support Bitrig
Nico Weber [Sat, 22 Jun 2013 00:42:15 +0000 (17:42 -0700)]
Merge pull request #601 from nico/109fix
Add stdlib.h include for atol().
Nico Weber [Sat, 22 Jun 2013 00:40:40 +0000 (17:40 -0700)]
Add stdlib.h include for atol().
This attempts to fix issue #600. `man atol` claims that atol() is in
stdlib.h, which wasn't included yet.
Evan Martin [Fri, 14 Jun 2013 06:17:10 +0000 (23:17 -0700)]
Merge pull request #596 from nico/chunk
Make sure to not write partial deps entries.
Nico Weber [Fri, 14 Jun 2013 05:11:34 +0000 (22:11 -0700)]
Make sure to not write partial deps entries.
When two ninja instances run in parallel in the same build directory,
one instance could write a deps entry header and a few ids, and then the
other instance could write a file name in the middle of the deps header.
When ninja reads this deps log on the next run, it will deserialize the
file name as indices, which will cause an out-of-bounds read.
(This can happen if a user runs a "compile this file" that uses ninja to
compile the current buffer in an editor, and also does a full build in a
terminal at the same time for example.)
While running two ninja instances in parallel in the same build
directory isn't a good idea, it happens to mostly work in non-deps mode:
There's redundant edge execution, but nothing crashes. This is partially
because the command log is line-buffered and a single log entry only
consists of a single line.
This change makes sure that deps entries are always written in one go,
like command log entries currently are. Running two ninja binaries in
parallel on the same build directory still isn't a great idea, but it's
less likely to lead to crashes.
See issue #595.
Evan Martin [Thu, 6 Jun 2013 17:54:53 +0000 (10:54 -0700)]
Merge pull request #593 from nico/moretest
Add a test for CreatePhonyInEdge() in depsmode path.
Nico Weber [Thu, 6 Jun 2013 01:51:00 +0000 (18:51 -0700)]
Add a test for CreatePhonyInEdge() in depsmode path.
Removing the `CreatePhonyInEdge(node);` line in
`ImplicitDepLoader::LoadDepsFromLog()` made no tests fail before this change.
The new test is a port to depsmode of the existing DepFileOK test.
Nico Weber [Thu, 6 Jun 2013 01:28:00 +0000 (18:28 -0700)]
Merge pull request #592 from nico/addtest
Add test that proves `node->AddOutEdge(edge);` in `LoadDepFile()` is nee...
Nico Weber [Mon, 3 Jun 2013 23:56:46 +0000 (16:56 -0700)]
Add test that proves `node->AddOutEdge(edge);` in `LoadDepFile()` is needed.
No functionality change. Related to issue #590.
Nico Weber [Tue, 4 Jun 2013 01:54:30 +0000 (18:54 -0700)]
Merge pull request #591 from nico/fixrestat
Fix restat builds with edges generating headers depended on through deps...
Nico Weber [Mon, 3 Jun 2013 23:37:57 +0000 (16:37 -0700)]
Fix restat builds with edges generating headers depended on through deps files
in deps mode.
`ImplicitDepLoader::LoadDepFile()` already adds a depfile edge from every file
mentioned in a depfile to the depfile's output.
`ImplicitDepLoader::LoadDepsFromLog()` didn't do this yet, so add it. Else,
if a restat rule clears a generated .h file, this wouldn't propagate to cc files
depending on that .h file through a depfile.
Fixues issue #590.
Nico Weber [Wed, 29 May 2013 17:20:56 +0000 (10:20 -0700)]
Merge pull request #589 from nico/wincase
Stop `-t msvc -o` from lowercasing paths from /showIncludes output.
Nico Weber [Wed, 29 May 2013 14:37:06 +0000 (07:37 -0700)]
Stop `-t msvc -o` from lowercasing paths from /showIncludes output.
/showIncludes prints absolute paths. If a source file says
`#include <WiNdOwS.h>`, /showIncludes will use that spelling in
its output for the basename and use the on-disk cache for the
directory names in the rest for its output.
This makes the .d files created by `-t msvc -o` consistent with the
.d files written by gcc and clang.
\vBefore this change, `-t msvc -o` would convert this output to
lower case. This is a problem if a build step produces a header file
with mixed case, such as "RuntimeFeatures.h". Due to the lowercasing,
the .d file would contain "runtimefeatures.h", while the build step
will create "RuntimeFeatures.h". Due to the case difference, ninja
would not realize that regeneration of the .h file would require
a rebuild of all source files having the header in the .d file.
(On the next build, ninja would rebuild them since stat()ing is not
case-sensitive on Windows.) One possible fix for this is to make sure
that generators always write generated header files in lower case too,
but on Mac gcc doesn't do lower-casing and .d files end up with the
case-as-written, so generators would have to be different on Mac and
Windows, which is undesirable.
If case-insensitve path comparisons are useful, they should be done
somewhere else (e.g. in CanonicalizePath()) where they affect both
paths read from .d files and paths read from .ninja files. This should
then be controlled by a top-level variable.
This patch changes behavior, but it only has an effect on generated
header files, which aren't common, and it only affects -t msvc, which
is still marked as experimental. (cmake doesn't use it yet.)
(If a file has both `#include <windows.h>` and `<Windows.h>`, this
will now take 2 stat() calls instead of just one, but that should
have a negligible cost.)
Evan Martin [Wed, 29 May 2013 03:18:03 +0000 (20:18 -0700)]
Merge pull request #586 from grimmy/master
Build fails on Debian/kfreebsd
Evan Martin [Sat, 25 May 2013 15:30:57 +0000 (08:30 -0700)]
Merge pull request #588 from jonforums/mingw-fix
Fix mingw based builds. Fixes #587
Jon [Sat, 25 May 2013 14:29:24 +0000 (10:29 -0400)]
Fix mingw based builds. Fixes #587
Gary Kramlich [Sat, 25 May 2013 09:46:36 +0000 (04:46 -0500)]
Fixed the build on Debian/kfreebsd
Evan Martin [Fri, 24 May 2013 23:32:49 +0000 (16:32 -0700)]
refactor ninja main() into a struct with methods
This removes the ugly Globals struct, and the ResetState() hack.
This also eliminates the only goto!
Evan Martin [Thu, 23 May 2013 21:09:27 +0000 (14:09 -0700)]
simplify some ifdefs
Evan Martin [Thu, 23 May 2013 21:06:27 +0000 (14:06 -0700)]
factor out flag parsing from enormous NinjaMain()
Nico Weber [Fri, 24 May 2013 01:25:09 +0000 (18:25 -0700)]
Merge pull request #585 from nico/fixcrash
Don't use va_start() with reference parameters, it's undefined behavior.
Nico Weber [Fri, 24 May 2013 01:20:22 +0000 (18:20 -0700)]
Don't use va_start() with reference parameters, it's undefined behavior.
Should fix issue #584.
Evan Martin [Thu, 23 May 2013 21:22:17 +0000 (14:22 -0700)]
Merge pull request #470 from rgeary1/remotebrowser
Ninja -t browse opens localhost in browser, which doesn't work when using ssh
Evan Martin [Thu, 23 May 2013 21:15:55 +0000 (14:15 -0700)]
Merge pull request #578 from pinotree/remove-path-max
do not unconditionally use PATH_MAX with getcwd
Evan Martin [Thu, 23 May 2013 21:10:47 +0000 (14:10 -0700)]
Merge pull request #583 from tru/add_force_pselect
Added bootstrap/configure option to force pselect
Evan Martin [Thu, 23 May 2013 21:09:55 +0000 (14:09 -0700)]
Merge pull request #579 from rui314/master
Minor fixes
Tobias Hieta [Thu, 23 May 2013 13:12:53 +0000 (13:12 +0000)]
Added bootstrap/configure option to force pselect
All modern Linux kernels have ppoll() but sometimes
you might want to compile on something ancient.
This patch adds the possibility to force the use
of pselect() instead by passing --force-pselect
to bootstrap/configure.
The use of ppoll() is still default for Linux
and OpenBSD
Richard Geary [Wed, 2 Jan 2013 21:27:36 +0000 (16:27 -0500)]
Browse tool uses real hostname not localhost, to allow -t browse when using ssh
Change-Id: Ic4be6527151a7ff68afab62e61951071ad5694b7
Evan Martin [Tue, 21 May 2013 22:46:30 +0000 (15:46 -0700)]
remind myself to update the website when I make a release
Rui Ueyama [Tue, 21 May 2013 18:27:59 +0000 (11:27 -0700)]
Add error check for -j flag.
Rui Ueyama [Tue, 21 May 2013 18:27:42 +0000 (11:27 -0700)]
Fix typo in HACKING.md
Pino Toscano [Tue, 21 May 2013 10:23:22 +0000 (12:23 +0200)]
do not unconditionally use PATH_MAX with getcwd
Instead, grow a buffer until getcwd either succeeds or fails with an errno different than ERANGE
(meaning the passed buffer was too short to represent the actual path).
Reset errno before calling getcwd to check it eventually did not fail.
Evan Martin [Mon, 20 May 2013 16:32:52 +0000 (09:32 -0700)]
Merge pull request #576 from nico/newlines
Set stdout to binary mode in -t msvc.
Evan Martin [Sun, 19 May 2013 16:09:23 +0000 (09:09 -0700)]
Merge pull request #577 from tfarina/structs
structs not classes.
Thiago Farina [Sun, 19 May 2013 16:02:48 +0000 (13:02 -0300)]
structs not classes.
For some reason that I do not, ninja prefers:
struct Foo {
Foo();
private:
void Blah();
};
Rather than
class Foo {
public:
Foo();
private:
void Blah();
};
This catches the last two usages of "class" in the code base.
Signed-off-by: Thiago Farina <tfarina@chromium.org>
Nico Weber [Fri, 17 May 2013 22:39:15 +0000 (15:39 -0700)]
Set stdout to binary mode in -t msvc.
Fixes issue #575.
Evan Martin [Fri, 17 May 2013 20:50:43 +0000 (13:50 -0700)]
Merge pull request #574 from sgraham/no-extra-nl
don't print output with extra newline
Scott Graham [Fri, 17 May 2013 20:28:14 +0000 (13:28 -0700)]
don't print output with extra newline
Nico Weber [Fri, 17 May 2013 20:16:43 +0000 (13:16 -0700)]
Merge pull request #573 from sgraham/truncate-win
fix truncate compile error in ninja_test on windows
Scott Graham [Fri, 17 May 2013 20:14:07 +0000 (13:14 -0700)]
fix truncate compile error in ninja_test on windows
Evan Martin [Fri, 17 May 2013 15:32:04 +0000 (08:32 -0700)]
require version 1.3 for building ninja itself
This catches the case where you use an older version on Ninja
to build a newer version of the Ninja code.
bootstrap.py always should work regardless.
Evan Martin [Thu, 16 May 2013 23:57:52 +0000 (16:57 -0700)]
remind myself to push tags
Evan Martin [Thu, 16 May 2013 23:21:41 +0000 (16:21 -0700)]
call this version 1.3.0
Evan Martin [Fri, 3 May 2013 20:16:55 +0000 (13:16 -0700)]
delete obsolete todo
Evan Martin [Tue, 14 May 2013 16:03:00 +0000 (09:03 -0700)]
Merge pull request #572 from nico/incless
Remove a few unused includes.
Nico Weber [Sun, 12 May 2013 03:40:26 +0000 (20:40 -0700)]
Remove a few unused includes.
Evan Martin [Wed, 8 May 2013 23:20:52 +0000 (16:20 -0700)]
Merge pull request #568 from riannucci/fix_test
Fix pool tests (and provide utility to fix other similar issues as well)
Nico Weber [Wed, 8 May 2013 17:03:52 +0000 (10:03 -0700)]
Merge pull request #570 from nico/fixdarwin
Fix bootstrap on OS X.
Nico Weber [Wed, 8 May 2013 17:01:15 +0000 (10:01 -0700)]
Fix bootstrap on OS X.
This was broken in
4c552c2c3cbc07acce9c1a379fee054a3f680100.
Robert Iannucci [Mon, 6 May 2013 21:51:55 +0000 (14:51 -0700)]
Fix Pool tests.
At any phase in the test where multiple edges are ready
simultaneously, acquire all edges and sort them into a predictable
order. This allows the test to execute deterministically regardless
of the order of edge allocation.
Evan Martin [Wed, 1 May 2013 21:50:38 +0000 (14:50 -0700)]
Merge pull request #565 from mdempsky/master
Add support for OpenBSD.
Matthew Dempsky [Wed, 1 May 2013 20:05:00 +0000 (13:05 -0700)]
Don't poll pipes using POLLRDHUP
POLLRDHUP is Linux-specific, and isn't necessary for polling pipes
anyway. Linux and OpenBSD both return POLLHUP if no process has the
pipe open for writing.
Nico Weber [Wed, 1 May 2013 18:52:45 +0000 (11:52 -0700)]
Merge pull request #566 from nico/tweak
minor formatting change
Nico Weber [Wed, 1 May 2013 18:51:51 +0000 (11:51 -0700)]
minor formatting change
Nico Weber [Wed, 1 May 2013 18:10:47 +0000 (11:10 -0700)]
Merge pull request #563 from nico/recompact-deps
Implement deps log recompaction.
Matthew Dempsky [Wed, 1 May 2013 18:03:27 +0000 (11:03 -0700)]
Add support for OpenBSD.
Use ppoll() on OpenBSD. Also, fix interrupt handling to recognize
that on FreeBSD and OpenBSD, an interrupt might have been delivered
even if pselect()/ppoll() don't return -1/EINTR.
Nico Weber [Tue, 30 Apr 2013 16:24:48 +0000 (09:24 -0700)]
Recompact the deps log when it gets too big.
Now that Recompact() keeps all data structures intact, it can just be
called at the beginning of a build and the build will still work.
Nico Weber [Tue, 30 Apr 2013 16:11:09 +0000 (09:11 -0700)]
Keep a DepsLog's data valid after a call to DepsLog::Recompact().
Previously, a DepsLog would become invalid after Recompact() was called,
due to Recompact() making all node ids refer to a temporary DepsLog
object constructed in Recompact().
Nico Weber [Tue, 30 Apr 2013 15:55:49 +0000 (08:55 -0700)]
Let DepsLog::RecordDeps() update its in-memory representation.
This is a behavior change, but it should be safe: Graph only queries the
deps log at startup, before running any command. Nothing else currently
queries the deps log.
Nico Weber [Tue, 30 Apr 2013 15:44:25 +0000 (08:44 -0700)]
Move updating DepsLog's deps_ array into its own function.
No functionality change.
Nico Weber [Tue, 30 Apr 2013 15:40:56 +0000 (08:40 -0700)]
Move some DepsLog::Deps initialization code into its constructor.
No functionality change.
Patrick von Reth [Tue, 30 Apr 2013 15:29:13 +0000 (08:29 -0700)]
share platform support between configure/bootstrap
Evan Martin [Tue, 30 Apr 2013 15:26:23 +0000 (08:26 -0700)]
Merge pull request #562 from TheOneRing/fixed-include
added missing windows include for Truncate
Patrick von Reth [Tue, 30 Apr 2013 07:44:11 +0000 (09:44 +0200)]
added missing windows include
Nico Weber [Mon, 29 Apr 2013 17:21:44 +0000 (10:21 -0700)]
Merge pull request #559 from nico/9_9
Fix Windows build more.
Nico Weber [Mon, 29 Apr 2013 17:20:55 +0000 (10:20 -0700)]
Fix Windows build more.
Evan Martin [Mon, 29 Apr 2013 16:02:23 +0000 (09:02 -0700)]
Merge pull request #558 from nico/buildfix
Introduce a Truncate() function that works on POSIX and Windows.