platform/upstream/ninja.git
12 years agono error code about too long file names on Windows
Peter Kuemmel [Mon, 23 Jan 2012 20:42:50 +0000 (21:42 +0100)]
no error code about too long file names on Windows

12 years agoMerge pull request #201 from syntheticpp/mingw-msvc
Evan Martin [Mon, 23 Jan 2012 00:46:53 +0000 (16:46 -0800)]
Merge pull request #201 from syntheticpp/mingw-msvc

Some workarounds are only for msvc.

12 years agoonly msvc needs these workarounds
Peter Kuemmel [Sun, 22 Jan 2012 21:40:20 +0000 (22:40 +0100)]
only msvc needs these workarounds

12 years agowindows: use _WIN32 define everywhere
Evan Martin [Sun, 22 Jan 2012 18:22:45 +0000 (10:22 -0800)]
windows: use _WIN32 define everywhere

Rather than mixing use of WIN32 and _WIN32.

12 years agoMerge pull request #198 from nico/strip0
Evan Martin [Thu, 19 Jan 2012 00:16:49 +0000 (16:16 -0800)]
Merge pull request #198 from nico/strip0

Strip ansi escape sequences from subcommand output when not writing to a...

12 years agoStrip ansi escape sequences from subcommand output when not writing to a smart terminal.
Nico Weber [Thu, 19 Jan 2012 00:09:16 +0000 (16:09 -0800)]
Strip ansi escape sequences from subcommand output when not writing to a smart terminal.

12 years agoMerge pull request #197 from doctorlove/simple_dry_run
Evan Martin [Mon, 16 Jan 2012 18:31:43 +0000 (10:31 -0800)]
Merge pull request #197 from doctorlove/simple_dry_run

Simple dry run

12 years agoAdd a test that dry run shows all commands that could be run (none
Frances Buontempo [Mon, 16 Jan 2012 14:17:37 +0000 (14:17 +0000)]
Add a test that dry run shows all commands that could be run (none
cleaned) and a fix for this

12 years agoStop warning about chdir etc which are treated as errors on MSVC with the
Frances Buontempo [Mon, 16 Jan 2012 13:53:08 +0000 (13:53 +0000)]
Stop warning about chdir etc which are treated as errors on MSVC with the
current settings

12 years agowindows: always generate PDB
Scott Graham [Sat, 14 Jan 2012 03:17:14 +0000 (19:17 -0800)]
windows: always generate PDB

12 years agoenable libstd++ debugging in debug mode
Evan Martin [Fri, 13 Jan 2012 17:02:19 +0000 (09:02 -0800)]
enable libstd++ debugging in debug mode

12 years agoMerge pull request #196 from evanj/master
Evan Martin [Fri, 13 Jan 2012 16:55:49 +0000 (08:55 -0800)]
Merge pull request #196 from evanj/master

Fix MSVC invalid string problem

12 years agoBuildLog: Use Log::insert(Log::value_type()) to avoid invalid strings.
Evan Jones [Fri, 13 Jan 2012 14:20:07 +0000 (09:20 -0500)]
BuildLog: Use Log::insert(Log::value_type()) to avoid invalid strings.

The MSVC std::string implementation copies strings, so using make_pair
resulted in a pointer to invalid memory. This ensures the insert uses a
StringPiece without an intermediate std::string copy, so the correct pointer
ends up in the hash_map.

12 years agowindows: make ninja_test build
Frances Buontempo [Fri, 13 Jan 2012 03:04:42 +0000 (19:04 -0800)]
windows: make ninja_test build

12 years agoMerge branch 'stringpiece-hash'
Evan Martin [Thu, 12 Jan 2012 19:21:06 +0000 (11:21 -0800)]
Merge branch 'stringpiece-hash'

This branch changed the fundamental key used in hashes in Ninja from
char* to StringPiece.  Using StringPiece allows us to eliminate some
copies and null termination in various places.

While I was at it, I switched the hash function to the Murmur hash.

Seems to be ~100ms faster:

evmar:/work/chrome/src$ ~/projects/ninja/misc/measure.py ~/projects/ninja/ninja-trunk -C out/Debug chrome
sampling: 994ms 1010ms 1000ms 999ms 1019ms 994ms 1002ms 993ms 997ms 1040ms
estimate: 993ms (mean err 11.6ms)
evmar:/work/chrome/src$ ~/projects/ninja/misc/measure.py ~/projects/ninja/ninja -C out/Debug chrome
sampling: 888ms 895ms 891ms 886ms 896ms 888ms 891ms 903ms 895ms 888ms
estimate: 886ms (mean err 5.7ms)

12 years agodecide on murmur hash, delete stl hash
Evan Martin [Thu, 12 Jan 2012 19:16:51 +0000 (11:16 -0800)]
decide on murmur hash, delete stl hash

A nice thing about working on Google: a C++ expert who happened
to be writing a proposal on hashing for the next C++ version
wandered into my office.  He seemed to think using Murmur here
is fine.

12 years agobuild gtest with -fvisibility=hidden as well
Evan Martin [Thu, 12 Jan 2012 00:18:37 +0000 (16:18 -0800)]
build gtest with -fvisibility=hidden as well

Fixes a warning on Mac.

12 years agomake new hash work on windows
Evan Martin [Wed, 11 Jan 2012 18:22:50 +0000 (10:22 -0800)]
make new hash work on windows

12 years agowindows: hash_map bucket count has different getter
Frances Buontempo [Wed, 11 Jan 2012 17:43:11 +0000 (09:43 -0800)]
windows: hash_map bucket count has different getter

12 years agoGetTempPath() needs windows.h
Frances Buontempo [Wed, 11 Jan 2012 17:38:41 +0000 (09:38 -0800)]
GetTempPath() needs windows.h

12 years agoback to murmur hash
Evan Martin [Mon, 9 Jan 2012 22:06:09 +0000 (14:06 -0800)]
back to murmur hash

12 years agoremove string copy while loading depfiles
Evan Martin [Mon, 9 Jan 2012 21:46:57 +0000 (13:46 -0800)]
remove string copy while loading depfiles

12 years agosplit canonicalize
Evan Martin [Mon, 9 Jan 2012 21:40:06 +0000 (13:40 -0800)]
split canonicalize

12 years agomore stringpiece
Evan Martin [Mon, 9 Jan 2012 21:35:16 +0000 (13:35 -0800)]
more stringpiece

12 years agomurmur -> stl hash
Evan Martin [Mon, 9 Jan 2012 21:30:18 +0000 (13:30 -0800)]
murmur -> stl hash

12 years agoswitch node lookup to StringPiece
Evan Martin [Mon, 9 Jan 2012 21:30:09 +0000 (13:30 -0800)]
switch node lookup to StringPiece

12 years agoconvert ExternalStringHash to use StringPiece
Evan Martin [Mon, 9 Jan 2012 20:54:31 +0000 (12:54 -0800)]
convert ExternalStringHash to use StringPiece

12 years agoinclude main hash load in -d stats output
Evan Martin [Mon, 9 Jan 2012 17:01:41 +0000 (09:01 -0800)]
include main hash load in -d stats output

12 years agoconfigure.py: make CC='command with args' work
Craig Schlenter [Mon, 9 Jan 2012 15:57:20 +0000 (07:57 -0800)]
configure.py: make CC='command with args' work

12 years agodynamic metrics report width
Evan Martin [Fri, 6 Jan 2012 18:07:45 +0000 (10:07 -0800)]
dynamic metrics report width

12 years agotrack canonicalize metric
Evan Martin [Fri, 6 Jan 2012 18:05:28 +0000 (10:05 -0800)]
track canonicalize metric

12 years agomigrate tempdir code to test.cc
Evan Martin [Fri, 6 Jan 2012 19:34:10 +0000 (11:34 -0800)]
migrate tempdir code to test.cc

12 years agoadjust restat behavior around missing outputs
Evan Martin [Thu, 5 Jan 2012 23:20:07 +0000 (15:20 -0800)]
adjust restat behavior around missing outputs

If a restat rule claims to write an output but doesn't, consider it
"no change" (in the restat sense) if the output didn't exist beforehand.
I.e. if the output didn't exist before and the output doesn't exist after,
we don't need to run dependent rules.

12 years agoadd a '-d stats' flag for detailed timings
Evan Martin [Thu, 5 Jan 2012 21:35:47 +0000 (13:35 -0800)]
add a '-d stats' flag for detailed timings

1) Add a system for recording detailed timing info of functions.
2) Add a -d flag for requesting debug info at runtime, with the
   above as the first user.

12 years agowindows: don't use \e in string
Evan Martin [Thu, 5 Jan 2012 20:17:08 +0000 (12:17 -0800)]
windows: don't use \e in string

12 years agodrop some std:: prefixes
Evan Martin [Thu, 5 Jan 2012 17:25:37 +0000 (09:25 -0800)]
drop some std:: prefixes

12 years agoconvert all time_t to a new TimeStamp type
Evan Martin [Thu, 5 Jan 2012 17:24:30 +0000 (09:24 -0800)]
convert all time_t to a new TimeStamp type

12 years agofactor out the main builder call
Evan Martin [Thu, 5 Jan 2012 01:07:23 +0000 (17:07 -0800)]
factor out the main builder call

12 years agoMerge pull request #194 from evanj/newline_spaces
Evan Martin [Thu, 5 Jan 2012 15:55:56 +0000 (07:55 -0800)]
Merge pull request #194 from evanj/newline_spaces

Lexer: include leading spaces in the newline token.

12 years agoMerge pull request #193 from evanj/reparse_error
Evan Martin [Thu, 5 Jan 2012 15:54:04 +0000 (07:54 -0800)]
Merge pull request #193 from evanj/reparse_error

ninja.cc: Clear the rules/variables/state when reloading build.ninja

12 years agoMerge pull request #192 from evanj/master
Evan Martin [Thu, 5 Jan 2012 15:52:36 +0000 (07:52 -0800)]
Merge pull request #192 from evanj/master

Fix ninja_test by adding the change to lexer.cc to lexer.in.cc

12 years agoLexer: include leading spaces in the newline token.
Evan Jones [Thu, 5 Jan 2012 13:28:54 +0000 (08:28 -0500)]
Lexer: include leading spaces in the newline token.

This means that indented blank lines are skipped without causing errors.

12 years agoninja.cc: Clear the rules/variables/state when reloading build.ninja
Evan Jones [Thu, 5 Jan 2012 15:06:41 +0000 (10:06 -0500)]
ninja.cc: Clear the rules/variables/state when reloading build.ninja

This error was introduced in commit 4f6f015b. Previously, the reload goto
label created a new State. This now does the same, manually.

12 years agoLexer: Remove the trailing newline from lexer.in.cc not just lexer.cc
Evan Jones [Thu, 5 Jan 2012 13:58:41 +0000 (08:58 -0500)]
Lexer: Remove the trailing newline from lexer.in.cc not just lexer.cc

This probably should have been part of commit eeed7241

12 years agotest error message of ManifestParser::Load
Evan Martin [Thu, 5 Jan 2012 04:58:44 +0000 (20:58 -0800)]
test error message of ManifestParser::Load

Fixes the other half of issue #187.

12 years agomake Lexer::Error not emit trailing newline
Evan Martin [Thu, 5 Jan 2012 04:12:22 +0000 (20:12 -0800)]
make Lexer::Error not emit trailing newline

Now it's consistent with other errors.
Fixes part of issue #187.

12 years agomake my last change actually work
Evan Martin [Thu, 5 Jan 2012 04:10:15 +0000 (20:10 -0800)]
make my last change actually work

12 years agoremove build_log v1/v2 code
Evan Martin [Thu, 5 Jan 2012 04:03:37 +0000 (20:03 -0800)]
remove build_log v1/v2 code

12 years agowarn on accidental args to configure
Evan Martin [Thu, 5 Jan 2012 04:01:04 +0000 (20:01 -0800)]
warn on accidental args to configure

12 years agoLexer: include leading whitespace in the comment token.
Evan Jones [Thu, 5 Jan 2012 02:12:27 +0000 (21:12 -0500)]
Lexer: include leading whitespace in the comment token.

Indented comments are ignored rather than causing errors.

12 years agoMerge pull request #188 from nico/spacelog
Evan Martin [Thu, 5 Jan 2012 01:02:10 +0000 (17:02 -0800)]
Merge pull request #188 from nico/spacelog

Switch build log to use tabs as field separators, to support outputs wit...

12 years agoSwitch build log to use tabs as field separators, to support outputs with spaces.
Nico Weber [Thu, 5 Jan 2012 00:49:41 +0000 (16:49 -0800)]
Switch build log to use tabs as field separators, to support outputs with spaces.

12 years agoMerge pull request #185 from nico/vim
Evan Martin [Thu, 5 Jan 2012 00:46:42 +0000 (16:46 -0800)]
Merge pull request #185 from nico/vim

Add a ninja syntax file for vim.

12 years agoallow spellcheck to be used with a vector of strings
Evan Martin [Wed, 4 Jan 2012 23:47:29 +0000 (15:47 -0800)]
allow spellcheck to be used with a vector of strings

12 years agorefactor tool list into a table
Evan Martin [Wed, 4 Jan 2012 23:17:50 +0000 (15:17 -0800)]
refactor tool list into a table

12 years agodon't attempt to build browse.* in bootstrap mode
Evan Martin [Wed, 4 Jan 2012 23:36:53 +0000 (15:36 -0800)]
don't attempt to build browse.* in bootstrap mode

12 years agoMerge pull request #175 from nornagon/escape-in-out
Evan Martin [Wed, 4 Jan 2012 23:06:18 +0000 (15:06 -0800)]
Merge pull request #175 from nornagon/escape-in-out

When expanding $in and $out, wrap with quotes if the filename has a space.

12 years agoAdd a test for quoting spaces in expanded $in and $out.
Jeremy Apthorp [Wed, 4 Jan 2012 23:00:24 +0000 (10:00 +1100)]
Add a test for quoting spaces in expanded $in and $out.

12 years agoMerge pull request #186 from evanj/master
Evan Martin [Wed, 4 Jan 2012 22:41:03 +0000 (14:41 -0800)]
Merge pull request #186 from evanj/master

ninja_syntax.py: support passing variables as both dicts and lists.

12 years agoninja_syntax.py: Fix a bug when passing dict variables to Writer.build()
Evan Jones [Wed, 4 Jan 2012 19:58:42 +0000 (14:58 -0500)]
ninja_syntax.py: Fix a bug when passing dict variables to Writer.build()

Add a test to cover both dict and list variables.

12 years agoRevert "ninja_syntax.py: Fix a bug when passing variables to Writer.build()"
Evan Martin [Wed, 4 Jan 2012 22:33:53 +0000 (14:33 -0800)]
Revert "ninja_syntax.py: Fix a bug when passing variables to Writer.build()"

This reverts commit 95ab954.
The test was verifying the wrong behavior.  I reviewed too quickly. :(

12 years agowindows: more build fixes
Scott Graham [Wed, 4 Jan 2012 22:18:17 +0000 (14:18 -0800)]
windows: more build fixes

12 years agoMerge pull request #184 from evanj/master
Evan Martin [Wed, 4 Jan 2012 22:12:50 +0000 (14:12 -0800)]
Merge pull request #184 from evanj/master

ninja_syntax.py: Fix passing variables to Writer.build()

12 years agoAdd a ninja syntax file for vim.
Nico Weber [Wed, 4 Jan 2012 21:52:11 +0000 (13:52 -0800)]
Add a ninja syntax file for vim.

12 years agoninja_syntax.py: Fix a bug when passing variables to Writer.build()
Evan Jones [Wed, 4 Jan 2012 19:58:42 +0000 (14:58 -0500)]
ninja_syntax.py: Fix a bug when passing variables to Writer.build()

Add a test to cover this case.

12 years agoAdd a space to unexpected token errors.
Evan Jones [Wed, 4 Jan 2012 16:40:30 +0000 (11:40 -0500)]
Add a space to unexpected token errors.

12 years agoUse ExitProcess instead of exit in Fatal to allow extra cleanup for MSVC
Frances Buontempo [Wed, 4 Jan 2012 15:46:33 +0000 (07:46 -0800)]
Use ExitProcess instead of exit in Fatal to allow extra cleanup for MSVC

12 years agowindows: make bootstrap.py/configure.py work with MSVC
Scott Graham [Wed, 4 Jan 2012 01:04:49 +0000 (17:04 -0800)]
windows: make bootstrap.py/configure.py work with MSVC

12 years agoMerge pull request #180 from doctorlove/int64
Evan Martin [Tue, 3 Jan 2012 18:54:15 +0000 (10:54 -0800)]
Merge pull request #180 from doctorlove/int64

Int64

12 years agoAdd new line to new file
Frances Buontempo [Tue, 3 Jan 2012 16:48:02 +0000 (16:48 +0000)]
Add new line to new file

12 years agotypedef long long for MSVC
Frances Buontempo [Tue, 3 Jan 2012 16:45:16 +0000 (16:45 +0000)]
typedef long long for MSVC

12 years agoMerge pull request #179 from polrop/fix-clang-warning
Evan Martin [Tue, 3 Jan 2012 15:38:43 +0000 (07:38 -0800)]
Merge pull request #179 from polrop/fix-clang-warning

Fix warning about class previously declared as struct.

12 years agoMerge pull request #177 from doctorlove/msvc_changes
Evan Martin [Tue, 3 Jan 2012 15:36:38 +0000 (07:36 -0800)]
Merge pull request #177 from doctorlove/msvc_changes

Msvc changes

12 years agoFix warning about class previously declared as struct.
Nicolas Despres [Tue, 3 Jan 2012 13:51:17 +0000 (14:51 +0100)]
Fix warning about class previously declared as struct.

Reported by clang++.

12 years agostd::string(NULL,0) asserts in MSVC Debug
Frances Buontempo [Tue, 3 Jan 2012 12:06:24 +0000 (12:06 +0000)]
std::string(NULL,0) asserts in MSVC Debug

12 years agoChanges to hash_map to make it build with MSVC's version
Frances Buontempo [Tue, 3 Jan 2012 10:44:03 +0000 (10:44 +0000)]
Changes to hash_map to make it build with MSVC's version

12 years agoInclude <algorithm> for std::find in test.cc
Frances Buontempo [Tue, 3 Jan 2012 10:23:29 +0000 (10:23 +0000)]
Include <algorithm> for std::find in test.cc

12 years agoWhen expanding $in and $out, wrap with quotes if the filename has a space.
Jeremy Apthorp [Mon, 28 Nov 2011 02:54:35 +0000 (13:54 +1100)]
When expanding $in and $out, wrap with quotes if the filename has a space.

12 years agoallow hyphen in variable names
Evan Martin [Fri, 30 Dec 2011 23:15:17 +0000 (15:15 -0800)]
allow hyphen in variable names

12 years agomore private
Evan Martin [Fri, 30 Dec 2011 04:39:04 +0000 (20:39 -0800)]
more private

12 years agomake evalstring internals private
Evan Martin [Fri, 30 Dec 2011 04:37:07 +0000 (20:37 -0800)]
make evalstring internals private

12 years agoMerge pull request #173 from polrop/fix-typo-in-manual
Evan Martin [Fri, 30 Dec 2011 18:03:48 +0000 (10:03 -0800)]
Merge pull request #173 from polrop/fix-typo-in-manual

Fix typo in manual.

12 years agoFix typo in manual.
Nicolas Despres [Fri, 30 Dec 2011 13:39:01 +0000 (14:39 +0100)]
Fix typo in manual.

12 years agobuild fix
Evan Martin [Fri, 30 Dec 2011 04:35:39 +0000 (20:35 -0800)]
build fix

12 years agoswitch the core ninja parser to use re2c for the lexer
Evan Martin [Thu, 29 Dec 2011 21:00:27 +0000 (13:00 -0800)]
switch the core ninja parser to use re2c for the lexer

- Delete the old "Tokenizer" code.
- Write separate tests for the lexer distinct from the parser.
- Switch the parser to use the new code.
- New lexer error output has file:line numbers so e.g. Emacs can
  jump your editor to the syntax error.
- The EvalEnv ($-interpolation) code is now part of the lexer as well.

12 years agominor re2c cleanups
Evan Martin [Thu, 29 Dec 2011 20:48:25 +0000 (12:48 -0800)]
minor re2c cleanups

12 years agohandle nuls more carefully in re2c rules
Evan Martin [Thu, 29 Dec 2011 20:44:15 +0000 (12:44 -0800)]
handle nuls more carefully in re2c rules

- '.' in re2c matches anything except \n, which means it matches \000.
  Be more careful about which characters we match.
- The fallback rule [^] reads ahead another character, which means it
  can read past the trailing \000.  Add a separate rule to match it
  specifically.

This was found by Valgrind.

12 years agoadd script for measuring build performance
Evan Martin [Thu, 29 Dec 2011 19:57:02 +0000 (11:57 -0800)]
add script for measuring build performance

12 years agoninja_syntax: add restat attribute to rules
Evan Martin [Wed, 28 Dec 2011 21:52:47 +0000 (13:52 -0800)]
ninja_syntax: add restat attribute to rules

Patch from Ami Fischman <fischman@chromium.org>.

12 years agoadd bash completion based on zsh completion
Evan Martin [Wed, 28 Dec 2011 07:32:09 +0000 (23:32 -0800)]
add bash completion based on zsh completion

12 years agomove some docs to home page
Evan Martin [Wed, 28 Dec 2011 07:24:46 +0000 (23:24 -0800)]
move some docs to home page

12 years agolink to blog post in docs
Evan Martin [Wed, 28 Dec 2011 05:43:39 +0000 (21:43 -0800)]
link to blog post in docs

12 years agoadd an "all" target to build all binaries
Evan Martin [Wed, 28 Dec 2011 03:39:16 +0000 (19:39 -0800)]
add an "all" target to build all binaries

12 years agofix parser_perftest after depfile change
Evan Martin [Wed, 28 Dec 2011 03:36:02 +0000 (19:36 -0800)]
fix parser_perftest after depfile change

12 years agode-escape backslashes in depfiles while parsing
Evan Martin [Tue, 27 Dec 2011 23:45:30 +0000 (15:45 -0800)]
de-escape backslashes in depfiles while parsing

12 years agoadd (failing) test involving spaces in depfiles
Evan Martin [Tue, 27 Dec 2011 21:51:15 +0000 (13:51 -0800)]
add (failing) test involving spaces in depfiles

12 years agoswitch DepfileParser to take a string* to make memory clearer
Evan Martin [Tue, 27 Dec 2011 21:48:17 +0000 (13:48 -0800)]
switch DepfileParser to take a string* to make memory clearer

Add some comments as well.

12 years agofix depfile regex to not match empty strings
Evan Martin [Tue, 27 Dec 2011 21:39:09 +0000 (13:39 -0800)]
fix depfile regex to not match empty strings

From a patch from Allan Odgaard <github@simplit.com>.

12 years agoadapt parser_perftest to new depfile class
Evan Martin [Tue, 27 Dec 2011 21:27:31 +0000 (13:27 -0800)]
adapt parser_perftest to new depfile class

12 years agoremove huge indent from tools list
Evan Martin [Tue, 27 Dec 2011 21:25:45 +0000 (13:25 -0800)]
remove huge indent from tools list