| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
* build: constify EdgeWanted()
* build: constify a bit of CommandRunner
* graph: constify functions of struct Edge
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
|
|
|
|
|
|
|
|
| |
After finishing an edge that produces a dyndep file, load the file and
update the build graph structure. Recompute the dirty state of all its
dependents and of newly reachable portions of the graph. Add edges to
the build plan that are discovered to be wanted. Finally, schedule
edges that are wanted and now ready to build.
|
|
|
|
|
|
|
| |
In order to later support dynamic updates to the build plan while
building, the Plan will need access to its Builder. Since this access
will be needed only for specific features we can avoid updating all Plan
constructions in the test suite by making this access optional.
|
|
|
|
|
| |
Move the logic to a new Plan::EdgeMaybeReady method so it can be re-used
elsewhere.
|
|
|
|
|
| |
Move the logic to mark edges as wanted over to a Plan::EdgeWanted method
so it can be re-used elsewhere later.
|
|
|
|
|
|
|
| |
Add an 'err' string argument and return a boolean for success. Update
call sites to pass an 'err' string argument and check the return value.
This will be useful later for adding logic to these methods that may
fail.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
This reverts commit 52c1d0c8f8545231581c4d51cb0a85f50564c415.
Fixes #1418.
|
|
|
|
|
|
|
|
|
|
|
| |
Developers tend to blame the last printed line when a build takes too
long. Unfortunately, when building concurrently, the last printed line
may have actually finished a long time ago. Under the current system,
ninja does not update the status line to reflect what jobs are still
running. This change makes ninja always print the oldest still running job
instead. In other words, the likely build bottlenecks.
Patch from David Zarzycki, originally uploaded at #1320.
|
|\
| |
| | |
Track in Plan whether wanted edges have been scheduled
|
| |
| |
| |
| |
| |
| |
| |
| | |
Refactor the `want_` map to track for wanted edges whether they have
been scheduled or not. This gives `ScheduleWork` a direct place to keep
this information, making the logic more robust and easier to follow. It
also future-proofs `ScheduleWork` to avoid repeat scheduling if it is
called after an edge has been removed from `ready_` by `FindWork`.
|
|/
|
|
|
|
| |
Ninja is supposed to be able to build as C++98 so it can run on old
systems, but it should also be possible to optionally build it with
newer dialects.
|
|
|
|
|
| |
We now detect and reject cycles in DependencyScan::RecomputeDirty before
Plan::AddTarget is called so we can assume DAG input to the Plan.
|
|
|
|
|
|
|
|
| |
https://groups.google.com/forum/#!msg/ninja-build/YQuGNrECI-4/ti-lAs9SPv8J
discusses a case where an rule updates its output file and then
fails. The next run of ninja considers the ouptut file clean
and doesn't rebuild it. Add a test for this case, which currently
fails.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
PR #999 made dumb terminals only output when edges finish. PrintStatus
is called after finished_edges_ is incremented, which means the
calculation for running edges will always return 1 less than the real
number of running processes. This happens on smart terminals too, but
ninja will immediately print the status for the next edge with
starting_edges_ incremented, so the incorrect value is never visible.
Pass a boolean specifying whether the status is being printed on an edge
finishing, and if so count the edge that just finished as being running.
|
|
|
|
|
|
|
| |
Use an enumeration instead of a boolean to clarify the purpose of
arguments at call sites.
Suggested-by: Nico Weber <nicolasweber@gmx.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When an edge finishes building, it should be release from its pool.
Make sure that this also is the case when an edge fails to build.
The bug can be shown with a pool has size N, then `ninja -k N+1` will
still stop after N failing commands for that pool, even if there are
many more jobs to be done for that pool:
pool mypool
depth = 1
rule bad_rule
command = false
pool = mypool
build a : bad_rule
build b : bad_rule
Current behaviour:
$ ninja -k 0
[1/2] false
FAILED: false
ninja: build stopped: cannot make progress due to previous errors.
Expected behaviour:
$ ninja -k 0
[1/2] false
FAILED: false
[2/2] false
FAILED: false
ninja: build stopped: cannot make progress due to previous errors.
Signed-off-by: Fredrik Medley <fredrik.medley@gmail.com>
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes #830, fixes #904.
In practice, this either happens with 64-bit inodes and a 32-bit
userspace when building without -D_FILE_OFFSET_BITS=64 in CFLAGS, or
when a filename is longer than the system file length limit.
Since DiskInterface::Stat() returns -1 on error, and Node used -1 on
"stat state unknown", not aborting the build lead to ninja stat()ing the
same file over and over again, until it finally ran out of stack. That's
now fixed.
* Change RecomputeOutputsDirty() to return success instead of dirty
state (like RecomputeDirty()) and return the dirty state in a bool
outparam
* Node::Stat()s old return value wasn't used anywhere, change the
function to return success instead and add an |err| outparam
* Node::StatIfNecessary()'s old return value was used only in one place.
Change that place to explicitly check status_known() and make
StatIfNecessary() return success and add an |err| outparam
* Plan::CleanNode() can now fail, make it return bool and add an |err|
outparam
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Added NestedPhonyPrintsDone unit test
|
| |
|
|
|
|
| |
We "using namespace std" anywhere we need a std::string or a std::vector.
|
|
|
|
|
|
|
|
| |
Using the timestamp of the .d file was wrong. It can be written
at a different time than the output, and it is immediately deleted
after parsing; only the output remains for subsequent timestamp
comparison purposes, so always use the output's timestamp. (This
is how the code worked on Windows already.)
|
| |
|
|\
| |
| |
| |
| | |
This merges a new mechanism for tracking "depfile" dependencies that
is faster on all platforms but dramatically so on Windows.
|
| |
| |
| |
| |
| |
| | |
The first test I wrote was wrong; write a simpler test that exercises
the "no failures" code paths, then fix the second test and the bugs it
exposed.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
WaitForCommand now passes all command output via a struct.
This will allow adding more output in a future change.
|
|/ |
|
| |
|
|\
| |
| | |
Resource pools for ninja
|
| | |
|
| | |
|
|/
|
|
|
| |
(That found one more issue, but I think that might be a bug in
-Wdocumentation, http://llvm.org/PR14295.)
|
|
|
|
|
| |
The deduced type was char* with size 4 and not char[32] with size 32.
This removes strange output characters on Windows.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
For %o, remove a superfluous + 0.5: snprintf("%f") rounds already.
Remove some unnecessary code.
For %c, fix a TODO to add a sliding window and update after every
completed edge. Else, with -j50 and several files that take 3s to
compile each, this number would only update every 150s. Also give
the number one decimal place so that this can measure steps slower
than 1s.
|
|
|
|
|
|
|
| |
The build log is needed in computing whether an edge is
dirty, so I think it belongs here. (It's a bit weird
that Builder needs to reach into it to record completed
commands, maybe it will become cleaner with more thought.)
|
|
|
|
|
|
|
|
|
|
| |
Rather than passing States and DiskInterfaces through all the calls,
put the necessary ambient information in a new DependencyScan object
and move the code accordingly.
Note: I didn't move the source location of the functions to preserve
history, though this does result in a sort of weird order for the
functions in graph.cc.
|
|
|
|
|
|
|
|
|
|
| |
Fixes issue #392 (didn't handle creating nested build dirs right).
Moves MakeDir out of util.h; all code should go through
DiskInterface to simplify testing. Moves ownership of the
DiskInterface into the client of the Builder, which also allows
removing some code that reached inside the object as well as
a minor leak.
|