Normally an edge with a dyndep binding cannot be scheduled until its
dyndep file is loaded because we require the dyndep file to be an input.
However, in the case that one edge produces multiple dyndep files as
outputs, none of their dependent edges is blocked on its dyndep input
because all the dyndep files are ready. Load all of the dyndep files
before recomputing graph readiness to avoid mistakenly scheduling an
edge that appears to be ready only because its dyndep information has
not been loaded yet.
Fixes: #2782
cmake_minimum_required(VERSION 3.9) and higher already set this
policy. Further, the canonical way for projects to set individual
policies is as done for CMP0135 in this project.
Introduces a `--status FMT` command-line flag that configures the
progress status using Ninja's regular `$var`/`${var}` syntax with
descriptive variable names ($finished, $total, $progress, $elapsed,
etc.) instead of the `%`-escapes used by `NINJA_STATUS`. When passed,
it takes precedence over `NINJA_STATUS`; the env-var path is left
unchanged for backwards compatibility.
When $builddir is set in the manifest, passing "foo" on the command
line now checks for a target named "foo" first, then falls back to
"$builddir/foo" before reporting an error.
Appends a duplicate path record to a valid deps log and verifies that
recovery truncates it away on the first load, and the second load
succeeds cleanly.
In DepsLog::Load(), the file offset used for truncation-based recovery
was advanced past each record immediately after reading its bytes from
disk, but before validating the record's semantic correctness (e.g. the
path checksum or node-id range checks). When a record was structurally
complete but semantically invalid, recovery truncated the file to an
offset that included the bad record, so it was never removed.
This created an infinite cycle: every build would load the deps log, hit
the corrupt record, "recover" by truncating everything after it (but not
the record itself), then append new dependency records that would be
destroyed by the next build's recovery. The result was spurious rebuilds
on every invocation.
Move the offset update to the end of the loop body, after all validation
has passed. Now when a record fails validation, the offset still points
before it, and truncation correctly removes it.
Fixes#2703
Since commit 8e6c741a4b ("explain" debug prints just before each command
is run, 2022-01-06, v1.13.0~1^2~56^2~2) the "loading dyndep file '...'"
explanation has not been printed. Instead the explanation has been
recorded for the dyndep file's node *after* it has been brought
up-to-date, and therefore never printed.
This explanation is generated just before its operation runs, so we can
print it immediately instead of buffering it.
Fixes: #2758
This was regressed by commit 8e6c741a4b ("explain" debug prints just
before each command is run, 2022-01-06, v1.13.0~1^2~56^2~2). Add a
test demonstrating the problems, called out by FIXME comments.
Issue: #2758, #2759
RecomputeNodeDirty checks both dyndep and depfile bindings when an edge
is first encountered. Consolidate them into a single conditional block.
This simplification was missed in commit 0f0fb3275d (Teach RecomputeDirty
to load dyndep files that are ready, 2015-11-05, v1.10.0~1^2~53^2~7).
Previously we were relying on RecomputeNodeDirty to do
this before LoadDeps. Avoid this non-local assumption.
Suggestd-by: David 'Digit' Turner <digit+github@google.com>
The browse tool did not correctly encode targets containing '%', causing them to be interpreted incorrectly after URL decoding.
Fix this by URL-encoding targets using urllib.parse.quote when generating links.
The import changes are compatible with both Python 2.7 and Python 3.x.
Additionally included a test to ensure complex target names are preserved exactly during parsing.
Fixes#2652