platform/upstream/ninja.git
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

12 years agorearrange the new bootstrap.py
Evan Martin [Tue, 27 Dec 2011 20:29:39 +0000 (12:29 -0800)]
rearrange the new bootstrap.py

(e.g. remove tabs)

12 years agoMerge branch 'master' of git://github.com/ehird/ninja
Evan Martin [Tue, 27 Dec 2011 20:15:32 +0000 (12:15 -0800)]
Merge branch 'master' of git://github.com/ehird/ninja

12 years agoMerge pull request #166 from tfarina/fix-commit
Evan Martin [Mon, 26 Dec 2011 19:46:08 +0000 (11:46 -0800)]
Merge pull request #166 from tfarina/fix-commit

Follow up fix to commit 32bf74f (Fix the TODO in Rule class.)

12 years agoFollow up fix to commit 32bf74f (Fix the TODO in Rule class.)
Thiago Farina [Sat, 24 Dec 2011 02:08:14 +0000 (00:08 -0200)]
Follow up fix to commit 32bf74f (Fix the TODO in Rule class.)

Signed-off-by: Thiago Farina <tfarina@chromium.org>
12 years agoMerge pull request #164 from tfarina/rule-private-members
Evan Martin [Sat, 24 Dec 2011 01:29:05 +0000 (17:29 -0800)]
Merge pull request #164 from tfarina/rule-private-members

Fix the TODO in Rule class.

12 years agoFix the TODO in Rule class.
Thiago Farina [Sat, 24 Dec 2011 01:03:57 +0000 (23:03 -0200)]
Fix the TODO in Rule class.

Move various data members to private section and provide accessors for them.

Signed-off-by: Thiago Farina <tfarina@chromium.org>
12 years agowindows: handle ERROR_PATH_NOT_FOUND
Evan Martin [Fri, 23 Dec 2011 18:56:04 +0000 (10:56 -0800)]
windows: handle ERROR_PATH_NOT_FOUND

From Frances <frances.buontempo@gmail.com>.

12 years agoMerge pull request #163 from jsternberg/master
Evan Martin [Fri, 23 Dec 2011 17:00:16 +0000 (09:00 -0800)]
Merge pull request #163 from jsternberg/master

a fix for issue #162

12 years agoMatching the depfile_parser.in.cc file to properly generate the depfile_parser.cc...
Jonathan Sternberg [Fri, 23 Dec 2011 15:02:10 +0000 (10:02 -0500)]
Matching the depfile_parser.in.cc file to properly generate the depfile_parser.cc file that's in version control.

12 years agoMerge pull request #161 from nico/fix
Evan Martin [Thu, 22 Dec 2011 21:31:25 +0000 (13:31 -0800)]
Merge pull request #161 from nico/fix

Let ninja_syntax handle escaped spaces correctly.

12 years agoLet ninja_syntax handle escaped spaces correctly.
Nico Weber [Thu, 22 Dec 2011 20:21:12 +0000 (12:21 -0800)]
Let ninja_syntax handle escaped spaces correctly.

Revert the main loop changes made in 2e7ab7514207ea7faad40faedf3fc9d72b3adf7a,
and add just a few lines to the original main loop to make '$ ' escaping work.
Add several new tests, and make the existing tests pass again.

12 years agorevert part of c33b198 to fix build of ninja_test
Evan Martin [Thu, 22 Dec 2011 01:13:25 +0000 (17:13 -0800)]
revert part of c33b198 to fix build of ninja_test

12 years agoMerge pull request #160 from tfarina/upper-case-error
Evan Martin [Tue, 20 Dec 2011 23:29:35 +0000 (15:29 -0800)]
Merge pull request #160 from tfarina/upper-case-error

Capitalize "error" to match with the other utility functions.

12 years agoCapitalize "error" to match with the other utility functions.
Thiago Farina [Tue, 20 Dec 2011 23:14:33 +0000 (21:14 -0200)]
Capitalize "error" to match with the other utility functions.

Fatal and Warning functions already output their strings capitalized,
we were just missing the Error function. So capitalize it now.

Signed-off-by: Thiago Farina <tfarina@chromium.org>
12 years agoMerge pull request #159 from tfarina/protect-build-log-vars
Evan Martin [Tue, 20 Dec 2011 21:59:00 +0000 (13:59 -0800)]
Merge pull request #159 from tfarina/protect-build-log-vars

Protect BuildLog data member variables by making them private.

12 years agoProtect BuildLog data member variables by making them private.
Thiago Farina [Tue, 20 Dec 2011 21:53:31 +0000 (19:53 -0200)]
Protect BuildLog data member variables by making them private.

They are not accessed outside of BuildLog and there is even a SetConfig function
to set the |config_| variable.

So better to make them private to BuildLog now while nobody is using it outside.

Signed-off-by: Thiago Farina <tfarina@chromium.org>
12 years agoMerge pull request #158 from tfarina/alphabetize
Evan Martin [Tue, 20 Dec 2011 21:18:53 +0000 (13:18 -0800)]
Merge pull request #158 from tfarina/alphabetize

Put the list of core source files in alphabetical order.

12 years agoPut the list of core source files in alphabetical order.
Thiago Farina [Tue, 20 Dec 2011 21:06:01 +0000 (19:06 -0200)]
Put the list of core source files in alphabetical order.

Signed-off-by: Thiago Farina <tfarina@chromium.org>
12 years agowindows: use GetFileAttributesEx instead of stat
Evan Martin [Tue, 20 Dec 2011 20:13:11 +0000 (12:13 -0800)]
windows: use GetFileAttributesEx instead of stat

From a Hacker News comment:
"Recent finding, that sped up our systems from 15->3sec on 300,000+ files
filestamp check was to move from _stat to GetFileAttributesEx."

I do recall reading that calls to stat() on Windows were one of the
potential reasons Subversion is so slow on Windows...

12 years agogitignore exe files
Evan Martin [Tue, 20 Dec 2011 19:44:08 +0000 (11:44 -0800)]
gitignore exe files

12 years agofactor out windows perror equivalent
Evan Martin [Tue, 20 Dec 2011 19:43:57 +0000 (11:43 -0800)]
factor out windows perror equivalent

12 years agoinline gtest to simplify windows build
Evan Martin [Tue, 20 Dec 2011 19:38:56 +0000 (11:38 -0800)]
inline gtest to simplify windows build

12 years agofix bad merge
Evan Martin [Tue, 20 Dec 2011 19:10:26 +0000 (11:10 -0800)]
fix bad merge

12 years agofix mingw cross-compile
Evan Martin [Tue, 20 Dec 2011 19:01:04 +0000 (11:01 -0800)]
fix mingw cross-compile

12 years agorearrange manual to centralize quoting rules
Evan Martin [Tue, 20 Dec 2011 18:54:10 +0000 (10:54 -0800)]
rearrange manual to centralize quoting rules

12 years agoremove weird accidental double-return
Evan Martin [Tue, 20 Dec 2011 18:40:40 +0000 (10:40 -0800)]
remove weird accidental double-return

Surprised this isn't a compiler warning.

12 years agoMerge pull request #146 from nornagon/escape-spaces
Evan Martin [Tue, 20 Dec 2011 18:33:42 +0000 (10:33 -0800)]
Merge pull request #146 from nornagon/escape-spaces

Escape spaces

12 years agoadjust depfile test now that parsing is more lax
Evan Martin [Mon, 19 Dec 2011 19:18:29 +0000 (11:18 -0800)]
adjust depfile test now that parsing is more lax

12 years agohandle backslashes and isolated colons in depfile parser
Evan Martin [Mon, 19 Dec 2011 19:14:35 +0000 (11:14 -0800)]
handle backslashes and isolated colons in depfile parser

The logic was wrong if the input looked like
  foo : bar baz
with a space before the colon.

Test from Frances <frances.buontempo@gmail.com>.

12 years agosplit out depfile parser tests into new file
Evan Martin [Mon, 19 Dec 2011 18:59:29 +0000 (10:59 -0800)]
split out depfile parser tests into new file

12 years agoprint 'entering directory' when -C is used
Evan Martin [Thu, 15 Dec 2011 20:24:34 +0000 (12:24 -0800)]
print 'entering directory' when -C is used

This allows Emacs to track what directory you're in.

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

12 years agoRewrite the bootstrap script in Python
Elliott Hird [Thu, 15 Dec 2011 14:52:22 +0000 (14:52 +0000)]
Rewrite the bootstrap script in Python

This allows trouble-free builds on platforms with non-standard Python
executable names. As a bonus, it passes the arguments received on to
configure.py, so you don't have to reconfigure to build in a
non-standard manner.

12 years agoSupport non-standard Python executable names
Elliott Hird [Wed, 14 Dec 2011 20:43:19 +0000 (20:43 +0000)]
Support non-standard Python executable names

Closes #154.

12 years agoMerge pull request #153 from polrop/fix-bootstrap
Evan Martin [Fri, 9 Dec 2011 22:49:30 +0000 (14:49 -0800)]
Merge pull request #153 from polrop/fix-bootstrap

Fix bootstrap

12 years agoFix 'list' tool.
Nicolas Despres [Fri, 9 Dec 2011 15:45:25 +0000 (16:45 +0100)]
Fix 'list' tool.

12 years agoFactor source file listing code in bootstrap script.
Nicolas Despres [Fri, 9 Dec 2011 10:05:37 +0000 (11:05 +0100)]
Factor source file listing code in bootstrap script.

12 years agoFix bootstrap script.
Nicolas Despres [Fri, 9 Dec 2011 09:59:35 +0000 (10:59 +0100)]
Fix bootstrap script.

- Make regexp more robust.
- Exclude .in.cc files.

12 years agoUse getter instead of private member.
Nicolas Despres [Fri, 9 Dec 2011 09:45:05 +0000 (10:45 +0100)]
Use getter instead of private member.

Fix a compilation error.

12 years agoperformance testing note
Evan Martin [Wed, 7 Dec 2011 20:30:59 +0000 (12:30 -0800)]
performance testing note

12 years agoremove makefile parsing code, use depfile code instead
Evan Martin [Wed, 7 Dec 2011 20:14:30 +0000 (12:14 -0800)]
remove makefile parsing code, use depfile code instead

12 years agouse re2c to parse depfiles
Evan Martin [Wed, 7 Dec 2011 20:08:00 +0000 (12:08 -0800)]
use re2c to parse depfiles

12 years agorefactor EdgeEnv
Evan Martin [Wed, 7 Dec 2011 18:01:00 +0000 (10:01 -0800)]
refactor EdgeEnv

12 years agomake Rule::generator_ and restat_ private
Evan Martin [Wed, 7 Dec 2011 17:51:14 +0000 (09:51 -0800)]
make Rule::generator_ and restat_ private

12 years agomake Rule::name_ private
Evan Martin [Wed, 7 Dec 2011 17:43:29 +0000 (09:43 -0800)]
make Rule::name_ private

12 years agoremove unused function
Evan Martin [Wed, 7 Dec 2011 17:41:07 +0000 (09:41 -0800)]
remove unused function

12 years agomake Node::out_edges_ private
Evan Martin [Wed, 7 Dec 2011 17:38:10 +0000 (09:38 -0800)]
make Node::out_edges_ private

12 years agomake Node::in_edge_ private
Evan Martin [Wed, 7 Dec 2011 17:35:02 +0000 (09:35 -0800)]
make Node::in_edge_ private

12 years agomake Node::dirty_ private
Evan Martin [Wed, 7 Dec 2011 17:27:01 +0000 (09:27 -0800)]
make Node::dirty_ private

12 years agomore whitespace
Evan Martin [Wed, 7 Dec 2011 16:59:08 +0000 (08:59 -0800)]
more whitespace

12 years agomerge StatCache into State
Evan Martin [Wed, 7 Dec 2011 16:55:46 +0000 (08:55 -0800)]
merge StatCache into State

I think I had originally imagined StatCache would contain more state,
but at this point it's clear it was just managing a single map, which
could just as well be in the already-small State object.

12 years agomerge FileStat into Node
Evan Martin [Wed, 7 Dec 2011 16:45:16 +0000 (08:45 -0800)]
merge FileStat into Node

The two were always one-to-one anyway.  I started adding accessors
to FileStat and then realized most users wanted them on Node and
that forwarding them through was silly.

12 years agorefactor to remove Node::ready()
Evan Martin [Wed, 7 Dec 2011 16:33:49 +0000 (08:33 -0800)]
refactor to remove Node::ready()

12 years agoadd and use getter for Edge::rule_
Evan Martin [Wed, 7 Dec 2011 01:32:25 +0000 (17:32 -0800)]
add and use getter for Edge::rule_

12 years agomove build/install to README
Evan Martin [Tue, 6 Dec 2011 17:32:08 +0000 (09:32 -0800)]
move build/install to README

12 years agoMerge pull request #152 from pcc/clean-depfiles
Evan Martin [Tue, 6 Dec 2011 16:26:39 +0000 (08:26 -0800)]
Merge pull request #152 from pcc/clean-depfiles

Have the clean tool remove depfiles

12 years agoMerge pull request #151 from pcc/restat-depfiles
Evan Martin [Tue, 6 Dec 2011 16:25:59 +0000 (08:25 -0800)]
Merge pull request #151 from pcc/restat-depfiles

Use the modification time of the depfile when computing restat_mtime

12 years agoHave the clean tool remove depfiles
Peter Collingbourne [Fri, 25 Nov 2011 15:18:49 +0000 (15:18 +0000)]
Have the clean tool remove depfiles

12 years agoUse the modification time of the depfile when computing restat_mtime
Peter Collingbourne [Sun, 4 Dec 2011 02:51:30 +0000 (02:51 +0000)]
Use the modification time of the depfile when computing restat_mtime

Fixes issue #144.

12 years agoFactor out Edge::EvaluateDepFile
Peter Collingbourne [Fri, 25 Nov 2011 15:18:03 +0000 (15:18 +0000)]
Factor out Edge::EvaluateDepFile

12 years agomore whitespace in build output
Evan Martin [Mon, 5 Dec 2011 21:38:31 +0000 (13:38 -0800)]
more whitespace in build output

12 years agoremove reference to nonexistent file
Evan Martin [Mon, 5 Dec 2011 21:30:38 +0000 (13:30 -0800)]
remove reference to nonexistent file

12 years agoadd help output to clean tool
Evan Martin [Mon, 5 Dec 2011 21:25:56 +0000 (13:25 -0800)]
add help output to clean tool

12 years agoprettify manual for tools
Evan Martin [Mon, 5 Dec 2011 21:22:09 +0000 (13:22 -0800)]
prettify manual for tools

12 years agoalso spell-check the 'clean' tool; abort on misspelling
Evan Martin [Mon, 5 Dec 2011 21:20:49 +0000 (13:20 -0800)]
also spell-check the 'clean' tool; abort on misspelling

12 years agominor manual touchups
Evan Martin [Mon, 5 Dec 2011 20:22:54 +0000 (12:22 -0800)]
minor manual touchups

12 years agosplit out tool list into a separate subcommand
Evan Martin [Mon, 5 Dec 2011 20:03:04 +0000 (12:03 -0800)]
split out tool list into a separate subcommand

Fits the -h output on one screen again, and allows more whitespace
in both the -h output and the tool list.

12 years agodisable the 'unused parameter' warning
Evan Martin [Mon, 5 Dec 2011 19:53:33 +0000 (11:53 -0800)]
disable the 'unused parameter' warning

It was firing too often, and hadn't uncovered any bugs.

12 years agoMerge pull request #150 from luislavena/mingw-no-visibility
Evan Martin [Mon, 5 Dec 2011 18:24:07 +0000 (10:24 -0800)]
Merge pull request #150 from luislavena/mingw-no-visibility

visibility=hidden should not be used for Windows

12 years agoMerge pull request #149 from luislavena/mingw-static
Evan Martin [Mon, 5 Dec 2011 18:22:12 +0000 (10:22 -0800)]
Merge pull request #149 from luislavena/mingw-static

Use g++'s -static option instead of specific libs

12 years agovisibility=hidden should not be used for Windows
Luis Lavena [Mon, 5 Dec 2011 15:08:47 +0000 (12:08 -0300)]
visibility=hidden should not be used for Windows

While GCC 4.x supports the usage of -fvisibility=hidden and the related
pragmas, usage of it under MinGW is a noop and should not be used.

Instead, __declspec(dllexport/dllimport) should be used instead to
indicate exportable functions.

Since Ninja builds a static library, no functions are exported and
visibility, at least under MinGW, is not an issue.

12 years agoUse g++'s -static option instead of specific libs
Luis Lavena [Mon, 5 Dec 2011 14:55:05 +0000 (11:55 -0300)]
Use g++'s -static option instead of specific libs

MinGW g++ recognizes -static as option to avoid the need to specify
individual libraries to be statically linked into the executable.

It also solves the warning of -static-libstdc++ not being recorgnized by
GCC 4.5.2 (TDM build)

12 years agofix some minor style issues in RecomputeDirty
Evan Martin [Sun, 4 Dec 2011 21:11:05 +0000 (13:11 -0800)]
fix some minor style issues in RecomputeDirty

12 years agowhen an edge is dirty, mark all outputs dirty
Evan Martin [Sun, 4 Dec 2011 21:07:11 +0000 (13:07 -0800)]
when an edge is dirty, mark all outputs dirty

The logic before was like:
  for each output:
    if edge_dirty or output.dirty:
      output.dirty = true
      edge_dirty = true

This was wrong in the case where the second output would case the edge
to be dirty; we needed to go back and mark the first output dirty as
well.  Fixed by taking two passes: one to compute the dirty state,
then a latter sweep to mark all outputs.

Fixes issue 148.

12 years agorefactor RecomputeOutputDirty to return true/false for dirty
Evan Martin [Sun, 4 Dec 2011 20:15:27 +0000 (12:15 -0800)]
refactor RecomputeOutputDirty to return true/false for dirty

Rather than taking whether the edge is dirty as an input, instead
only consider the arguments and return true/false, allowing the caller
to decide what to do with that information.  (In the restat case we
were faking out the environment to get particular behavior for this.)

Should have no side effects, but this is part of fixing issue 148.

12 years agoadd a test case from issue 148
Evan Martin [Sun, 4 Dec 2011 20:14:28 +0000 (12:14 -0800)]
add a test case from issue 148

12 years agowindows: don't buffer stdout
Evan Martin [Fri, 2 Dec 2011 05:53:00 +0000 (21:53 -0800)]
windows: don't buffer stdout

12 years agoHACKING: windows notes
Evan Martin [Fri, 2 Dec 2011 05:35:27 +0000 (21:35 -0800)]
HACKING: windows notes

12 years agobootstrap.sh: windows (mingw) fixes
Evan Martin [Fri, 2 Dec 2011 05:34:34 +0000 (21:34 -0800)]
bootstrap.sh: windows (mingw) fixes

- Don't build browse.cc in bootstrap.sh.
- Explicitly call out to Python to run configure.py.
- Run ninja-bootstrap with no arguments to build the default target,
which is "ninja.exe" on Windows.

12 years agoconfigure.py: windows updates
Evan Martin [Fri, 2 Dec 2011 05:33:33 +0000 (21:33 -0800)]
configure.py: windows updates

- Drop unused 'windows' platform
- Make 'mingw' platform actually work on mingw-on-Windows.

12 years agowindows: clear process launch structs before using them
Evan Martin [Fri, 2 Dec 2011 04:39:39 +0000 (20:39 -0800)]
windows: clear process launch structs before using them