| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A common problem in the Android build is inserting rules that perform
some sort of error checking that doesn't produce any artifacts needed
by the build, for example static analysis tools. There are a few
patterns currently used, both of which have downsides.
The first is to have a rule that depends on all of the static analysis
results. This ensures they run, but requires running static analysis
over everything, and not just the active parts of the build graph.
The second is to insert the static analysis rule into the build graph
between the artifact producing rule and anything that depends on it,
often copying the artifact as the output of the static analysis rule.
This increases the critical path of the build, often reducing
parallelism. In the case of copying the artifact, it also wastes
disk space.
This patch adds "validation nodes" to edges in Ninja. A build
statement can specify validation nodes using "|@" in the edge
inputs. The validation nodes are not used as an input to the edge
(the edge can run before the validation node is ready), but are
added to the initial nodes of the build graph whenever the edge
is part of the build graph. The edge that outputs the validation
node can depend on the output of the edge that is being validated
if desired.
Test: ninja_test
Change-Id: Ife27086c50c1b257a26509373199664680b2b247
|
|
|
|
| |
header files
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Lexer::ReadIdent() now sets last_token_ before returning, like
Lexer::ReadEvalString() does. So all "expected identifiers" and things
that call ReadIdent (pool parser, rule parser, let parser, code parsing
the rule name after a : in a build line) now point the "^ near here" at
what was there instead of the previous last_token
According to manifest_parser_perftest, this is perf-neutral.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It turns out to be trickier than expected to process these correctly.
It turns out to also be trickier than expected to give a nice error
message on encountering these. But the behavior prior to this patch
would just be silent failures where we attempted to examine paths
that accidentally contained embedded \r.
For now, fix all regexes of the form [^...] to include \r in the
excluded block, then assert that we get a vague lexer error near the
problem.
In the future perhaps we can open manifest files in text mode on Windows
or just disallow Windows-style CRLF in the manual.
|
|
|
|
|
| |
The lexer already mostly allowed this, except that chars >127 were
being interpreted as negative indexes into the lexer table.
|
|
|
|
|
| |
'$:' is a valid string now, it expands to ':'
update error messages and show a hint when something went wrong.
|
|
|
|
|
|
|
|
| |
Needed for Windows drive names.
For instance configure with gtest:
python configure.py --with-gtest=c$:\gtest-1.6.0
|
|\
| |
| | |
Lexer: include leading spaces in the newline token.
|
| |
| |
| |
| | |
This means that indented blank lines are skipped without causing errors.
|
|/
|
|
| |
This probably should have been part of commit eeed7241
|
|
|
|
| |
Indented comments are ignored rather than causing errors.
|
| |
|
| |
|
| |
|
| |
|
|
- 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.
|