| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
The last patch was good enough for simple use cases, but if a dependency
was added to the implicit output, Kati would create a phony rule in
addition to the implicit output.
This patch will cause the rules to be combined into a single DepNode,
combining any variables and dependencies.
Change-Id: I92c9e5b6fdb8bfe49d0cef0a5fa22def4acd6d99
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add .KATI_IMPLICIT_OUTPUTS target-specific variable to add extra
implicit outputs to the build line in the ninja file. This doesn't
actually affect the node graph within Kati, but combined with
--gen_all_targets should be usable.
This allows us to properly define the build graph in ninja when one rule
creates multiple files. There are a number of ways that people attempt
to do this in make, all of which have problems:
a b:
touch a b
Define multiple outputs with the same rule. This looks correct to most
people, but actually runs the rule multiple times -- once for every
output file. Most of the time this works, but runs into very strange
concurrency issues when the two rules happen to run at the same time.
a:
touch a b
Only define one of the files in the graph. Then users need to depend on
a file that they don't use, and the unlisted file won't be noticed if
it's updated separately (or even removed).
b: a
a:
touch a b
Define dependencies between the multiple files. This doesn't actually
know how to update `b` if `b` is older than `a`, or doesn't exist.
b: a
touch b
a:
touch a b
A variant of the previous approach, which can "fix" the timestamp if the
original rule happened to create `b` before `a`. This can be even more
dangerous, since it may create / update `b` improperly.
But since ninja supports a graph where there can be multiple outputs
from a single edge, with this patch we can write:
a: .KATI_IMPLICIT_OUTPUTS := b
a:
touch a b
which translates to:
rule rule1
command = touch a b
build a | b: rule1
This ninja will allow users to depend on either `a` or `b`, and the rule
will be run (once) as appropriate.
Change-Id: Ieb9ced7eb4d212b0aa4de5ceb1deb9ba48ada132
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For Android builds, we'd like to start removing some of the default
warnings and turn them into errors so that they can't come back.
For find emulator, we could attempt to check for errors, or silence
every find command in the tree, but that doesn't particularly scale,
especially when new code gets added with warnings. We've gone through
and fixed many of these, but they keep coming back, so add
--werror_find_emulator so that when we fix them all we can prevent them
from coming back.
Overriding commands is similar -- we really don't want multiple rules
defining a single output file. In ninja we've turned on -w dupbuild=err,
but if the paths happen to be identical the makefile overriding logic
kicks in first and presents a warning instead of an error. So add
--werror_overriding_commands in order to turn the make warning into an
error.
|
|
|
|
|
|
|
|
|
|
| |
This adds new (WARN|KATI_WARN|ERROR)_LOC log macro variants that take a
location as the first argument, and will prefix that location
information to the warning/error lines.
When --color_warnings is enabled, it reformats them to have a standard
warning:/error: infix, and adds colors in order to match the
warnings/errors produced by clang.
|
|
|
|
|
|
|
|
| |
Setting .KATI_NINJA_POOL as a rule variable will set the corresponding
pool variable in the ninja file.
There's no way to define custom pools in Kati, Android is planning on
scaling the pool depth in a parent ninja file without re-running Kati.
|
|
|
|
|
| |
No obvious time differences when building AOSP, but these all seem like
reasonable changes.
|
| |
|
|
|
|
|
| |
.POSIX pseudo target should change the behavior of $(shell).
This also implements .POSIX for ckati's non-ninja mode.
|
|
|
|
|
|
|
|
|
|
| |
Add a global flag that is set to "true" when .POSIX: is encountered. The
flag will switch the bash flags from "-c" to "-ec", i.e. enable correct
error handling of shell command lines.
Fixes https://github.com/google/kati/issues/48
Change-Id: Ieea386742b05b52d209b74e640e14212f0e2da88
|
| |
|
|
|
|
|
|
| |
After this patch, multiple Rule objects won't be merged to
a single rule. Instead, DepBuilder holds the list of Rules
and directly write merged results to DepNode.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Kati doesn't have default rules for them.
|
| |
|
| |
|
|
|
|
|
| |
When there are multiple implicit patterns in a rule, recipe
should be used only once.
|
| |
|
| |
|
|
|
|
|
| |
Unlike other target specific variables, this variable must
not be propagated to other targets.
|
| |
|
|
|
|
| |
Only disabling all suffix rules is supported.
|
| |
|
|
|
|
|
|
|
| |
--gen_all_targets started traversing the dependency graph from
random node. This may prevent target specific variables in
parents from being applied. With this patch, we always traverse
the graph from nodes without parents.
|
| |
|
|\
| |
| |
| |
| | |
Conflicts:
dep.cc
|
| |
| |
| |
| |
| |
| |
| |
| | |
When using --gen_all_targets / --gen_all_phony_targets, we're changing
the selected targets using unordered containers. This causes trivial
changes to the makefiles to trigger large changes to the generated ninja
files. Switch to using ordered containers so that the order is the same
every time.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is an experimental kati-specific expansion for GNU make.
Targets specified by this will have "restat = 1" in generated
ninja files.
Even with this change, kati should be still compatible with
GNU make. GNU make will ignore this but this only means GNU
make will do some extra unnecessary builds. This different
should not change the final output as long as .KATI_RESTAT is
used appropriately.
TODO: Implement the same feature in exec.cc and add a test.
|
|
|
|
|
| |
We have the first target as default only when --gen_all_targets
or --gen_all_phony_targets.
|
|
|
|
|
|
|
|
|
| |
make treats the first target it sees as the default target if no goals
are passed on the commmand line. When generating a ninja file, mark
this target with "default" to make it build if no goals are passed to
ninja.
Change-Id: I11befa4f88b8ca8734fdc7dd470c2a0a3722410d
|
| |
|
| |
|
|
|
|
|
| |
This flag should work even with targets specified in a command
line.
|
| |
|
|
|
|
| |
So we will be able to use the command line parser for sub-makes.
|
|
|
|
|
| |
Let me keep this flag for a while, as there would be some
people who are still using m2n+ninja.sh workflow.
|
|
|
|
|
|
|
|
| |
Only the first rule should be built if no targets are in the arguments.
This wasn't a problem for ninja, since the target was again passed to
ninja.
Change-Id: Ia5381b89411fcc9b164c83de5faee46029897423
|
| |
|
| |
|
|
|
|
|
| |
Also specify the default target not to build all phony targets
by default.
|
|
|
|
| |
Also add order_only2.mk
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
28.0 secs => 1.8 secs
|
| |
|