Evan Martin [Sun, 1 May 2011 02:04:23 +0000 (19:04 -0700)]
git: ignore python droppings
Evan Martin [Sun, 1 May 2011 01:49:50 +0000 (18:49 -0700)]
drop reserved words 'build'/'rule'/'subninja'/etc.
Instead, parse them as normal words, which makes them work as paths.
We instead rely on the *position* (i.e., we start a statement with a
keyword and not a path) to distinguish the keyword 'build' from the file
'build'.
Evan Martin [Sun, 1 May 2011 02:01:33 +0000 (19:01 -0700)]
doc shell semantics of rule commands
Evan Martin [Sun, 1 May 2011 01:48:48 +0000 (18:48 -0700)]
rename the manual phony target to "manual"
Evan Martin [Sun, 1 May 2011 01:44:55 +0000 (18:44 -0700)]
doxygen: restore references docs
Evan Martin [Sat, 30 Apr 2011 22:13:33 +0000 (15:13 -0700)]
Merge pull request #33 from arnaudgelas/master.
fix compilation error / warning on Mac 10.5
Evan Martin [Sat, 30 Apr 2011 19:14:50 +0000 (12:14 -0700)]
check in a ninja file generator Python module
Arnaud Gelas [Sat, 30 Apr 2011 12:39:48 +0000 (08:39 -0400)]
fix warnings on Mac 10.5
structures had virtual functions but not virtual destructors
Arnaud Gelas [Sat, 30 Apr 2011 12:37:38 +0000 (08:37 -0400)]
fix compilation error on Mac 10.5
std::vector<>::data() does not exist
Evan Martin [Sat, 30 Apr 2011 09:35:28 +0000 (02:35 -0700)]
Merged pull request #32 from iwadon/fix-graph-test.
fix SEGV in graph_test
Hiroyuki Iwatsuki [Fri, 29 Apr 2011 23:08:56 +0000 (08:08 +0900)]
fix SEGV in graph_test
Evan Martin [Fri, 29 Apr 2011 18:19:11 +0000 (11:19 -0700)]
reduce doxygen output
Evan Martin [Fri, 29 Apr 2011 18:03:03 +0000 (11:03 -0700)]
add doxygen-compatibile comments to most classes
Evan Martin [Fri, 29 Apr 2011 17:58:43 +0000 (10:58 -0700)]
fix a signedness warning
Evan Martin [Fri, 29 Apr 2011 17:57:46 +0000 (10:57 -0700)]
Merged pull request #31 from polrop/generate-whole-graph.
The 'graph' tool now generates a graph based on all root nodes when called without any target. The build.ninja file is also adjusted so that we get the whole graph generated (including the doxygen part).
Evan Martin [Fri, 29 Apr 2011 17:55:26 +0000 (10:55 -0700)]
Merged pull request #30 from polrop/more-tools.
adds the -C option and the following tools: targets, rules and clean
Evan Martin [Thu, 28 Apr 2011 07:45:00 +0000 (00:45 -0700)]
Merged pull request #29 from polrop/minor-bug-fix.
Minor bug fix
Alexei Svitkine [Tue, 26 Apr 2011 18:49:49 +0000 (11:49 -0700)]
include location of error in parse error messages in EvalEnv strings
E.g. when parsing "foo = ${bar", point at the correct location of
the missing curly brace.
Nicolas Despres [Mon, 18 Apr 2011 16:24:42 +0000 (18:24 +0200)]
Generate the entire graph not only for the 'all' target.
This way we can see the 'doxygen' target and also some object file we
forgot to add as input of the link rule.
Nicolas Despres [Thu, 14 Apr 2011 13:28:43 +0000 (15:28 +0200)]
Add the 'clean' tool.
It removes built files either by rule or target or everything.
Nicolas Despres [Sun, 10 Apr 2011 16:18:31 +0000 (18:18 +0200)]
graph: Assume all root nodes if no target given.
This way we can generate the complete graph.
Nicolas Despres [Sun, 10 Apr 2011 16:29:13 +0000 (18:29 +0200)]
Add the 'rules' tool.
It can be useful in conjunction with the 'targets' tool for writing shell
completion scripts and when debugging.
Nicolas Despres [Sun, 10 Apr 2011 11:32:24 +0000 (13:32 +0200)]
Add the 'targets' tool.
This tool list targets by depth or by rule. It can be useful:
- for shell completion script ;
- to know what are the primary targets: ninja -t targets depth 1 ;
- to know targets that are linked: ninja -t rule link ;
- when debugging.
It works by first listing the root nodes and then following the input nodes
of their in edge.
Nicolas Despres [Sat, 9 Apr 2011 17:45:24 +0000 (19:45 +0200)]
Add -C DIR option.
Can be useful when calling ninja from a script or a code editor or in many
other occasions. It costs nothing and does not bring more complexity, so
I think we can afford it.
Nicolas Despres [Tue, 26 Apr 2011 08:06:54 +0000 (10:06 +0200)]
graph: Report errors if a target does not exist.
Nicolas Despres [Sun, 10 Apr 2011 17:57:28 +0000 (19:57 +0200)]
Do not always require a target when a tool is run.
Adjust tools options parser and documentation.
Nicolas Despres [Sun, 10 Apr 2011 17:57:28 +0000 (19:57 +0200)]
Remove no longer used current working directory.
It has been introduced by 761a3c when ManifestParser::set_root() existed.
It is no longer the case so we can save some time querying it now.
Nicolas Despres [Thu, 14 Apr 2011 12:51:15 +0000 (14:51 +0200)]
Document.
Nicolas Despres [Thu, 14 Apr 2011 09:00:19 +0000 (11:00 +0200)]
Remove useless inclusion of stdio.h.
Nicolas Despres [Thu, 14 Apr 2011 08:59:13 +0000 (10:59 +0200)]
Use Error() to report error.
This way we get the error message prefixed by the program name. It helps
while debugging.
Nicolas Despres [Sat, 9 Apr 2011 17:51:21 +0000 (19:51 +0200)]
Prefix perror(3) messages with program name.
It make it easier while debugging to know who is reporting the error:
Ninja itself or one of the command called by Ninja during the build
process or one of the generator which called Ninja.
Evan Martin [Mon, 25 Apr 2011 18:58:02 +0000 (11:58 -0700)]
don't close null log files
Philip Craig [Sat, 23 Apr 2011 10:36:49 +0000 (11:36 +0100)]
Close() and unlink() files in ways that make Windows happy
This will make the build log compaction work on Windows.
It will also make the tests no longer leave a temp log file around.
Sergey Nenakhov [Sat, 23 Apr 2011 21:19:16 +0000 (14:19 -0700)]
[windows] disable smart terminal support
Sergey Nenakhov [Sat, 23 Apr 2011 21:16:23 +0000 (14:16 -0700)]
[windows] disable browse tool on Windows for now
Sergey Nenakhov [Sat, 23 Apr 2011 21:15:59 +0000 (14:15 -0700)]
[windows] use local getopt.h
Sergey Nenakhov [Sat, 23 Apr 2011 21:15:07 +0000 (14:15 -0700)]
[windows] get processor count using Windows API
Sergey Nenakhov [Sat, 23 Apr 2011 21:09:45 +0000 (14:09 -0700)]
[windows] extend hash_map.h for Windows hash_map
Sergey Nenakhov [Sat, 23 Apr 2011 21:07:17 +0000 (14:07 -0700)]
[windows] fix class/struct confusion
Evan Martin [Sat, 23 Apr 2011 21:05:56 +0000 (14:05 -0700)]
[win] check in public-domain getopt implementation
Evan Martin [Sat, 23 Apr 2011 20:42:26 +0000 (13:42 -0700)]
use kMaxPathComponents in proper place
Evan Martin [Sat, 23 Apr 2011 00:03:15 +0000 (17:03 -0700)]
optimize CanonicalizePath
Null build of Chrome:
before I added extra calls to CanonicalizePath: 1.25s.
with extra calls to CanonicalizePath: 1.35s.
with new CanonicalizePath: 1.05s.
And now CanonicalizePath isn't hot on profiles anymore.
Evan Martin [Fri, 22 Apr 2011 21:53:59 +0000 (14:53 -0700)]
fix typo in comment in bootstrap.sh
Evan Martin [Fri, 22 Apr 2011 18:29:36 +0000 (11:29 -0700)]
Merge branch 'doxygen'
Evan Martin [Fri, 22 Apr 2011 17:58:40 +0000 (10:58 -0700)]
canonicalize paths on the command-line as they're used
I'm not entirely happy with my solution. I think Ninja should
always use canonicalized paths internally, so we should canonicalize
all paths as we receive them (from the command line and from build
files). But there are other places where we pass paths around
(like in all the tool commands) and I don't want to add manual calls
to canonicalize in each.
Perhaps the longer-term solution is to add some sort of
GetNodeCanonicalize() to State and then make all of the functions that
work with paths as strings (like Builder::AddTarget or RunBrowsePython)
instead only accept a Node*.
Evan Martin [Fri, 22 Apr 2011 17:49:42 +0000 (10:49 -0700)]
use util's CanonicalizePath in parsers as well
Evan Martin [Fri, 22 Apr 2011 17:45:42 +0000 (10:45 -0700)]
handle foo//bar in CanonicalizePath
Evan Martin [Fri, 22 Apr 2011 17:36:07 +0000 (10:36 -0700)]
actually link in util_test
Nicolas Despres [Thu, 21 Apr 2011 05:35:39 +0000 (07:35 +0200)]
doxygen_mainpage is not an implicit dependency.
This way it does not appear in the $in variables.
Nicolas Despres [Mon, 18 Apr 2011 19:59:15 +0000 (21:59 +0200)]
Adjust DOXYGEN_MAINPAGE rule description.
Now it prints its output file.
Nicolas Despres [Mon, 18 Apr 2011 19:31:13 +0000 (21:31 +0200)]
Touching README and co triggers rebuild of doxygen.
Before the main page was an order-only dependency of the doxygen target.
Thus, modification in the README did not triggers rebuild of the doxygen
target as it ought to be.
We have several ways to fix this issue:
1) Make the '$builddir/doxygen_mainpage' target an explicit dependency:
build $builddir/doxygen_mainpage: doxygen_mainpage \
README HACKING COPYING | $doxygen_mainpage_generator
build doxygen: doxygen doxygen.config $builddir/doxygen_mainpage
2) Duplicate the explicit dependencies of the '$builddir/doxygen_mainpage'
target as implicit dependencies of the 'doxygen' target and keep the
'$builddir/doxygen_mainpage' target as an order-only dependency:
build $builddir/doxygen_mainpage: doxygen_mainpage \
README HACKING COPYING | $doxygen_mainpage_generator
build doxygen: doxygen doxygen.config \
| README HACKING COPYING \
|| $builddir/doxygen_mainpage
I chose the first option since the doxygen executable only cares about its
first argument. But it would not be the case for all commands. So I
think introducing "slice" support for the $in and $out variables would be
great. This way I could rewrite the 'doxygen' rule this way:
rule doxygen
command = doxygen $in[0]
description = DOXYGEN $in[0]
Note that using variables to avoid duplication does not work since the
three files are seen as a single one:
doxygen_deps = README HACKING COPYING
build $builddir/doxygen_mainpage: doxygen_mainpage \
$doxygen_deps | $doxygen_mainpage_generator
build doxygen: doxygen doxygen.config \
| $doxygen_deps \
|| $builddir/doxygen_mainpage
Maybe Ninja's philosophy expects the generators to generate the second
option.
Nicolas Despres [Mon, 18 Apr 2011 18:52:37 +0000 (20:52 +0200)]
Prefix error messages by script name.
It helps when debugging compilation output to know who is speaking even if
Ninja buffers command output contrary to make.
Nicolas Despres [Mon, 18 Apr 2011 18:49:20 +0000 (20:49 +0200)]
Make include_file() never returns 1.
Otherwise the script is stopped because errexit option is set.
Nicolas Despres [Mon, 18 Apr 2011 07:23:42 +0000 (09:23 +0200)]
Call error() not fatal() if file is not found.
Nicolas Despres [Mon, 18 Apr 2011 07:17:44 +0000 (09:17 +0200)]
Add missing Apache license header.
Reviewed by Evan Martin.
Nicolas Despres [Mon, 18 Apr 2011 07:16:47 +0000 (09:16 +0200)]
Fix gitignore line for Doxygen.
Reviewed by Evan Martin.
Evan Martin [Mon, 18 Apr 2011 03:14:31 +0000 (20:14 -0700)]
Merge branch 'term-fix' of https://github.com/SByer/ninja
Nicolas Despres [Thu, 14 Apr 2011 17:28:46 +0000 (19:28 +0200)]
Add doxygen support.
Evan Martin [Fri, 15 Apr 2011 19:26:45 +0000 (12:26 -0700)]
Merge branch 'master' of github.com:martine/ninja
Conflicts:
src/util.cc
src/util.h
Thiago Farina [Fri, 15 Apr 2011 19:22:07 +0000 (12:22 -0700)]
Remove the declaration of DumpBacktrace.
This function was removed on
01880fb3a2a13f9071e9729c3a13752846828ed2.
Thiago Farina [Sat, 19 Mar 2011 21:53:43 +0000 (18:53 -0300)]
Move CanonicalizePath into util.h so it can be shared by the other modules.
Also add util_test.cc and move the CanonicalizePathTest into there.
Signed-off-by: Thiago Farina <tfarina@chromium.org>
Scott Byer [Thu, 7 Apr 2011 21:16:06 +0000 (14:16 -0700)]
Fix an exception when terminal is narrow or set for unlimited width
Evan Martin [Tue, 22 Mar 2011 21:29:48 +0000 (14:29 -0700)]
Merge branch 'errors-reporting' of https://github.com/polrop/ninja
Nicolas Despres [Tue, 22 Mar 2011 07:48:16 +0000 (08:48 +0100)]
Add missing CPP guards.
Nicolas Despres [Mon, 21 Mar 2011 20:43:08 +0000 (21:43 +0100)]
Prefix error messages with program name.
It make it easier while debugging to know who is reporting the error:
Ninja itself or one of the command called by Ninja during the build
process or one of the generator which called Ninja.
Evan Jones [Thu, 17 Mar 2011 13:33:11 +0000 (09:33 -0400)]
Add link to mailing list to README.
IWATSUKI Hiroyuki [Mon, 14 Mar 2011 01:49:37 +0000 (18:49 -0700)]
src/inline.sh: fix typo
I (Evan) got this wrong in the previous commit.
IWATSUKI Hiroyuki [Sun, 13 Mar 2011 21:37:54 +0000 (14:37 -0700)]
inline.sh: BSD / OS X fixes
Evan Martin [Wed, 9 Mar 2011 00:03:13 +0000 (16:03 -0800)]
fix test that relied on pointer values
Evan Martin [Tue, 8 Mar 2011 23:54:01 +0000 (15:54 -0800)]
make bad build tests fail earlier
Evan Martin [Sat, 12 Mar 2011 00:00:39 +0000 (16:00 -0800)]
fix terrible bug in gyp patch
Evan Martin [Mon, 7 Mar 2011 22:42:44 +0000 (14:42 -0800)]
fix bootstrap when build dir already exists
Thiago Farina [Mon, 7 Mar 2011 22:34:25 +0000 (14:34 -0800)]
move the implementation of GraphViz to source file
Evan Martin [Mon, 7 Mar 2011 22:10:37 +0000 (14:10 -0800)]
update gyp patch
Evan Martin [Mon, 7 Mar 2011 22:10:00 +0000 (14:10 -0800)]
fix bootstrap by running python inliner too
Evan Martin [Mon, 7 Mar 2011 20:52:29 +0000 (12:52 -0800)]
inline.sh: rewrite for better portability
Orestis Agathokleous [Mon, 7 Mar 2011 20:25:55 +0000 (12:25 -0800)]
handle variable expansion with upper-case characters
Evan Martin [Sun, 6 Mar 2011 00:27:25 +0000 (16:27 -0800)]
use a shell script to inline browse.py
Relying on the inline-assembly trick was cute but it didn't work on
other platforms; relying on xxd will make us depend on xxd being
available. Instead, inline browse.py into a header using a shell
script.
(Making this work required fixing multiple bugs in ninja...)
Evan Martin [Mon, 7 Mar 2011 19:25:10 +0000 (11:25 -0800)]
files that have both implicit and explicit edges should be implicit
This is just deleting some code that was written in anticipation
of staying memory-resident; when loading a depfile, we don't need
to attempt to update existing entries in the dependency list, we
just need to blindly add them.
Evan Martin [Mon, 7 Mar 2011 17:56:18 +0000 (09:56 -0800)]
canonicalize paths loaded from depfiles
If a C file #includes "../foo.cc", then gcc will emit paths like
"bar/../foo.cc" into the dependency file; canonicalize these when we
load the file.
Add a test module for testing the graph dirty recomputation directly,
without all the build classes around it.
Evan Martin [Sun, 6 Mar 2011 01:40:42 +0000 (17:40 -0800)]
more comments
Evan Martin [Sun, 6 Mar 2011 01:39:48 +0000 (17:39 -0800)]
move VirtualFileSystem into test.*
Evan Martin [Sun, 6 Mar 2011 01:36:11 +0000 (17:36 -0800)]
move test support into test.*
Evan Martin [Sat, 5 Mar 2011 23:32:03 +0000 (15:32 -0800)]
don't rely on /proc for 'browse' mode
Instead, pass the script code via stdin.
We end up with a zombie (the child process that passes the script code)
because we can't ignore SIGCHLD in the parent (the Python code relies on
being able to wait for children), but the zombie dies with the outer
process. This probably could be avoided by double-forking or other
approaches, but it doesn't seem worth the effort.
Evan Martin [Sat, 5 Mar 2011 21:43:02 +0000 (13:43 -0800)]
factor browse out into its own file
Evan Martin [Sat, 5 Mar 2011 21:31:46 +0000 (13:31 -0800)]
chdir into a temp dir before disk tests
Evan Martin [Sat, 5 Mar 2011 21:19:37 +0000 (13:19 -0800)]
drop use of ar's T flag
This produces smaller archives, which is important for large projects
to not clobber your disk cache. But we are small (the resulting .a is
~3.5mb for debug) and it's not supported on older operating systems.
Evan Martin [Wed, 2 Mar 2011 20:22:07 +0000 (12:22 -0800)]
limit output width to prevent line-wrapping
Evan Martin [Tue, 1 Mar 2011 23:15:54 +0000 (15:15 -0800)]
linux: simpler way to get number of processors
From a conversation with Anatol Pomazau <anatol@google.com>.
Evan Martin [Tue, 1 Mar 2011 22:25:51 +0000 (14:25 -0800)]
print short name of command before dumping command stdout/stderr
Previously we showed the full command line, but with this change
we only show the full command line in verbose mode or when the
command fails.
Evan Martin [Mon, 28 Feb 2011 20:02:01 +0000 (12:02 -0800)]
drop DumpBacktrace
It wasn't that helpful; simplifies other platforms to just not use it.
Evan Martin [Mon, 28 Feb 2011 19:59:29 +0000 (11:59 -0800)]
update gyp patch
(Needed to fix Chrome build.)
Evan Martin [Mon, 28 Feb 2011 19:47:46 +0000 (11:47 -0800)]
get the number of CPUs on FreeBSD and OS X via sysctl()
From a patch from asmodai@in-nomine.org and dmitry@codingrobots.com.
asmodai [Mon, 28 Feb 2011 19:44:33 +0000 (11:44 -0800)]
bootstrap.sh: FreeBSD support
Evan Martin [Fri, 11 Feb 2011 16:36:44 +0000 (08:36 -0800)]
doc phony actions
Evan Martin [Thu, 10 Feb 2011 18:58:29 +0000 (10:58 -0800)]
check off todo
Ralph Giles [Mon, 7 Feb 2011 05:42:58 +0000 (21:42 -0800)]
Fix various typos.
Evan Martin [Tue, 8 Feb 2011 18:34:52 +0000 (10:34 -0800)]
Merge branch 'master' of https://github.com/geophree/ninja
Evan Martin [Tue, 8 Feb 2011 18:24:12 +0000 (10:24 -0800)]
Merge branch 'master' of neugierig.org:projects/git/ninja
Evan Martin [Tue, 8 Feb 2011 18:23:33 +0000 (10:23 -0800)]
quick-fix gyp.patch for chrome change