| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
In an earlier version of 791c887e22046e5e7a2d05ecb5ff27701d56895d those
functions returned LoadStatus, too, but it was changed back to bool.
|
|
|
|
| |
This is step 4 on #931.
|
|
|
|
|
|
|
|
|
| |
The ANSI code page identifier is more information than generator
programs actually need. The encoding of `build.ninja` is always
either UTF-8 or the system-wide ANSI code page. Reduce the output
to provide no more information than the generator programs need.
The Console code page can be obtained in other ways, so drop it.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since commit 00459e2b (Use UTF-8 on Windows 10 Version 1903, fix #1195,
2021-02-17), `ninja` does not always expect `build.ninja` to be encoded
in the system's ANSI code page. The expected encoding now depends on
how `ninja` is built and the version of Windows on which it is running.
Add a `-t wincodepage` tool that generators can use to ask `ninja`
what encoding it expects.
Issue: #1195
|
|\
| |
| | |
missingdeps tool, take 2
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The tool looks for targets that depend on a generated file, but do not
properly specify a dependency on the generator. It needs to be run after
a successful build, and will list all potential flakes that may have
broken the build, but didn't due to accidental build step ordering.
The search relies on the correctness of depfile and generator output
information, but these are usually easier to get right than dependencies.
The errors found can usually be verified as actual build flakes by trying
to build the listed problematic files alone in a clean build directory.
Such builds usually fail with a compile job lacking a generated file.
There is some overlap between this tool and 'gn check', but not everyone
uses gn, not everyone using gn uses gn check, and most importantly, gn
check is more about modularity, and less about actual build-time deps
without flakes.
The tool needs to be run after a build completes and depfile data is
collected. It may take several seconds to process, up to a dozen or
two on a large, chromium-sized build.
|
| |
| |
| |
| |
| |
| | |
Send all output after manifest parsing is finished to the Status
interface, so that when status frontends are added they can handle
build messages.
|
| |
| |
| |
| |
| |
| | |
Make BuildStatus an abstract interface, and move the current
implementation to StatusPrinter, to make way for a serialized
Status output.
|
|/
|
|
|
|
|
|
| |
The times that end up in the build log currently originate in the
status printer, and are propagated back out to the Builder. Move
the edge times into the Builder instead, and move the overall start
time into NinjaMain so it doesn't get reset during manifest
rebuilds.
|
|
|
|
|
|
|
|
| |
Edges are nominally ordered by order in the build manifest, but in
fact are ordered by memory address. In most cases the memory address
will be monontonically increasing. Since serialized build output will
need unique IDs, add a monotonically increasing ID to edges, and use
that for sorting instead of memory address.
|
|
|
|
| |
header files
|
| |
|
|
|
|
|
| |
This results in a huge speed up for large builds (e.g. Chromium). See
#1718.
|
|
|
|
|
| |
This will become handy when the generator only wants to restat the
build.ninja entry in the log. See #1718.
|
|\ |
|
| |\
| | |
| | | |
manifest_parser: remove multi-output depslog restriction
|
| | | |
|
| |\ \
| | | |
| | | | |
Add restat tool which recalculates all mtimes in the build log
|
| | | | |
|
| | |/ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The conditional `(!n || !n->in_edge()) && ` was moved up. It now needs
to be inversed because there's a `return false;`. See
https://github.com/ninja-build/ninja/commit/3beebde51a2089ecb01820f1428efe0263deaeea#diff-78294872cbf9d32f4f972288561fa718R146
and
https://github.com/ninja-build/ninja/pull/1432#discussion_r321827528
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Quoting from the Linux man page for errno,
"The value in errno is significant only when the return value of the call
indicated an error (i.e., -1 from most system calls; -1 or NULL from most
library functions); a function that succeeds is allowed to change errno. The
value of errno is never set to zero by any system call or library function."
Successful calls to getcwd are allowed to set errno causing the compilation
database not to be written. Spurious failures of this nature were observed on
AIX.
Adjust the error handling for getcwd so that errno is only checked if the call
returned NULL.
|
| | |
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
| |
but are no longer produced by the current manifest. For now adding a dedicated
"-t cleandead" option, since it should be run after reading the log; ideally
it should be part of the build config and done before to start looking for
dirty targets so that an incremental build would produce the same end result
as a clean build from scratch. But since I am not 100% sure to understand the
comment in the NinjaMain::isPathDead(), I opted to make it a tool for now to
avoid impacting users who want to keep those files.
The option name "cleandead" was selected insteadof something like "reap" to
keep the "clean" prefix.
|
|
|
|
|
|
|
|
|
| |
This tool is useful for writing shell completion script for tools
expecting a rule name as argument.
The tool was dropped by 34b46f28c.
Fix #1024.
|
| |
|
|
|
|
|
|
| |
Teach the `-t graph` tool to load dyndep files because they are part of
the build graph. Issue a warning when the dyndep file cannot be loaded
cleanly. This will help users visualize the complete build graph.
|
|
|
|
|
|
|
|
| |
`Cleaner` provides two constructors that are the same except that one
constructs a "real" disk interface internally and the other takes a
caller-provided disk interface. A real disk interface is already
available at the only call site for the former constructor. Use it
directly and drop the unnecessary constructor variant.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
You can still opt out of this by passing `-w dupbuild=warn`.
But if you're getting this diagnostic, your build files are incorrect
and you should ideally just fix them.
This is step 3 on https://github.com/ninja-build/ninja/issues/931
I sent an RfC to ninja-build a few months ago; nobody objected.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
References to response files in a clang compile_commands.json file can
be tricky to deal with when tooling expects all the command flags to be
present in the 'command' field.
This change introduces a '-x' option to '-t compdb' that will expand
@rspfile style response file invocations inline.
E.g.
```sh
$ ninja -t compdb cc
[
{
"directory": "/src/foo",
"command": "cc -foo -bar @foo.obj.rsp",
"file": "foo.cc"
}
]
$ ninja -t compdb -x cc
[
{
"directory": "/src/foo",
"command": "cc -foo -bar foo.cc",
"file": "foo.cc"
}
]
```
|
|\
| |
| | |
Don't clean up after ourselves when exiting.
|
| |
| |
| |
| |
| |
| | |
Destruction of NinjaMain can be an expensive operation when dealing
with stupidly large ninjafiles. exit directly instead of returning out
of real_main to avoid doing so.
|
|\ \
| | |
| | | |
Update Usage to show "-k 0" behavior
|
| |/
| |
| | |
For "-k N", N==0 is interpreted as infinite. It's useful but not documented in the help, unfortunately.
|
|/ |
|
|\
| |
| | |
Use high-resolution timestamps
|
| |
| |
| |
| | |
This prepares it for higher-resolution timestamps.
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since commit v1.8.0^2~3^2~1 (Teach RecomputeDirty to detect cycles in
the build graph, 2015-11-13) we correctly reject self-referencing phony
build statements like
build a: phony a
as cycles. Unfortunately this breaks support for CMake 2.8.12.x and
3.0.x because those versions incorrectly produce edges of this form
(that we used to tolerate). In order to preserve compatibility with
those CMake versions we need to restore tolerance of these edges.
Add a special case to the manifest parser to filter out self-referencing
inputs of phony edges of the form produced by those CMake versions.
Warn by default, but add a `-w phonycycle={err,warn}` option to make it
an error.
Fixes: #1322
|
|
|
|
|
|
| |
This will allow more options to be added without updating everywhere
that constructs a ManifestParser. Also extend the AssertParse function
to take the options so tests can control them.
|
|
|
|
|
|
|
|
| |
As a fix for #874, we started reloading the entire manifest even if the
manifest was never rebuilt due to a restat rule. But this can be slow,
so call State::Reset instead, which also fixes the original crash.
Fixes #987
|
|\
| |
| | |
Allow more path components
|