| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
Some tools generate completely empty depfiles when
there are no implicit inputs. This patch modifies the
depfile parser to support them.
Fixes #2357
|
|
|
|
|
|
|
|
|
| |
The checked in sources (depfile_parser.cc and lexer.cc) have the re2c version
embedded in it. The output didn't change since re2c 1.3, except for the
different version number.
A reproducible build would use a pinned version of re2c anyway, so there
is no need to hardcode its value in the checked in generated files.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Added ability to parse escaped colons in GCC Dep files enabling ninja to parse dep files of GCC 10 on Windows
* Added generated depfile_parser.cc
* Addressed formatting
* Added extra tests with real world examples of paths produced by both GCC 10 and Clang and GCC pre 10. Adjusted one test so it doesn't fail
* Adjusted regular expression to not match \: if the character following the : is either EOF or whitespace
* Fixed typo in regex (should be 0x20 for space not 0xa)
* Changed regular expression form using lookahead to instead matching a separate expression. This was needed as re2c pre version 1.17 is broken when using lookaheads. Also added tests for \: followed by whitespace
* Addressed formatting
* Forgot a missing std::
* Fixed formatting for spaces after , as well as respecting column width
|
|
|
|
|
| |
This ensures the current behavior of rejecting this case due to `x`
being reused as an input.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The option is called "depfile = gcc" and should support depfiles created
by GCC. GCC does not escape backslashes and GNU Make does not try to
unescape it, so neither should Ninja try to "unescape" it.
Only space (' ') and hash sign ('#') are specially treated by GCC/Clang.
Note that while tabs are also treated specially by GCC, Clang does not,
so do not special case it (why would someone use tabs in a filename?).
Support for 2N trailing backslashes in a filename is a bit questionable,
but is added to be as consistent as possible with GCC/Clang.
See also
https://github.com/llvm-mirror/clang/blob/44c160f916a1b080098b17b466b026aa07475ec2/lib/Frontend/DependencyFile.cpp#L316
https://github.com/gcc-mirror/gcc/blob/22a8377023d59cc01ab0a84a1df56d0e1336efa3/libcpp/mkdeps.c#L47
Fixes https://github.com/ninja-build/ninja/issues/1262
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Prior to introduction of depfile parser handling of multiple rules,
ninja silently accepted a depfile of the form:
out: in1 in2 in3
other: otherIn1 otherIn2 otherIn3
and incorrectly treated `other` and `otherIn*` as additional inputs to
`out`. Now we prefer to reject this just as we already do for a depfile
specifying multiple outputs on one line. However, this can break
existing cases where such a depfile was silently tolerated.
Add a `-w depfilemulti={err,warn}` option to control this behavior,
and make it just a warning by default.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently we handle Makefile rules of the form:
out: in1 in2 in3
and the form:
out: in1 \
in2 \
in3
Teach the depfile parser to handle the additional form:
out: in1
out: in2
out: in3
This is also valid Makefile syntax and is the depfile format
generated by the Intel Compiler for Windows.
Note that the `gcc -MP` option adds empty phony rules to the generated
Makefile fragment:
out: in1 in2 in3
in1:
in2:
in3:
Previously we tolerated these because they were treated as inputs, which
was accidentally correct. Instead we must now tolerate these by
ignoring targets for which no dependencies are specified.
|
|
|
|
|
| |
Re-arrange the existing logic to support later addition of post-token
code even for empty tokens.
|
| |
|
|
|
|
|
|
| |
This allows paths with "[", "]" and "%" to appear in depfiles.
Previously, only "[" would be handled properly.
Fixes #1227.
|
| |
|
|\
| |
| | |
Allow paths with international characters in depfiles
|
| | |
|
|/
|
|
| |
This is a prerequisite for fixing #417.
|
| |
|
|
|
|
| |
Fixes #752.
|
|
|
|
|
|
|
|
| |
The range was added in 7ab6dcbdb6447861eefafc47fc3e10f3273cede2, but that
change only tried to add ! to the character class. Fix by moving '-' to the end
of the class.
Fixes #694.
|
|
|
|
|
|
|
| |
See http://llvm.org/PR15642. I checked that gcc does produce depfiles
containing "$$" for files with "$" signs in their name (and as of
r178540, so does clang). I also checked that .d files that escape dollar
signs with "\$" are not read correctly by make.
|
|
|
|
|
| |
See funny paths in
https://github.com/google/libcxx/tree/master/test/iterators/stream.iterators/istreambuf.iterator/
|
| |
|
|
|
|
|
|
| |
This reverts commit 904c9610fe66c4f4bd63a07d6f057c8603d24394.
The commit caused issue #380, this revert fixes it. The revert
also makes the test from the previous commit pass.
|
|\
| |
| | |
Make StringPiece data members private.
|
| |
| |
| |
| | |
Signed-off-by: Thiago Farina <tfarina@chromium.org>
|
|/ |
|
|
|
|
| |
Fixes issue #327.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Older versions of GCC would produce broken depfiles when -MT or -MQ is used
gcc43 -MT foo.o -MMD -MF foo.o.d -o foo.o -c foo.c
will result in the following depfile
foo.o foo.o: <dependencies>
Parse multiple outputs unifying duplicates and correctly report errors if
they are different.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
- '.' 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.
|
| |
|
|
|
|
| |
Add some comments as well.
|
|
|
|
| |
From a patch from Allan Odgaard <github@simplit.com>.
|
|
|
|
|
|
|
|
| |
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>.
|
| |
|
|
|