2723 Commits

Author SHA1 Message Date
Jan Niklas Hasse
15d8ead0fc Ignore all kinds of build directories 2019-08-28 10:01:32 +02:00
Jan Niklas Hasse
6f27f9642c CMake: Fix Windows build 2019-08-28 10:01:32 +02:00
Jan Niklas Hasse
691b821c90 CMake: Support building without re2c 2019-08-28 10:01:32 +02:00
Jan Niklas Hasse
ec6e7c7a77 Add CMake build file as an alternative to configure.py 2019-08-28 10:01:32 +02:00
Brett Vickers
3242c794fa Improve error messages when ninja commands fail on Windows.
When a call to the Win32 API CreateProcessA fails, ninja
now outputs the exact command string that caused it to fail.
It also detects when the command contained leading whitespace
and outputs a hint that lets the user know why the command
failed.
2019-08-27 17:09:47 -07:00
Colin Finck
21eb8669ff
Fix MinGW bootstrap build by applying the fix in appveyor.yml permanently. 2019-08-26 18:49:47 +02:00
Jan Niklas Hasse
ae3130c9bc Travis CI: Use Python 3 to configure build
Python 2 doesn't support nanosecond timestamps properly (see #1554).
2019-08-19 10:22:03 +02:00
Michael Jones
0dfa8a48eb Expand the continuous integration coverage to more platforms / operating systems (#1612) 2019-08-13 19:08:42 +02:00
ThePrez
bd17f23623 Enable build on IBM i platform (#1630)
* No perfstat for IBM i (OS400) AIX variant
* Allow for future IBM i to identify as 'os400'
2019-08-09 18:05:12 +02:00
Jan Niklas Hasse
6d8c19a13f
Merge pull request #1604 from jessemckenna/correct-cpu-count-over-64
Enable ninja to use > 64 CPUs on Windows
2019-08-08 11:52:19 +02:00
bungeman
78f700c35c
Recommend MD over MMD for header dependencies.
The MMD flag will silently omit includes found through pointy brackets or system include paths. This can lead to issues not only when system headers change, but any paths included through the isystem flag. Because the isystem flag implicitly turns off warnings as errors it has often come to be used as a "not my code" flag used with local third party dependencies which may be frequently updated or changed for debugging. As a result, it is far safer to default to MD (which includes all include dependencies) in this example.
2019-08-06 17:27:53 -04:00
Jan Niklas Hasse
0ea27d728d
Merge pull request #1513 from nykula/master
Use st_mtim if st_mtime is macro, fix #1510
2019-08-06 15:25:36 +02:00
Jan Niklas Hasse
c41a107bb7
Merge pull request #1622 from goshhhy/aix
fix building ninja_test on AIX 6.1
2019-08-06 13:47:19 +02:00
goshhhy
0cb85516b4 Fix appveyor.yml (#1621)
Add escaping for sed command. Fixes #1611.
2019-08-06 09:58:41 +02:00
ky0ko
5521085b2d fix building ninja_test on AIX 6.1 2019-08-05 14:55:23 -07:00
Jan Niklas Hasse
70c8d75055
Merge pull request #1508 from mqudsi/colored_fail
Emit "FAILED: " in red if terminal supports ANSI color output
2019-08-02 15:04:39 +02:00
Jan Niklas Hasse
20af31d586 compdb: Dump every rule without any arguments, fix #1377 2019-08-02 14:59:46 +02:00
Jan Niklas Hasse
66b4cc94c4 Improve const-correctness in compdb related methods 2019-08-02 14:57:51 +02:00
Jesse McKenna
007e029ea3 Update WIN32_WINNT from 0x0501 (Windows XP) to 0x0601 (Windows 7) to support processor-group Windows API 2019-07-23 15:10:17 -07:00
Jesse McKenna
a3a5d60622 Make GetProcessorCount() count processors across all processor groups 2019-07-12 13:32:10 -07:00
Jan Niklas Hasse
e0bc2e5fd9
Merge pull request #1016 from moroten/docs-empty-rule-uptodate
Describe how to make a phony rule always up to date
2019-07-09 14:43:16 +02:00
Jan Niklas Hasse
4d3b315329
Merge pull request #1517 from chagui/1492-add-headers-to-ninja_log
#1492 add column headers to .ninja_log
2019-07-02 14:46:53 +02:00
Jan Niklas Hasse
e6aeab8578
Merge pull request #1342 from Lekensteyn/depfile-fixes
Follow GCC/Clang behavior wrt depfiles
2019-06-18 11:15:46 +02:00
Peter Wu
fba5ce0736 Follow GCC/Clang behavior wrt depfiles
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
44c160f916/lib/Frontend/DependencyFile.cpp (L316)
22a8377023/libcpp/mkdeps.c (L47)

Fixes https://github.com/ninja-build/ninja/issues/1262
2019-06-07 22:49:52 -07:00
Jan Niklas Hasse
28a7d14913 Fix UB "member call on null pointer of type 'DepsLog'", see #1248 2019-05-28 14:22:15 +02:00
ikifof
714621dba1 Adding a way to clean dead build artifacts that have an entry in the build log,
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.
2019-05-25 11:14:43 -07:00
Jan Niklas Hasse
20b30dac66 Ignore .ccls-cache directory 2019-05-10 17:05:07 +02:00
Jan Niklas Hasse
1db07edafc
Merge pull request #1025 from nicolasdespres/resurrect-rules-tool
Resurrect the 'rules' tool.
2019-05-09 17:38:06 +02:00
Nicolas Despres
bb9512f53d Resurrect the 'rules' tool.
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.
2019-05-09 16:36:47 +02:00
Jan Niklas Hasse
2e64645749
Merge pull request #1521 from bradking/dyndep
dyndep: dynamically discovered dependencies for Fortran and C++20 modules
2019-04-20 13:28:13 +02:00
Brad King
1d55d05afd Document example dyndep use cases
Show a simple example of Fortran module dependencies (this use case
motivated the entire dyndep feature).  Also show an example of tarball
extraction, a case that few other buildsystems can handle cleanly.
2019-04-18 08:21:44 -04:00
Brad King
014a5414c4 Document dyndep binding behavior and the dyndep file format 2019-04-18 08:21:44 -04:00
Brad King
e1a58793ef query: load dyndep files for queried edges 2019-04-18 08:21:44 -04:00
Brad King
a32e047b4f graph: load dyndep files
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.
2019-04-18 08:21:44 -04:00
Brad King
a3cbb4d4dd clean: remove outputs specified by dyndep files
Some outputs may not be known in the main build manifest and are instead
discovered through a dyndep binding.  Load dyndep files that are
available during cleaning so that we can clean these outputs too.
2019-04-18 08:21:44 -04:00
Brad King
c21f3f2a1d clean: remove unnecessary Cleaner constructor variant
`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.
2019-04-18 08:21:44 -04:00
Brad King
2375707bdf Teach builder to load dyndep files when they are ready
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.
2019-04-18 08:21:44 -04:00
Brad King
0f0fb3275d Teach RecomputeDirty to load dyndep files that are ready
The full readiness of a node that has a dyndep binding cannot be known
until after the dyndep file is loaded.  If a dyndep file is ready while
constructing the build plan it can be loaded immediately so full
information can be used to decide whether anything needs to be built.
If a dyndep file is not ready while constructing the build plan then the
edges naming it cannot be ready either because the dyndep file is one of
their inputs.  In this case we defer loading the dyndep file until the
build plan is being executed.
2019-04-18 08:21:44 -04:00
Brad King
e5c22c0a4b Teach DependencyScan to load a dyndep file
Add a LoadDyndeps method to load a dyndep file and update
the edges that name it in their dyndep binding.
2019-04-18 08:21:44 -04:00
Brad King
a497076951 Add a "dyndep" reserved binding to the manifest format
Allow rules or build statements to specify one of the build statement
inputs in a "dyndep" binding.  This will later be used to load
dependency information from the specified file.
2019-04-18 08:21:44 -04:00
Brad King
c4b0c21ba9 Add a parser for a new "dyndep" file format
Define a file format suitable for specifying dynamically-discovered
dependency information for build edges.  Design a format inspired by the
build manifest format and using the same lexer.  Start with a required
format version specification followed by "build" statements that add
implicit inputs and outputs to existing edges.
2019-04-18 08:21:44 -04:00
Brad King
325602ca41 Explicitly avoid repeat deps loading
Track for each Edge whether depfile information has been loaded using an
explicit flag.  This will allow RecomputeDirty to be repeated for an
edge without loading deps again.
2019-04-18 08:21:44 -04:00
Brad King
b08f3fb869 Make a Builder optionally available to Plan
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.
2019-04-18 08:21:44 -04:00
Brad King
083a9e2e7a Factor out output edge ready check from Plan::NodeFinished
Move the logic to a new Plan::EdgeMaybeReady method so it can be re-used
elsewhere.
2019-04-18 08:21:44 -04:00
Brad King
64acb1a22b Factor out edge marking logic from Plan::AddSubTarget
Move the logic to mark edges as wanted over to a Plan::EdgeWanted method
so it can be re-used elsewhere later.
2019-04-18 08:21:44 -04:00
Brad King
70d356218b Teach FakeCommandRunner to support multiple active commands
Replace our single active edge pointer with a vector and add a
parameter that tests can set to limit the number of concurrent
edges.  Set the default to 1 to preserve the current behavior.
Specific tests will be able to override it later to simulate
concurrent builds.
2019-04-18 08:21:44 -04:00
Brad King
e50299c500 Allow EdgeFinished and NodeFinished to fail with errors
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.
2019-04-18 08:21:44 -04:00
Brad King
54520575cd Assert precondition in BuildStatus::BuildEdgeStarted
This method should be called only with edges that have not
already been started.
2019-04-18 08:21:44 -04:00
Brad King
d718808392 Factor out a base class of ManifestParser
Create a Parser base class that holds parser functionality not specific
to the build manifest file format.  This will allow it to be re-used for
other parsers later.
2019-04-18 08:21:44 -04:00
Brad King
215a190a57 ManifestParser: Fix typo {expectd => expected} 2019-04-18 08:21:44 -04:00