platform/upstream/ninja.git
13 years agoMerge pull request #89 from tfarina/state
Evan Martin [Sat, 3 Sep 2011 20:38:44 +0000 (13:38 -0700)]
Merge pull request #89 from tfarina/state

Factor out State struct from ninja_jumble.cc into its header/source files

13 years agoFactor out State struct from ninja_jumble.cc into its header/source files.
Thiago Farina [Fri, 26 Aug 2011 23:58:28 +0000 (20:58 -0300)]
Factor out State struct from ninja_jumble.cc into its header/source files.

This was a TODO in src/ninja_jumble.cc. Now this task is completed.

Signed-off-by: Thiago Farina <tfarina@chromium.org>
13 years agoMerge pull request #92 from pcc/fix-warning
Evan Martin [Sat, 3 Sep 2011 15:52:18 +0000 (08:52 -0700)]
Merge pull request #92 from pcc/fix-warning

Fix a Clang self-assign warning by casting result to void

13 years agoMerge pull request #90 from pcc/default-target-statements
Evan Martin [Sat, 3 Sep 2011 15:37:03 +0000 (08:37 -0700)]
Merge pull request #90 from pcc/default-target-statements

Implement default target statements

13 years agoFix a Clang self-assign warning by casting result to void
Peter Collingbourne [Wed, 31 Aug 2011 17:55:38 +0000 (18:55 +0100)]
Fix a Clang self-assign warning by casting result to void

13 years agoImplement default target statements
Peter Collingbourne [Wed, 31 Aug 2011 03:55:35 +0000 (04:55 +0100)]
Implement default target statements

This introduces a new directive, the default target statement, which
may be used to control the list of targets built by default (i.e. if
no target is named on the command line).

13 years agoninja_syntax.py: add include and subninja
Evan Martin [Mon, 29 Aug 2011 18:19:22 +0000 (11:19 -0700)]
ninja_syntax.py: add include and subninja

13 years agoMerge pull request #87 from tfarina/fix-ninja-compilation
Evan Martin [Fri, 26 Aug 2011 20:40:45 +0000 (13:40 -0700)]
Merge pull request #87 from tfarina/fix-ninja-compilation

Fix ninja compilation by including a missing disk_interface.h.

13 years agoFix ninja compilation by including a missing disk_interface.h.
Thiago Farina [Thu, 25 Aug 2011 20:00:38 +0000 (17:00 -0300)]
Fix ninja compilation by including a missing disk_interface.h.

When running ./ninja the compilation fails because test.h uses DiskInterface but
doesn't include disk_interface.h to get the declaration.

Signed-off-by: Thiago Farina <tfarina@chromium.org>
13 years agoMerge pull request #86 from tfarina/real-disk-interface
Evan Martin [Thu, 25 Aug 2011 15:02:51 +0000 (08:02 -0700)]
Merge pull request #86 from tfarina/real-disk-interface

Move RealDiskInterface class to disk_interface.h.

13 years agoMove RealDiskInterface class to disk_interface.h.
Thiago Farina [Wed, 24 Aug 2011 00:33:41 +0000 (21:33 -0300)]
Move RealDiskInterface class to disk_interface.h.

This is a TODO in src/ninja_jumble.cc

Signed-off-by: Thiago Farina <tfarina@chromium.org>
13 years agosemantic change: allow reaching into parent directories in paths
Evan Martin [Wed, 24 Aug 2011 22:49:41 +0000 (15:49 -0700)]
semantic change: allow reaching into parent directories in paths

This allows generating build files in a subdirectory of your source tree.
- Change CanonicalizePath to accept this.
- CanonicalizePath no longer has an error condition, so change it to a void
  function.

I profiled the result against Chrome and it might be ~100ms slower, but that
might just be Chrome's size working against me.  In any case I think there
are lower-hanging performance fruit elsewhere.

13 years agoMerge pull request #82 from tfarina/disk-interface
Evan Martin [Tue, 23 Aug 2011 16:17:23 +0000 (09:17 -0700)]
Merge pull request #82 from tfarina/disk-interface

Factor out DiskInterface class into its own source/header files.

13 years agoMerge pull request #83 from rlarocque2/master
Evan Martin [Thu, 18 Aug 2011 17:38:45 +0000 (10:38 -0700)]
Merge pull request #83 from rlarocque2/master

Update configure.py following ninja.py rename

13 years agoUpdate configure.py for ninja module rename
Richard Larocque [Wed, 17 Aug 2011 18:32:39 +0000 (11:32 -0700)]
Update configure.py for ninja module rename

13 years agorename ninja module to ninja_syntax
Evan Martin [Tue, 9 Aug 2011 20:38:43 +0000 (13:38 -0700)]
rename ninja module to ninja_syntax

13 years agoadd escaping function to python module
Evan Martin [Tue, 9 Aug 2011 20:21:21 +0000 (13:21 -0700)]
add escaping function to python module

13 years agoFactor out DiskInterface class into its own source/header files.
Thiago Farina [Wed, 10 Aug 2011 12:47:32 +0000 (09:47 -0300)]
Factor out DiskInterface class into its own source/header files.

This is a TODO in src/ninja_jumble.cc

Signed-off-by: Thiago Farina <tfarina@chromium.org>
13 years agoMerge pull request #80 from tfarina/master
Evan Martin [Wed, 10 Aug 2011 03:31:45 +0000 (20:31 -0700)]
Merge pull request #80 from tfarina/master

fix trivial style issue.

13 years agoFix trivial style issues with Cleaner class.
Thiago Farina [Tue, 9 Aug 2011 23:07:50 +0000 (20:07 -0300)]
Fix trivial style issues with Cleaner class.

Signed-off-by: Thiago Farina <tfarina@chromium.org>
13 years agofix double-indenting
Evan Martin [Wed, 27 Jul 2011 17:06:52 +0000 (10:06 -0700)]
fix double-indenting

13 years agoninja.py: fix the new test and pass the test
Evan Martin [Wed, 27 Jul 2011 16:59:22 +0000 (09:59 -0700)]
ninja.py: fix the new test and pass the test

From a patch from Elazar Leibovich <elazarl@gmail.com>.

13 years agounit test for line-wrapping in ninja.py
Evan Martin [Wed, 27 Jul 2011 16:35:50 +0000 (09:35 -0700)]
unit test for line-wrapping in ninja.py

From a patch from Elazar Leibovich <elazarl@gmail.com>.

13 years agodon't track line/column until you encounter an error, then re-parse
Evan Martin [Tue, 26 Jul 2011 00:51:47 +0000 (17:51 -0700)]
don't track line/column until you encounter an error, then re-parse

This speeds up the common case (where you don't need a line number)
at the small expense of the uncommon case (for error messages, you
do need a line number).  And it's less code.

13 years agoadd a --debug option to configure
Evan Martin [Mon, 25 Jul 2011 18:22:33 +0000 (11:22 -0700)]
add a --debug option to configure

13 years agodon't leak the build_log file descriptor into subprocesses
Evan Martin [Thu, 30 Jun 2011 17:31:25 +0000 (10:31 -0700)]
don't leak the build_log file descriptor into subprocesses

Closes issue #74.

13 years agoclean: don't delete phony targets
Evan Martin [Thu, 30 Jun 2011 17:20:54 +0000 (10:20 -0700)]
clean: don't delete phony targets

Based on a patch from John Birtley.

13 years agoMerge pull request #73 from qhuo/setvbuf
Evan Martin [Thu, 30 Jun 2011 17:17:20 +0000 (10:17 -0700)]
Merge pull request #73 from qhuo/setvbuf

Set stdout to line-buffered.

13 years agoSet stdout to line-buffered.
Qingning Huo [Tue, 28 Jun 2011 18:56:39 +0000 (19:56 +0100)]
Set stdout to line-buffered.

13 years agoMerge pull request #71 from jbirtley/master
Evan Martin [Tue, 28 Jun 2011 17:43:57 +0000 (10:43 -0700)]
Merge pull request #71 from jbirtley/master

Fix for long command lines in Win32

13 years agoFix for win32 long command lines:
U-MATHLETE\John [Sun, 26 Jun 2011 11:25:45 +0000 (12:25 +0100)]
Fix for win32 long command lines:

    - remove 'cmd /c' prepend from SubProcess::Start()

    - fix the subprocess tests to prepend 'cmd /c' explicitly

13 years agoFix for 'pipe has ended' errors on Win32 distributed builds
Evan Martin [Sat, 25 Jun 2011 20:16:43 +0000 (13:16 -0700)]
Fix for 'pipe has ended' errors on Win32 distributed builds

Patch from John Birtley.

13 years agoMerge pull request #69 from Roorback/master
Evan Martin [Sat, 25 Jun 2011 20:02:58 +0000 (13:02 -0700)]
Merge pull request #69 from Roorback/master

Path to python interpreter (on FreeBSD)

13 years agoMerge pull request #70 from scottfranklin/master
Evan Martin [Sat, 25 Jun 2011 19:56:23 +0000 (12:56 -0700)]
Merge pull request #70 from scottfranklin/master

Add tab-completion for zsh.

13 years agoadd docs on variable expansion
Evan Martin [Sat, 25 Jun 2011 19:37:39 +0000 (12:37 -0700)]
add docs on variable expansion

13 years agomention python module in the docs
Evan Martin [Sat, 25 Jun 2011 19:15:18 +0000 (12:15 -0700)]
mention python module in the docs

13 years agoAdding tab-completion function for zsh.
Scott Franklin [Thu, 23 Jun 2011 01:40:12 +0000 (18:40 -0700)]
Adding tab-completion function for zsh.

13 years agoRespect $CXX, fallback to 'g++' in bootstrap.sh
Grzegorz Blach [Tue, 21 Jun 2011 19:07:07 +0000 (21:07 +0200)]
Respect $CXX, fallback to 'g++' in bootstrap.sh

13 years agouse /usr/bin/env to find python interpreter
Grzegorz Blach [Mon, 20 Jun 2011 20:35:34 +0000 (22:35 +0200)]
use /usr/bin/env to find python interpreter

13 years agoMerge pull request #62 from qhuo/multiple-outputs-fix
Evan Martin [Thu, 16 Jun 2011 01:12:42 +0000 (18:12 -0700)]
Merge pull request #62 from qhuo/multiple-outputs-fix

Add a test for the multiple outputs fix

13 years agoAdd a test for the multiple outputs fix
Qingning Huo [Tue, 14 Jun 2011 21:54:30 +0000 (22:54 +0100)]
Add a test for the multiple outputs fix

13 years agoMerge pull request #59 from qhuo/multiple-outputs-fix
Evan Martin [Tue, 14 Jun 2011 02:28:02 +0000 (19:28 -0700)]
Merge pull request #59 from qhuo/multiple-outputs-fix

Multiple outputs fix: make $out include all outptus

13 years agosrc/graph.cc: fix EdgeEnv::LookupVariable
Qingning Huo [Fri, 10 Jun 2011 23:13:33 +0000 (00:13 +0100)]
src/graph.cc: fix EdgeEnv::LookupVariable

Make it return the correct value for "out" when there are multiple outputs.
It used to return only the first target file.

13 years agobuild_log_test.cc: add 3 #include for stat(2) on Linux
Qingning Huo [Fri, 10 Jun 2011 22:37:31 +0000 (23:37 +0100)]
build_log_test.cc: add 3 #include for stat(2) on Linux

13 years agoremove +x bit from source
Evan Martin [Fri, 3 Jun 2011 18:42:58 +0000 (11:42 -0700)]
remove +x bit from source

13 years agoOn Windows, ninja didn't create needed paths first
Philip Craig [Sun, 29 May 2011 18:24:46 +0000 (19:24 +0100)]
On Windows, ninja didn't create needed paths first

Now it does. Still works as it should on linux too.

The canonical example that now works on Windows is:

builddir = build

rule copy
command = copy $in $out

build $builddir\fred\test.out: copy test.in

13 years agoMerge branch 'master' of github.com:martine/ninja
Evan Martin [Tue, 31 May 2011 16:42:50 +0000 (09:42 -0700)]
Merge branch 'master' of github.com:martine/ninja

13 years agoninja: Split StatCache struct into its own header file.
Thiago Farina [Tue, 31 May 2011 16:36:23 +0000 (13:36 -0300)]
ninja: Split StatCache struct into its own header file.

Note: This is a TODO in ninja_jumble.cc.

Signed-off-by: Thiago Farina <tfarina@chromium.org>
13 years agoMerge pull request #51 from philipcraig/master
Evan Martin [Sun, 29 May 2011 17:20:56 +0000 (10:20 -0700)]
Merge pull request #51 from philipcraig/master

mingw ninja_test links and passes. (as do linux and native VS2010)

13 years agomingw ninja_test links and passes. (as do linux and native VS2010)
Philip Craig [Sun, 29 May 2011 08:18:49 +0000 (09:18 +0100)]
mingw ninja_test links and passes. (as do linux and native VS2010)

Use chsize instead of truncate for mingw compatibility
SubprocessTest uses DoWork to force Subprocesses to execute
Drop GoodCommandStdOut test as it is tested in SetWithSingle

13 years agoMerge pull request #50 from philipcraig/master
Evan Martin [Sat, 28 May 2011 19:07:21 +0000 (12:07 -0700)]
Merge pull request #50 from philipcraig/master

Fixes to let native builds on Visual Studio 2010 build, pass tests

13 years agoTests now build on a native Windows build (tested with VS2010)
Philip Craig [Sat, 28 May 2011 08:28:01 +0000 (09:28 +0100)]
Tests now build on a native Windows build (tested with VS2010)
All tests except SubProcess pass on a native Windows build
Tests continue not to build on a platform=mingw build

13 years agouse 0 for NULL in test to silence gcc 4.5 warning
Evan Martin [Fri, 27 May 2011 18:47:14 +0000 (11:47 -0700)]
use 0 for NULL in test to silence gcc 4.5 warning

13 years agoexpand $$ as $
Evan Martin [Fri, 27 May 2011 03:15:05 +0000 (20:15 -0700)]
expand $$ as $

13 years agoswitch to $ as the line continuation char
Evan Martin [Sun, 22 May 2011 17:15:11 +0000 (10:15 -0700)]
switch to $ as the line continuation char

This means that backslashes are passed through without interpretation,
allowing us to support Windows paths without worrying about escaping.

13 years agoperftest: print summary info at end
Evan Martin [Wed, 25 May 2011 17:54:11 +0000 (10:54 -0700)]
perftest: print summary info at end

13 years agoadd --profile configure flag
Evan Martin [Wed, 25 May 2011 17:38:00 +0000 (10:38 -0700)]
add --profile configure flag

13 years agoadd more test coverage for makefile parsing
Evan Martin [Wed, 25 May 2011 02:04:11 +0000 (19:04 -0700)]
add more test coverage for makefile parsing

13 years agoadd a test program for evaluating depfile parse speed
Evan Martin [Tue, 24 May 2011 17:07:08 +0000 (10:07 -0700)]
add a test program for evaluating depfile parse speed

13 years agomove GetTimeMillis to util
Evan Martin [Tue, 24 May 2011 16:55:39 +0000 (09:55 -0700)]
move GetTimeMillis to util

13 years agomove ReadFile into util
Evan Martin [Tue, 24 May 2011 16:47:24 +0000 (09:47 -0700)]
move ReadFile into util

13 years agorefactor let parsing, passing another test
Evan Martin [Tue, 24 May 2011 03:48:54 +0000 (20:48 -0700)]
refactor let parsing, passing another test

13 years agorefactor
Evan Martin [Mon, 23 May 2011 16:30:33 +0000 (09:30 -0700)]
refactor

13 years agoshow correct location for unexpected var error
Evan Martin [Mon, 23 May 2011 16:26:16 +0000 (09:26 -0700)]
show correct location for unexpected var error

13 years agorefactor parser, check in some failing tests
Evan Martin [Mon, 23 May 2011 16:17:39 +0000 (09:17 -0700)]
refactor parser, check in some failing tests

13 years agoemacs: highlight variable expansions too
Evan Martin [Sun, 22 May 2011 17:28:09 +0000 (10:28 -0700)]
emacs: highlight variable expansions too

13 years agomerge two line continuation codepaths
Evan Martin [Sun, 22 May 2011 17:11:15 +0000 (10:11 -0700)]
merge two line continuation codepaths

13 years agoinclude filename in subninja load err message
Evan Martin [Sun, 22 May 2011 16:25:34 +0000 (09:25 -0700)]
include filename in subninja load err message

13 years agoupdate obsolete HACKING notes
Evan Martin [Fri, 20 May 2011 16:06:44 +0000 (09:06 -0700)]
update obsolete HACKING notes

13 years agodon't recompact log often for small programs
Evan Martin [Wed, 18 May 2011 05:35:34 +0000 (22:35 -0700)]
don't recompact log often for small programs

13 years agomake the phony depfile edge order-only
Evan Martin [Tue, 17 May 2011 23:36:30 +0000 (16:36 -0700)]
make the phony depfile edge order-only

I'm not sure this is semantically different but it's consistent with
how I think about these phony edges.

13 years agodon't mangle absolute paths in the canonicalizer
Evan Martin [Tue, 17 May 2011 23:35:32 +0000 (16:35 -0700)]
don't mangle absolute paths in the canonicalizer

We frequently do use absolute paths when depfiles refer to
e.g. /usr/include/stdio.h.

13 years agoadd extra check for no error in build test
Evan Martin [Tue, 17 May 2011 22:37:52 +0000 (15:37 -0700)]
add extra check for no error in build test

13 years agoupdate instructions on using gyp; mention cmake
Evan Martin [Tue, 17 May 2011 22:27:00 +0000 (15:27 -0700)]
update instructions on using gyp; mention cmake

13 years agosimplify CommandRunner, simplifying users too
Evan Martin [Tue, 17 May 2011 17:38:23 +0000 (10:38 -0700)]
simplify CommandRunner, simplifying users too

After much staring at this I think I found the more clear way to
express what it's doing.

13 years agorearrange build loop, pass new test
Evan Martin [Tue, 17 May 2011 17:10:40 +0000 (10:10 -0700)]
rearrange build loop, pass new test

13 years agocheck in failing test that hits the "stuck" state
Evan Martin [Tue, 17 May 2011 16:54:23 +0000 (09:54 -0700)]
check in failing test that hits the "stuck" state

13 years agoMerge pull request #46 from iwadon/fix-asciidoc-args
Evan Martin [Tue, 17 May 2011 17:34:00 +0000 (10:34 -0700)]
Merge pull request #46 from iwadon/fix-asciidoc-args

fix the error: 'asciidoc: To many arguments'

13 years agofix the error: 'asciidoc: To many arguments'
Hiroyuki Iwatsuki [Sun, 15 May 2011 23:38:11 +0000 (08:38 +0900)]
fix the error: 'asciidoc: To many arguments'

13 years agomove various doc files out of top-level directory
Evan Martin [Sat, 14 May 2011 23:11:41 +0000 (16:11 -0700)]
move various doc files out of top-level directory

13 years agoshow started, not finished, edges in progress
Evan Martin [Sat, 14 May 2011 22:43:23 +0000 (15:43 -0700)]
show started, not finished, edges in progress

In verbose mode (where we don't overprint) it's confusing to show
[0/XX] for the first N commands we start.  In smart terminal mode,
I can't really tell the difference.

13 years agocorrectly compute truncation margin
Evan Martin [Sat, 14 May 2011 22:34:13 +0000 (15:34 -0700)]
correctly compute truncation margin

13 years agorefactor status printing into BuildStatus
Evan Martin [Sat, 14 May 2011 22:17:50 +0000 (15:17 -0700)]
refactor status printing into BuildStatus

Centralizing printing allows being more careful about what is output.
1) Always include the [2/15] prefix on commands.
2) Make the header command match the error output command.

13 years agohide internals of BuildStatus
Evan Martin [Sat, 14 May 2011 21:29:27 +0000 (14:29 -0700)]
hide internals of BuildStatus

13 years agoremove order-only hacks now that semantics changed
Evan Martin [Fri, 13 May 2011 23:24:27 +0000 (16:24 -0700)]
remove order-only hacks now that semantics changed

13 years agoSEMANTIC CHANGE: implicit inputs are now required to exist
Evan Martin [Fri, 13 May 2011 17:47:26 +0000 (10:47 -0700)]
SEMANTIC CHANGE: implicit inputs are now required to exist

Edges found through depfiles are special: they get an extra
empty "phony" rule.  (This is identical to the way you hack this
with Makefiles.)

13 years agotweak browse appearance
Evan Martin [Fri, 13 May 2011 16:07:43 +0000 (09:07 -0700)]
tweak browse appearance

13 years agomake browse work for all ninja paths
Evan Martin [Fri, 13 May 2011 15:53:02 +0000 (08:53 -0700)]
make browse work for all ninja paths

Pass the path to the ninja binary in to the Python script.
Confusingly, in some places the variables were already in place
to do this, but they were accidentally used for something else
entirely.

13 years agorefix recompaction
Evan Martin [Thu, 12 May 2011 21:01:52 +0000 (14:01 -0700)]
refix recompaction

Like all untested quick fixes, my previous quick fix actually introduced
a reliable segfault.

13 years agoquick fix: write out signature in recompaction
Evan Martin [Wed, 11 May 2011 18:33:55 +0000 (11:33 -0700)]
quick fix: write out signature in recompaction

This needs refactoring but I already pushed the bad code so this
hopefully makes it less broken.

13 years agodon't crash on truncated log files
Evan Martin [Wed, 11 May 2011 16:58:29 +0000 (09:58 -0700)]
don't crash on truncated log files

Add a test that tries all truncations of a log file and verifies it
doesn't crash.

13 years agoadd a versioning header to build log, switch to v2
Evan Martin [Mon, 9 May 2011 23:24:24 +0000 (16:24 -0700)]
add a versioning header to build log, switch to v2

In v2 we store both the start and end time of the command.
This allows better visualization of the build process.

13 years agoclang note
Evan Martin [Tue, 10 May 2011 16:35:10 +0000 (09:35 -0700)]
clang note

13 years agoMerge pull request #44 from polrop/update-todo
Evan Martin [Tue, 10 May 2011 16:04:09 +0000 (09:04 -0700)]
Merge pull request #44 from polrop/update-todo

Update the todo list since -k is implemented now.

13 years agoMerge pull request #43 from polrop/fix-bootstrap-for-dash
Evan Martin [Tue, 10 May 2011 16:03:58 +0000 (09:03 -0700)]
Merge pull request #43 from polrop/fix-bootstrap-for-dash

Fix bootstrap script for dash.

13 years agoUpdate the todo list since -k is implemented now.
Nicolas Despres [Tue, 10 May 2011 13:58:47 +0000 (15:58 +0200)]
Update the todo list since -k is implemented now.

13 years agoFix bootstrap script for dash.
Nicolas Despres [Tue, 10 May 2011 13:55:21 +0000 (15:55 +0200)]
Fix bootstrap script for dash.

On Ubuntu /bin/sh is a link to dash.  The bootstrap script reported a
'Bad substitution' error line 39 when interpreted by dash.  This patch fix the
problem.

13 years agofix test
Evan Martin [Mon, 9 May 2011 23:24:47 +0000 (16:24 -0700)]
fix test

13 years agomake platform a command-line arg to configure
Evan Martin [Mon, 9 May 2011 15:58:13 +0000 (08:58 -0700)]
make platform a command-line arg to configure

13 years agoexpose -k flag to users
Evan Martin [Mon, 9 May 2011 15:50:25 +0000 (08:50 -0700)]
expose -k flag to users