platform/upstream/ninja.git
11 years agoRevert "Dump state for debugging"
Robert Iannucci [Sat, 10 Nov 2012 19:58:04 +0000 (11:58 -0800)]
Revert "Dump state for debugging"

This reverts commit 9b196dc806e57cefd88bbbacd12286447dbf9ad9.

11 years agoUninitialized variable! There is always one...
Robert Iannucci [Sat, 10 Nov 2012 19:54:13 +0000 (11:54 -0800)]
Uninitialized variable! There is always one...

11 years agoDump state for debugging
Robert Iannucci [Sat, 10 Nov 2012 19:45:54 +0000 (11:45 -0800)]
Dump state for debugging

11 years agoMake edge dump pool name, and skip default pool
Robert Iannucci [Sat, 10 Nov 2012 19:35:02 +0000 (11:35 -0800)]
Make edge dump pool name, and skip default pool

11 years agocover the nulled pool case
Robert Iannucci [Sat, 10 Nov 2012 05:46:45 +0000 (21:46 -0800)]
cover the nulled pool case

11 years agoadd docs
Robert Iannucci [Sat, 10 Nov 2012 05:37:54 +0000 (21:37 -0800)]
add docs

11 years agoAdd some tests!
Robert Iannucci [Sat, 10 Nov 2012 05:12:48 +0000 (21:12 -0800)]
Add some tests!

11 years agobegin rationalizing platform for both parsers
Robert Iannucci [Mon, 1 Oct 2012 20:07:42 +0000 (13:07 -0700)]
begin rationalizing platform for both parsers

11 years agoblock parse method done
Robert Iannucci [Thu, 27 Sep 2012 23:37:37 +0000 (16:37 -0700)]
block parse method done

11 years agoall building and tests passing
Robert Iannucci [Fri, 9 Nov 2012 23:47:06 +0000 (15:47 -0800)]
all building and tests passing

11 years agoDump pools with State
Robert Iannucci [Fri, 9 Nov 2012 20:07:12 +0000 (12:07 -0800)]
Dump pools with State

11 years agoFix a bug... now chrome build works O_O
Robert Iannucci [Thu, 4 Oct 2012 23:50:24 +0000 (16:50 -0700)]
Fix a bug... now chrome build works O_O

11 years agoand some basic implementation
Robert Iannucci [Thu, 4 Oct 2012 00:25:23 +0000 (17:25 -0700)]
and some basic implementation

11 years agostub out an api and de-constify Pool
Robert Iannucci [Wed, 3 Oct 2012 23:27:27 +0000 (16:27 -0700)]
stub out an api and de-constify Pool

11 years agoConst ref FTW
Robert Iannucci [Mon, 1 Oct 2012 21:12:59 +0000 (14:12 -0700)]
Const ref FTW

11 years agoPull graph.cc too
Robert Iannucci [Mon, 1 Oct 2012 20:58:30 +0000 (13:58 -0700)]
Pull graph.cc too

11 years agoPull out base changes to state
Robert Iannucci [Mon, 1 Oct 2012 20:51:00 +0000 (13:51 -0700)]
Pull out base changes to state

11 years agorefactor repeated code in cleaner
Evan Martin [Mon, 29 Oct 2012 16:53:30 +0000 (09:53 -0700)]
refactor repeated code in cleaner

11 years agodelete some obsolete TODOs
Evan Martin [Sat, 27 Oct 2012 19:56:31 +0000 (12:56 -0700)]
delete some obsolete TODOs

11 years agotrailing whitespace
Evan Martin [Sat, 27 Oct 2012 19:52:46 +0000 (12:52 -0700)]
trailing whitespace

11 years agoMerge pull request #453 from curinir/bash_completion
Evan Martin [Wed, 31 Oct 2012 05:01:44 +0000 (22:01 -0700)]
Merge pull request #453 from curinir/bash_completion

Add support for reading directory for bash completion.

11 years agoAdd support for reading directory for bash completion.
Tommy Nyquist [Tue, 30 Oct 2012 22:28:02 +0000 (15:28 -0700)]
Add support for reading directory for bash completion.

Currently ninja bash completion only works in the directory where the
build.ninja files is located. This adds support for using the -C
argument to ninja.

11 years agoMerge pull request #451 from ppuryear/browse-python3
Evan Martin [Sat, 27 Oct 2012 03:18:10 +0000 (20:18 -0700)]
Merge pull request #451 from ppuryear/browse-python3

browse.py: Support Python 3.

11 years agobrowse.py: Don't truncate error message if ninja -t query fails.
Philip Puryear [Fri, 26 Oct 2012 21:56:48 +0000 (16:56 -0500)]
browse.py: Don't truncate error message if ninja -t query fails.

Signed-off-by: Philip Puryear <philippuryear@gmail.com>
11 years agobrowse.py: Fix truncation with an unknown target.
Philip Puryear [Fri, 26 Oct 2012 03:43:03 +0000 (22:43 -0500)]
browse.py: Fix truncation with an unknown target.

Signed-off-by: Philip Puryear <philippuryear@gmail.com>
11 years agobrowse.py: Python 3 support.
Philip Puryear [Fri, 26 Oct 2012 03:41:20 +0000 (22:41 -0500)]
browse.py: Python 3 support.

Signed-off-by: Philip Puryear <philippuryear@gmail.com>
11 years agofix bad merge
Evan Martin [Tue, 23 Oct 2012 16:37:55 +0000 (09:37 -0700)]
fix bad merge

11 years agomingw helper: drop unused -r flag
Evan Martin [Mon, 8 Oct 2012 23:31:15 +0000 (16:31 -0700)]
mingw helper: drop unused -r flag

11 years agoupdate mingw docs for ubuntu precise
Evan Martin [Mon, 8 Oct 2012 23:30:27 +0000 (16:30 -0700)]
update mingw docs for ubuntu precise

11 years agofix whitespace
Evan Martin [Mon, 8 Oct 2012 17:09:12 +0000 (10:09 -0700)]
fix whitespace

11 years agobootstrap: fail more gracefully if gcc isn't available
Evan Martin [Fri, 28 Sep 2012 17:05:34 +0000 (10:05 -0700)]
bootstrap: fail more gracefully if gcc isn't available

11 years agoMerge pull request #450 from zchothia/zc/py3k
Evan Martin [Sun, 21 Oct 2012 19:20:33 +0000 (12:20 -0700)]
Merge pull request #450 from zchothia/zc/py3k

Add support for Python 3

11 years agoPython scripts: use built-in print function.
Zaheer Chothia [Fri, 19 Oct 2012 07:46:09 +0000 (09:46 +0200)]
Python scripts: use built-in print function.

11 years agoAdd support for Python 3
Zaheer Chothia [Thu, 18 Oct 2012 13:02:48 +0000 (15:02 +0200)]
Add support for Python 3

11 years agoMerge pull request #441 from tfarina/missing-virtual
Evan Martin [Wed, 17 Oct 2012 18:54:45 +0000 (11:54 -0700)]
Merge pull request #441 from tfarina/missing-virtual

Add missing 'virtual' annotation to ReadFile() override.

11 years agoAdd missing 'virtual' annotation to ReadFile() override.
Thiago Farina [Tue, 9 Oct 2012 02:48:11 +0000 (23:48 -0300)]
Add missing 'virtual' annotation to ReadFile() override.

Signed-off-by: Thiago Farina <tfarina@chromium.org>
11 years agoMerge pull request #448 from maximuska/proposed/buildlog-mini-refactor2
Evan Martin [Wed, 17 Oct 2012 05:28:06 +0000 (22:28 -0700)]
Merge pull request #448 from maximuska/proposed/buildlog-mini-refactor2

Proposed/buildlog mini refactor2

11 years agobuild log: fixing parameter names
Maxim Kalaev [Sun, 14 Oct 2012 18:40:46 +0000 (20:40 +0200)]
build log: fixing parameter names

11 years agoMerge pull request #446 from maximuska/proposed/start-end-edge-metrics
Evan Martin [Fri, 12 Oct 2012 17:03:21 +0000 (10:03 -0700)]
Merge pull request #446 from maximuska/proposed/start-end-edge-metrics

build metrics: StartEdge and EndEdge

11 years agobuild metrics: StartEdge and EndEdge
Maxim Kalaev [Fri, 12 Oct 2012 06:16:06 +0000 (08:16 +0200)]
build metrics: StartEdge and EndEdge

Total build time is also relevant.
The costs of StartEdge and EndEdge turned out to be quite surprising.
Especially if multiple targets are specified on edges.
 (I've tried declaring depfiles targets explicitly)

11 years agobuild log: mini-refactoring to use constructors to initialize entries
Maxim Kalaev [Fri, 12 Oct 2012 06:59:49 +0000 (08:59 +0200)]
build log: mini-refactoring to use constructors to initialize entries

11 years agobuild log: moving HashCommand() calculation out of targets loop
Maxim Kalaev [Fri, 12 Oct 2012 06:57:23 +0000 (08:57 +0200)]
build log: moving HashCommand() calculation out of targets loop

11 years agobuild log: Adding test for multiple target edges
Maxim Kalaev [Sat, 6 Oct 2012 21:16:21 +0000 (23:16 +0200)]
build log: Adding test for multiple target edges

11 years agoMerge pull request #439 from wolfp/metric-recompact
Evan Martin [Thu, 4 Oct 2012 22:52:47 +0000 (15:52 -0700)]
Merge pull request #439 from wolfp/metric-recompact

Add metric for log recompacting

11 years agoAdd metric for log recompacting
Petr Wolf [Thu, 4 Oct 2012 20:07:25 +0000 (16:07 -0400)]
Add metric for log recompacting

11 years agoMerge pull request #438 from wolfp/clean-efficiency
Evan Martin [Thu, 4 Oct 2012 19:53:32 +0000 (12:53 -0700)]
Merge pull request #438 from wolfp/clean-efficiency

Improve the efficiency of -t clean

11 years agoImprove the efficiency of -t clean
Petr Wolf [Thu, 4 Oct 2012 19:42:15 +0000 (15:42 -0400)]
Improve the efficiency of -t clean

Prevent each node from being examined for cleaning multiple times, if it
is used in several other nodes

11 years agoMerge pull request #437 from mo/master
Evan Martin [Wed, 3 Oct 2012 20:05:26 +0000 (13:05 -0700)]
Merge pull request #437 from mo/master

[PATCH] Fixed two spelling errors in ninja

11 years agoFix two spelling errors
Martin Olsson [Wed, 3 Oct 2012 08:10:53 +0000 (10:10 +0200)]
Fix two spelling errors

11 years agoMerge pull request #436 from tfarina/dry-run-unnamed-namespace
Evan Martin [Tue, 2 Oct 2012 19:05:29 +0000 (12:05 -0700)]
Merge pull request #436 from tfarina/dry-run-unnamed-namespace

Move DryRunCommandRunner into a unnamed namespace.

11 years agoMove DryRunCommandRunner into a unnamed namespace.
Thiago Farina [Tue, 2 Oct 2012 01:13:39 +0000 (22:13 -0300)]
Move DryRunCommandRunner into a unnamed namespace.

No functional change.

Signed-off-by: Thiago Farina <tfarina@chromium.org>
11 years agoMerge pull request #433 from polrop/fix-help-option
Evan Martin [Sun, 30 Sep 2012 17:20:51 +0000 (10:20 -0700)]
Merge pull request #433 from polrop/fix-help-option

Don't say -h is invalid whereas it is supported.

11 years agoDon't say -h is invalid whereas it is supported.
Nicolas Despres [Thu, 27 Sep 2012 18:49:22 +0000 (20:49 +0200)]
Don't say -h is invalid whereas it is supported.

getopt_long(3) was reporting "ninja: invalid option -- h" when "ninja -h" was
called.

Regression most probably introduced by 5fdb12ed5cec4e1c853c64026142d088ff5519e1

11 years agoMerge pull request #428 from maximuska/proposed/rpm-build-fixed
Evan Martin [Sun, 23 Sep 2012 16:51:39 +0000 (09:51 -0700)]
Merge pull request #428 from maximuska/proposed/rpm-build-fixed

packaging: refactored rpm building

11 years agopackaging: refactored rpm building
Maxim Kalaev [Fri, 14 Sep 2012 10:46:01 +0000 (13:46 +0300)]
packaging: refactored rpm building

Now passing through a valid SRPM, working in a standard way.

11 years agoMerge pull request #427 from jonforums/jf/mingw-n-msvc
Evan Martin [Fri, 21 Sep 2012 22:36:52 +0000 (15:36 -0700)]
Merge pull request #427 from jonforums/jf/mingw-n-msvc

fix mingw build fail - redux

11 years agoMerge pull request #426 from sgraham/spaces-in-headers-2
Evan Martin [Thu, 20 Sep 2012 21:47:32 +0000 (14:47 -0700)]
Merge pull request #426 from sgraham/spaces-in-headers-2

fix spaces in headers for -t msvc

11 years agoAlways include stdio.h
Jon [Thu, 20 Sep 2012 17:46:41 +0000 (13:46 -0400)]
Always include stdio.h

11 years agoless random comment
Scott Graham [Thu, 20 Sep 2012 17:01:25 +0000 (10:01 -0700)]
less random comment

11 years agoreview fixes
Scott Graham [Thu, 20 Sep 2012 16:36:37 +0000 (09:36 -0700)]
review fixes

11 years agoSilence bothersome warning from -Wextra
Jon [Thu, 20 Sep 2012 14:08:30 +0000 (10:08 -0400)]
Silence bothersome warning from -Wextra

Struct initializations such as those in `CLWrapper::Run` of file
`src/msvc_helper-win32.cc` causes MinGW GCC to spew warnings.

11 years agoGive MinGW builds MSVC build helper superpowers
Jon [Thu, 20 Sep 2012 14:05:11 +0000 (10:05 -0400)]
Give MinGW builds MSVC build helper superpowers

Note: _WIN32 is used instead of WIN32 to enable builds with MSVC
IDE, Windows SDK non-IDE command line tools, and mingw/mingw-w64
based toolchains

11 years agofix spaces in headers for -t msvc
Scott Graham [Thu, 20 Sep 2012 00:15:55 +0000 (17:15 -0700)]
fix spaces in headers for -t msvc

11 years agoMerge pull request #419 from syntheticpp/rate-buffer-size
Evan Martin [Tue, 18 Sep 2012 22:08:23 +0000 (15:08 -0700)]
Merge pull request #419 from syntheticpp/rate-buffer-size

Buffer size passed to snprintf is wrong in rate code

11 years agoFix subtile buffer size error
Peter Kümmel [Tue, 18 Sep 2012 07:14:39 +0000 (09:14 +0200)]
Fix subtile buffer size error

The deduced type was char* with size 4 and not char[32] with size 32.
This removes strange output characters on Windows.

11 years agobuild with msvc2012
Peter Kümmel [Tue, 18 Sep 2012 07:11:40 +0000 (09:11 +0200)]
build with msvc2012

11 years agoremove some code duplication
Peter Kümmel [Tue, 18 Sep 2012 07:10:47 +0000 (09:10 +0200)]
remove some code duplication

11 years agoMerge pull request #422 from sgraham/fix-dupe-includes
Evan Martin [Mon, 17 Sep 2012 22:52:15 +0000 (15:52 -0700)]
Merge pull request #422 from sgraham/fix-dupe-includes

don't emit duplicate headers for msvc helper

11 years agodon't emit duplicate headers for msvc helper
Scott Graham [Mon, 17 Sep 2012 22:46:55 +0000 (15:46 -0700)]
don't emit duplicate headers for msvc helper

11 years agoMerge pull request #416 from nico/slide
Evan Martin [Fri, 14 Sep 2012 22:05:13 +0000 (15:05 -0700)]
Merge pull request #416 from nico/slide

Change rate measurement code.

11 years agoMerge pull request #415 from nico/getopt
Evan Martin [Fri, 14 Sep 2012 22:01:22 +0000 (15:01 -0700)]
Merge pull request #415 from nico/getopt

Clean up getopt_long call.

11 years agoChange rate measurement code.
Nico Weber [Fri, 14 Sep 2012 13:37:31 +0000 (22:37 +0900)]
Change rate measurement code.

For %o, remove a superfluous + 0.5: snprintf("%f") rounds already.
Remove some unnecessary code.

For %c, fix a TODO to add a sliding window and update after every
completed edge. Else, with -j50 and several files that take 3s to
compile each, this number would only update every 150s. Also give
the number one decimal place so that this can measure steps slower
than 1s.

11 years agoClean up getopt_long call.
Nico Weber [Fri, 14 Sep 2012 04:14:16 +0000 (13:14 +0900)]
Clean up getopt_long call.

Remove now-unimplemented 'V' from getopt_long. Remove 'h', since it's
included in the long options. Order switch cases in the same order as in
the getopt_long argument.

11 years agomark msvc-helper as experimental
Evan Martin [Thu, 13 Sep 2012 22:31:02 +0000 (15:31 -0700)]
mark msvc-helper as experimental

11 years agowindows: merge msvc-helper into ninja.exe itself
Evan Martin [Thu, 13 Sep 2012 18:07:45 +0000 (11:07 -0700)]
windows: merge msvc-helper into ninja.exe itself

Now "ninja -t msvc ..." passes the "..." to the msvc helper main.
This drastically simplifies bootstrap and makes ninja a single
binary again.

11 years agoMerge pull request #414 from riannucci/master
Evan Martin [Tue, 11 Sep 2012 04:23:08 +0000 (21:23 -0700)]
Merge pull request #414 from riannucci/master

Fix re2c detection in bootstrap which breaks win32 w/ gnuwin32

11 years agoFix re2c detection which breaks win32 w/ gnuwin32
Robert A. Iannucci Jr [Tue, 11 Sep 2012 03:42:32 +0000 (20:42 -0700)]
Fix re2c detection which breaks win32 w/ gnuwin32

11 years agoscoping workaround for gcc on Windows
Evan Martin [Fri, 7 Sep 2012 20:26:52 +0000 (13:26 -0700)]
scoping workaround for gcc on Windows

From https://github.com/martine/ninja/issues/410.

11 years agoinclude termios for solaris
Alex Caudill [Fri, 7 Sep 2012 20:24:26 +0000 (13:24 -0700)]
include termios for solaris

11 years agoadd solaris platform definitions
Alex Caudill [Fri, 7 Sep 2012 19:56:57 +0000 (19:56 +0000)]
add solaris platform definitions

11 years agodisable a new warning that popped up on Windows
Evan Martin [Fri, 7 Sep 2012 20:10:48 +0000 (13:10 -0700)]
disable a new warning that popped up on Windows

This pattern is safe as long as you're careful; we don't use it
very much.

11 years agoadd GetProcessorCount() implementation for Solaris
Alex Caudill [Fri, 7 Sep 2012 19:46:17 +0000 (12:46 -0700)]
add GetProcessorCount() implementation for Solaris

11 years agodrop special case for msvc bucket count
Evan Martin [Fri, 7 Sep 2012 19:36:16 +0000 (12:36 -0700)]
drop special case for msvc bucket count

Calling bucket_count() works locally with MSVC.  I wonder if some
other change in the code fixed this.

11 years agoMerge pull request #408 from nico/fix
Evan Martin [Thu, 6 Sep 2012 18:20:23 +0000 (11:20 -0700)]
Merge pull request #408 from nico/fix

Make sure no stale test file exists before running build log tests.

11 years agoallow tools to specify when they run (before/after build.ninja load)
Evan Martin [Thu, 6 Sep 2012 18:13:24 +0000 (11:13 -0700)]
allow tools to specify when they run (before/after build.ninja load)

This will be necessary to inline msvc-helper as well as so -t graph
can get depfiles.

11 years agofactor out metrics dump from ninja main
Evan Martin [Wed, 5 Sep 2012 16:19:26 +0000 (09:19 -0700)]
factor out metrics dump from ninja main

11 years agofactor out build log load from main
Evan Martin [Wed, 5 Sep 2012 16:14:39 +0000 (09:14 -0700)]
factor out build log load from main

11 years agorearrange tool-picking logic
Evan Martin [Wed, 5 Sep 2012 01:41:13 +0000 (21:41 -0400)]
rearrange tool-picking logic

Now "ninja -t list" works from any directory.

11 years agoshow all in graph
Evan Martin [Tue, 4 Sep 2012 23:03:35 +0000 (19:03 -0400)]
show all in graph

11 years agoreduce indent
Evan Martin [Tue, 4 Sep 2012 23:00:07 +0000 (19:00 -0400)]
reduce indent

11 years agomove BuildConfig out of globals
Evan Martin [Tue, 4 Sep 2012 22:57:16 +0000 (18:57 -0400)]
move BuildConfig out of globals

11 years agoremove DiskInterface from globals
Evan Martin [Tue, 4 Sep 2012 22:52:22 +0000 (18:52 -0400)]
remove DiskInterface from globals

11 years agoremove unfortunate header dependency
Evan Martin [Tue, 4 Sep 2012 22:48:49 +0000 (18:48 -0400)]
remove unfortunate header dependency

This was temporarily added, and now it can be removed.

11 years agoclarify setter
Evan Martin [Tue, 4 Sep 2012 22:43:45 +0000 (18:43 -0400)]
clarify setter

11 years agomove BuildLog to DependencyScan
Evan Martin [Tue, 4 Sep 2012 22:39:04 +0000 (18:39 -0400)]
move BuildLog to DependencyScan

The build log is needed in computing whether an edge is
dirty, so I think it belongs here.  (It's a bit weird
that Builder needs to reach into it to record completed
commands, maybe it will become cleaner with more thought.)

11 years agofix --debug for glibc pedantic mode
Evan Martin [Tue, 4 Sep 2012 22:21:52 +0000 (18:21 -0400)]
fix --debug for glibc pedantic mode

11 years agopass Builder as arg to build-running functions
Evan Martin [Tue, 4 Sep 2012 22:08:41 +0000 (18:08 -0400)]
pass Builder as arg to build-running functions

Reducing use of globals.

11 years agoremove config from BuildLog, rename members
Evan Martin [Sun, 2 Sep 2012 19:53:59 +0000 (15:53 -0400)]
remove config from BuildLog, rename members

11 years agoremove a redundant arg to RecomputeOutputDirty
Evan Martin [Sun, 2 Sep 2012 19:27:46 +0000 (12:27 -0700)]
remove a redundant arg to RecomputeOutputDirty

11 years agosplit out dirty recomputation logic from Edge class
Evan Martin [Sun, 2 Sep 2012 18:03:01 +0000 (11:03 -0700)]
split out dirty recomputation logic from Edge class

Rather than passing States and DiskInterfaces through all the calls,
put the necessary ambient information in a new DependencyScan object
and move the code accordingly.

Note: I didn't move the source location of the functions to preserve
history, though this does result in a sort of weird order for the
functions in graph.cc.